Skip to content

Commit

Permalink
generator: cleanups in Pedersen/generator code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
apoelstra authored and sanket1729 committed Feb 8, 2023
1 parent 0a60069 commit 6162d57
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/generator/main_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6162d57

Please sign in to comment.