generator: cleanups in Pedersen/generator code

Silence a compiler warning about an unitialized use of a scalar in case
the user tries to provide a 0-length list of commitments.

Also ensures that commitments have normalized field elements when they
are loaded into ges.
This commit is contained in:
Andrew Poelstra 2022-07-12 18:56:44 +00:00 committed by sanket1729
parent 0a6006989f
commit 6162d577fe

View File

@ -391,6 +391,7 @@ int secp256k1_pedersen_blind_generator_blind_sum(const secp256k1_context* ctx, c
}
secp256k1_scalar_set_int(&sum, 0);
secp256k1_scalar_set_int(&tmp, 0);
/* Here, n_total > 0. Thus the loop runs at least once.
Thus we may use a do-while loop, which checks the loop