From f8a4463bd6320c769acf81f4c8853f3f1dcf4d2a Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 20 Dec 2022 19:12:22 +0100 Subject: [PATCH] Add some missing type annotations Signed-off-by: Gilles Peskine --- scripts/mbedtls_dev/bignum_common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mbedtls_dev/bignum_common.py b/scripts/mbedtls_dev/bignum_common.py index 0339b1ad18..9db567b7c4 100644 --- a/scripts/mbedtls_dev/bignum_common.py +++ b/scripts/mbedtls_dev/bignum_common.py @@ -48,7 +48,7 @@ def hex_to_int(val: str) -> int: return 0 return int(val, 16) -def quote_str(val) -> str: +def quote_str(val: str) -> str: return "\"{}\"".format(val) def bound_mpi(val: int, bits_in_limb: int) -> int: @@ -134,7 +134,7 @@ class OperationCommon(test_data_generation.BaseTest): def hex_digits(self) -> int: return 2 * (self.limbs * self.bits_in_limb // 8) - def format_arg(self, val) -> str: + def format_arg(self, val: str) -> str: if self.input_style not in self.input_styles: raise ValueError("Unknown input style!") if self.input_style == "variable": @@ -142,7 +142,7 @@ class OperationCommon(test_data_generation.BaseTest): else: return val.zfill(self.hex_digits) - def format_result(self, res) -> str: + def format_result(self, res: int) -> str: res_str = '{:x}'.format(res) return quote_str(self.format_arg(res_str))