Skip to content

Commit

Permalink
ecmult_gen: Simplify code (no observable change)
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Jul 5, 2022
1 parent 4cc0b1b commit 7a86955
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ecmult_gen_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,11 @@ static void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const
return;
}
/* The prior blinding value (if not reset) is chained forward by including it in the hash. */
secp256k1_scalar_get_b32(nonce32, &ctx->blind);
secp256k1_scalar_get_b32(keydata, &ctx->blind);
/** Using a CSPRNG allows a failure free interface, avoids needing large amounts of random data,
* and guards against weak or adversarial seeds. This is a simpler and safer interface than
* asking the caller for blinding values directly and expecting them to retry on failure.
*/
memcpy(keydata, nonce32, 32);
VERIFY_CHECK(seed32 != NULL);
memcpy(keydata + 32, seed32, 32);
secp256k1_rfc6979_hmac_sha256_initialize(&rng, keydata, 64);
Expand Down

0 comments on commit 7a86955

Please sign in to comment.