bignum_mod_raw: Simplified BignumModRawCanonicalToFromModulusRep output expressions.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
Minos Galanakis 2022-12-21 17:31:56 +00:00
parent 3d2aab891b
commit 5689410083

View file

@ -156,8 +156,7 @@ class BignumModRawCanonicalToModulusRep(BignumModRawConvertRep):
test_name = "Rep canon->mod"
def result(self) -> List[str]:
result = self.convert_from_canonical(self.int_a, self.rep)
return [self.format_result(result)]
return [self.format_result(self.convert_from_canonical(self.int_a, self.rep))]
class BignumModRawModulusToCanonicalRep(BignumModRawConvertRep):
"""Test cases for mpi_mod_raw_modulus_to_canonical_rep."""
@ -166,8 +165,7 @@ class BignumModRawModulusToCanonicalRep(BignumModRawConvertRep):
@property
def arg_a(self) -> str:
converted_a = self.convert_from_canonical(self.int_a, self.rep)
return self.format_arg(hex(converted_a)[2:])
return self.format_arg("{:x}".format(self.convert_from_canonical(self.int_a, self.rep)))
def result(self) -> List[str]:
return [self.format_result(self.int_a)]