mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
CT: Don't assume size of a serialized pubkey (removes a magic number).
This commit is contained in:
parent
88a31dff93
commit
d2d0fd02fa
1 changed files with 3 additions and 2 deletions
|
|
@ -217,8 +217,9 @@ int BlindOutputs(std::vector<uint256 >& input_blinding_factors, const std::vecto
|
|||
CKey ephemeral_key;
|
||||
ephemeral_key.MakeNewKey(true);
|
||||
CPubKey ephemeral_pubkey = ephemeral_key.GetPubKey();
|
||||
out.nNonce.vchCommitment.resize(33);
|
||||
memcpy(&out.nNonce.vchCommitment[0], &ephemeral_pubkey[0], 33);
|
||||
assert(ephemeral_pubkey.size() == CConfidentialNonce::nCommittedSize);
|
||||
out.nNonce.vchCommitment.resize(ephemeral_pubkey.size());
|
||||
memcpy(&out.nNonce.vchCommitment[0], &ephemeral_pubkey[0], ephemeral_pubkey.size());
|
||||
// Generate nonce
|
||||
uint256 nonce = ephemeral_key.ECDH(output_pubkeys[nOut]);
|
||||
CSHA256().Write(nonce.begin(), 32).Finalize(nonce.begin());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue