1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

fix(crypto): fix assertion

This commit is contained in:
Ondřej Vejpustek 2023-09-19 16:55:55 +02:00
parent 4a686d9231
commit 72acf9d285

View File

@ -886,7 +886,7 @@ void bn_sqrt(bignum256 *x, const bignum256 *prime) {
// http://en.wikipedia.org/wiki/Quadratic_residue#Prime_or_prime_power_modulus // http://en.wikipedia.org/wiki/Quadratic_residue#Prime_or_prime_power_modulus
// If prime % 4 == 3, then sqrt(x) % prime == x**((prime+1)//4) % prime // If prime % 4 == 3, then sqrt(x) % prime == x**((prime+1)//4) % prime
assert(prime->val[BN_LIMBS - 1] % 4 == 3); assert(prime->val[0] % 4 == 3);
// e = (prime + 1) // 4 // e = (prime + 1) // 4
bignum256 e = {0}; bignum256 e = {0};