Skip to content

Commit 44881b2

Browse files
committed
f rename is_positive in schnorrsig module to has_square_y
1 parent affa6e8 commit 44881b2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/modules/schnorrsig/main_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ int secp256k1_schnorrsig_sign(const secp256k1_context* ctx, secp256k1_schnorrsig
7777
secp256k1_ge_set_gej(&pk, &pkj);
7878

7979
/* Because we are signing for a x-only pubkey, the secret key is negated
80-
* before signing if the point corresponding to the secret key is not
81-
* positive. */
80+
* before signing if the point corresponding to the secret key does not
81+
* have a square Y. */
8282
if (!secp256k1_fe_is_quad_var(&pk.y)) {
8383
secp256k1_scalar_negate(&x, &x);
8484
}

src/modules/schnorrsig/tests_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,15 @@ void test_schnorrsig_taproot(void) {
664664
secp256k1_xonly_pubkey output_pk;
665665
unsigned char output_pk_bytes[32];
666666
unsigned char tweak[32];
667-
int is_positive;
667+
int has_square_y;
668668
unsigned char msg[32];
669669
secp256k1_schnorrsig sig;
670670

671671
/* Create output key */
672672
secp256k1_rand256(sk);
673673
CHECK(secp256k1_xonly_pubkey_create(ctx, &internal_pk, sk) == 1);
674674
memset(tweak, 1, sizeof(tweak));
675-
CHECK(secp256k1_xonly_pubkey_tweak_add(ctx, &output_pk, &is_positive, &internal_pk, tweak) == 1);
675+
CHECK(secp256k1_xonly_pubkey_tweak_add(ctx, &output_pk, &has_square_y, &internal_pk, tweak) == 1);
676676
CHECK(secp256k1_xonly_pubkey_serialize(ctx, output_pk_bytes, &output_pk) == 1);
677677

678678
/* Key spend */
@@ -688,7 +688,7 @@ void test_schnorrsig_taproot(void) {
688688
/* Verify script spend */
689689
CHECK(secp256k1_xonly_pubkey_parse(ctx, &output_pk, output_pk_bytes) == 1);
690690
CHECK(secp256k1_xonly_pubkey_parse(ctx, &internal_pk, internal_pk_bytes) == 1);
691-
CHECK(secp256k1_xonly_pubkey_tweak_verify(ctx, &output_pk, is_positive, &internal_pk, tweak) == 1);
691+
CHECK(secp256k1_xonly_pubkey_tweak_verify(ctx, &output_pk, has_square_y, &internal_pk, tweak) == 1);
692692
}
693693

694694
void run_schnorrsig_tests(void) {

0 commit comments

Comments
 (0)