From 3d2aab891b6f185b08485d362cb1217ad0b5b036 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Wed, 21 Dec 2022 17:30:10 +0000 Subject: [PATCH] bignum_common: Adjusted `format_arg` to always size input according to modulo. Signed-off-by: Minos Galanakis --- scripts/mbedtls_dev/bignum_common.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/mbedtls_dev/bignum_common.py b/scripts/mbedtls_dev/bignum_common.py index 7b2669af7..bb64ce079 100644 --- a/scripts/mbedtls_dev/bignum_common.py +++ b/scripts/mbedtls_dev/bignum_common.py @@ -297,10 +297,7 @@ class ModOperationCommon(OperationCommon): 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) + return super().format_arg(val).zfill(self.hex_digits) def arguments(self) -> List[str]: return [quote_str(self.arg_n)] + super().arguments()