musig: ensure point_load output is normalized
This is similar to the upstream commit "Normalize ge produced from secp256k1_pubkey_load".
This commit is contained in:
parent
7a07f3d33f
commit
e593ed5685
@ -41,8 +41,10 @@ static void secp256k1_point_load(secp256k1_ge *ge, const unsigned char *data) {
|
|||||||
} else {
|
} else {
|
||||||
/* Otherwise, fall back to 32-byte big endian for X and Y. */
|
/* Otherwise, fall back to 32-byte big endian for X and Y. */
|
||||||
secp256k1_fe x, y;
|
secp256k1_fe x, y;
|
||||||
secp256k1_fe_set_b32_mod(&x, data);
|
int ret = 1;
|
||||||
secp256k1_fe_set_b32_mod(&y, data + 32);
|
ret &= secp256k1_fe_set_b32_limit(&x, data);
|
||||||
|
ret &= secp256k1_fe_set_b32_limit(&y, data + 32);
|
||||||
|
VERIFY_CHECK(ret);
|
||||||
secp256k1_ge_set_xy(ge, &x, &y);
|
secp256k1_ge_set_xy(ge, &x, &y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user