From 99453ad9f03c8cbbcd4b12f1818b104eec81814b Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Tue, 16 May 2023 15:26:06 +0100 Subject: [PATCH] bignum_core.py: Simplified result calculation for `BignumCoreShiftL` Signed-off-by: Minos Galanakis --- scripts/mbedtls_dev/bignum_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mbedtls_dev/bignum_core.py b/scripts/mbedtls_dev/bignum_core.py index 2abf77ac8a..ff3fd23e68 100644 --- a/scripts/mbedtls_dev/bignum_core.py +++ b/scripts/mbedtls_dev/bignum_core.py @@ -122,7 +122,7 @@ class BignumCoreShiftL(BignumCoreTarget, bignum_common.ModOperationCommon): # Calculate if there is space for shifting to the left(leading zero limbs) mx = bignum_common.hex_digits_max_int(self.val_n, self.bits_in_limb) # If there are empty limbs ahead, adjust the bitmask accordingly - result = result & (self.r - 1) if mx == self.r else result & (mx - 1) + result = result & (mx - 1) return [self.format_result(result)] @property