From 4c191065f8e456038f2241be4f063165bb27802b Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 27 Sep 2023 19:45:34 -0700 Subject: [PATCH] format code --- src/openpower/test/bigint/powmod.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/openpower/test/bigint/powmod.py b/src/openpower/test/bigint/powmod.py index 8eafa059..057f4520 100644 --- a/src/openpower/test/bigint/powmod.py +++ b/src/openpower/test/bigint/powmod.py @@ -4,7 +4,7 @@ # Funded by NLnet Assure Programme 2021-02-052, https://nlnet.nl/assure part # of Horizon 2020 EU Programme 957073. -# +# # * https://bugs.libre-soc.org/show_bug.cgi?id=1044 """ modular exponentiation (`pow(x, y, z)`) @@ -47,14 +47,18 @@ MUL_256_X_256_TO_512_ASM = ( # TODO: these really need to go into a common util file, see # openpower/decoder/isa/poly1305-donna.py:def _DSRD(lo, hi, sh) # okok they are modulo 100 but you get the general idea + + def maddedu(a, b, c): y = a * b + c return y % 100, y // 100 + def adde(a, b, c): y = a + b + c return y % 100, y // 100 + def addc(a, b): y = a + b return y % 100, y // 100 @@ -263,13 +267,13 @@ if __name__ == "__main__": # now test python_mul_algorithm2 *against* python_mul_algorithm import random - random.seed(0) # reproducible values + random.seed(0) # reproducible values for i in range(10000): a = [] b = [] for j in range(4): - a.append(random.randint(0,99)) - b.append(random.randint(0,99)) + a.append(random.randint(0, 99)) + b.append(random.randint(0, 99)) expected = python_mul_algorithm(a, b) testing = python_mul_algorithm2(a, b) report = "%+17s * %-17s = %s\n" % (repr(a), repr(b), repr(expected)) -- 2.30.2