Merge commits '1b1fc093 6c2a39da 31860823 abd25054 4ba1ba2a 03bbe8c6 13ed6f65 a7a51171 2abb35b0 e56716a3 3f54ed8c d84bb83e ' into temp-merge-1661
This commit is contained in:
@@ -395,6 +395,7 @@ static void secp256k1_nonce_function_musig(secp256k1_scalar *k, const unsigned c
|
||||
static int secp256k1_musig_nonce_gen_internal(const secp256k1_context* ctx, secp256k1_musig_secnonce *secnonce, secp256k1_musig_pubnonce *pubnonce, const unsigned char *input_nonce, const unsigned char *seckey, const secp256k1_pubkey *pubkey, const unsigned char *msg32, const secp256k1_musig_keyagg_cache *keyagg_cache, const unsigned char *extra_input32) {
|
||||
secp256k1_scalar k[2];
|
||||
secp256k1_ge nonce_pts[2];
|
||||
secp256k1_gej nonce_ptj[2];
|
||||
int i;
|
||||
unsigned char pk_ser[33];
|
||||
size_t pk_ser_len = sizeof(pk_ser);
|
||||
@@ -444,13 +445,20 @@ static int secp256k1_musig_nonce_gen_internal(const secp256k1_context* ctx, secp
|
||||
secp256k1_musig_secnonce_save(secnonce, k, &pk);
|
||||
secp256k1_musig_secnonce_invalidate(ctx, secnonce, !ret);
|
||||
|
||||
/* Compute pubnonce as two gejs */
|
||||
for (i = 0; i < 2; i++) {
|
||||
secp256k1_gej nonce_ptj;
|
||||
secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &nonce_ptj, &k[i]);
|
||||
secp256k1_ge_set_gej(&nonce_pts[i], &nonce_ptj);
|
||||
secp256k1_declassify(ctx, &nonce_pts[i], sizeof(nonce_pts[i]));
|
||||
secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &nonce_ptj[i], &k[i]);
|
||||
secp256k1_scalar_clear(&k[i]);
|
||||
secp256k1_gej_clear(&nonce_ptj);
|
||||
}
|
||||
|
||||
/* Batch convert to two public ges */
|
||||
secp256k1_ge_set_all_gej(nonce_pts, nonce_ptj, 2);
|
||||
for (i = 0; i < 2; i++) {
|
||||
secp256k1_gej_clear(&nonce_ptj[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
secp256k1_declassify(ctx, &nonce_pts[i], sizeof(nonce_pts[i]));
|
||||
}
|
||||
/* None of the nonce_pts will be infinity because k != 0 with overwhelming
|
||||
* probability */
|
||||
|
||||
Reference in New Issue
Block a user