MCPcopy Create free account
hub / github.com/ElementsProject/elements / GenerateRangeproofECDHKey

Function GenerateRangeproofECDHKey

src/blindpsbt.cpp:90–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90uint256 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
103bool 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{

Callers 1

BlindPSBTFunction · 0.85

Calls 8

CSHA256Class · 0.85
MakeNewKeyMethod · 0.80
ECDHMethod · 0.80
GetPubKeyMethod · 0.45
sizeMethod · 0.45
FinalizeMethod · 0.45
WriteMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected