Mod operations: fill arguments to the width of the modulus
With the default input style (which is "variable"), fill all bignum test case arguments to the same width as the modulus. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
f8a4463bd6
commit
5623ecc2d6
1 changed files with 6 additions and 0 deletions
|
@ -267,6 +267,12 @@ class ModOperationCommon(OperationCommon):
|
|||
def arg_n(self) -> str:
|
||||
return self.format_arg(self.val_n)
|
||||
|
||||
def format_arg(self, val: str) -> str:
|
||||
if self.input_style == "variable":
|
||||
return val.zfill(len(hex(self.int_n)) - 2)
|
||||
else:
|
||||
return super().format_arg(val)
|
||||
|
||||
def arguments(self) -> List[str]:
|
||||
return [quote_str(self.arg_n)] + super().arguments()
|
||||
|
||||
|
|
Loading…
Reference in a new issue