From 8a4247b4c6341a0beb4ca17795ebe0e7f2391772 Mon Sep 17 00:00:00 2001 From: Sadoon Albader Date: Fri, 8 Dec 2023 20:40:16 +0300 Subject: [PATCH] overhauled simulation function, supports svp64 --- crypto/poly1305/poly1305-donna-test.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/crypto/poly1305/poly1305-donna-test.py b/crypto/poly1305/poly1305-donna-test.py index 49743127..498aa7f4 100644 --- a/crypto/poly1305/poly1305-donna-test.py +++ b/crypto/poly1305/poly1305-donna-test.py @@ -31,19 +31,11 @@ from openpower.decoder.selectable_int import SelectableInt from openpower.simulator.program import Program -def simulation(lst,RS,RA,RB): - - initial_regs = [0] * 32 - initial_regs[0] = RS - initial_regs[1] = RA - initial_regs[2] = RB +def simulation_svp(lst,initial_regs): with Program(lst, bigendian=False) as program: sim = run_tst(program, initial_regs) - print(sim.gpr) - print("gpr 0 is : ") - print(hex(sim.gpr[0].value)) - return sim.gpr(0).value + return sim.gpr # this function is extracted from bigint_cases.py (should be in a library) # it is a python implementation of dsrd, see pseudocode in -- 2.30.2