1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Merge pull request #7482 from gabor-mezei-arm/6029_use_core_api_in_ecp_mod_koblitz

[Bignum] Use core API in ecp_mod_koblitz()
This commit is contained in:
Paul Elliott
2023-05-10 17:24:46 +01:00
committed by GitHub
2 changed files with 89 additions and 49 deletions

View File

@ -672,8 +672,7 @@ class EcpP256K1Raw(bignum_common.ModOperationCommon,
@property
def arg_a(self) -> str:
hex_digits = bignum_common.hex_digits_for_limb(448 // self.bits_in_limb, self.bits_in_limb)
return super().format_arg('{:x}'.format(self.int_a)).zfill(hex_digits)
return super().format_arg('{:x}'.format(self.int_a)).zfill(2 * self.hex_digits)
def result(self) -> List[str]:
result = self.int_a % self.int_n