Attempt to pacify pylint in bignum tests
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
parent
dc19759327
commit
1133d2325b
4 changed files with 26 additions and 41 deletions
|
@ -64,21 +64,11 @@ class BignumModRawInvPrime(bignum_common.ModOperationCommon,
|
|||
input_style = "arch_split"
|
||||
arity = 1
|
||||
suffix = True
|
||||
|
||||
@property
|
||||
def is_valid(self) -> bool:
|
||||
return self.int_a > 0 and self.int_a < self.int_n
|
||||
|
||||
@property
|
||||
def arg_a(self) -> str:
|
||||
# Input has to be given in Montgomery form
|
||||
mont_a = self.to_montgomery(self.int_a)
|
||||
return self.format_arg('{:x}'.format(mont_a))
|
||||
mongtomgery_form_a = True
|
||||
disallow_zero_a = True
|
||||
|
||||
def result(self) -> List[str]:
|
||||
result = bignum_common.invmod(self.int_a, self.int_n)
|
||||
if result < 0:
|
||||
result += self.int_n
|
||||
result = bignum_common.invmod_positive(self.int_a, self.int_n)
|
||||
mont_result = self.to_montgomery(result)
|
||||
return [self.format_result(mont_result)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue