| 88 | } |
| 89 | |
| 90 | uint256 GenerateRangeproofECDHKey(CPubKey& ephemeral_pubkey, const CPubKey blinding_pubkey) |
| 91 | { |
| 92 | // Generate ephemeral key for ECDH nonce generation |
| 93 | CKey ephemeral_key; |
| 94 | ephemeral_key.MakeNewKey(true); |
| 95 | ephemeral_pubkey = ephemeral_key.GetPubKey(); |
| 96 | assert(ephemeral_pubkey.size() == CConfidentialNonce::nCommittedSize); |
| 97 | // Generate nonce |
| 98 | uint256 nonce = ephemeral_key.ECDH(blinding_pubkey); |
| 99 | CSHA256().Write(nonce.begin(), 32).Finalize(nonce.begin()); |
| 100 | return nonce; |
| 101 | } |
| 102 | |
| 103 | bool CreateValueRangeProof(std::vector<unsigned char>& rangeproof, const uint256& value_blinder, const uint256& nonce, const CAmount amount, const CScript& scriptPubKey, const secp256k1_pedersen_commitment& value_commit, const secp256k1_generator& gen, const CAsset& asset, const uint256& asset_blinder) |
| 104 | { |