Skip to content

Commit 6aa7df2

Browse files
committed
Check for equality before computing indexhash
As suggested by @theStack.
1 parent 4b387ef commit 6aa7df2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/modules/frost/keygen_impl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,11 @@ static int secp256k1_frost_lagrange_coefficient(secp256k1_scalar *r, const unsig
410410
for (i = 0; i < n_participants; i++) {
411411
secp256k1_scalar mul;
412412

413-
secp256k1_frost_compute_indexhash(&mul, ids33[i]);
414-
if (secp256k1_scalar_eq(&mul, &party_idx)) {
413+
if (secp256k1_memcmp_var(ids33[i], my_id33, 33) == 0) {
415414
continue;
416415
}
417416

417+
secp256k1_frost_compute_indexhash(&mul, ids33[i]);
418418
secp256k1_scalar_negate(&mul, &mul);
419419
secp256k1_scalar_mul(&num, &num, &mul);
420420
secp256k1_scalar_add(&mul, &mul, &party_idx);

0 commit comments

Comments
 (0)