Fix pylint issues

Create a new function for calculating the number of hex digits needed
for a certain amount of limbs.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2023-02-06 18:03:39 +01:00
parent b62ad5d569
commit 05c138e172
No known key found for this signature in database
GPG key ID: FEE76C0CF8C6267D
2 changed files with 8 additions and 2 deletions

View file

@ -149,7 +149,9 @@ class EcpP521R1Raw(bignum_common.ModOperationCommon,
@property
def arg_a(self) -> str:
return super().format_arg('{:x}'.format(self.int_a)).zfill(2 * self.hex_digits - 2 * self.bits_in_limb // 8)
# Number of limbs: 2 * N - 1
hex_digits = bignum_common.hex_digits_for_limb(2 * self.limbs - 1, self.bits_in_limb)
return super().format_arg('{:x}'.format(self.int_a)).zfill(hex_digits)
def result(self) -> List[str]:
result = self.int_a % self.int_n