Fix logic in bn_from_bytes(..., apply_modulus=True)

pull/263/head
Bogdan Opanchuk 2021-04-12 21:55:26 -07:00
parent 7d0f2fe3e2
commit a7f4a7a634
1 changed files with 3 additions and 2 deletions

View File

@ -182,8 +182,9 @@ def bn_from_bytes(bytes_seq: bytes, set_consttime_flag=True, check_modulus=None,
with backend._tmp_bn_ctx() as bn_ctx:
res = backend._lib.BN_mod(bignum, bn, apply_modulus, bn_ctx)
backend.openssl_assert(res == 1)
return bn
return bignum
else:
return bn
def bn_to_bytes(bn, length: int):