From: Luke Kenneth Casson Leighton Date: Sun, 24 Sep 2023 18:07:15 +0000 (+0100) Subject: minor alteration of reporting hash in mini-test of poly1305-donna.py X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4b8d80e6e9231560aa08a7686b6d27799b3b1aa;p=openpower-isa.git minor alteration of reporting hash in mini-test of poly1305-donna.py --- diff --git a/src/openpower/decoder/isa/poly1305-donna.py b/src/openpower/decoder/isa/poly1305-donna.py index d1472186..c192813e 100644 --- a/src/openpower/decoder/isa/poly1305-donna.py +++ b/src/openpower/decoder/isa/poly1305-donna.py @@ -346,13 +346,16 @@ class Poly1305Donna(object): if __name__ == '__main__': key = list(range(221, 253)) mac = Poly1305Donna(key).create_tag(bytearray(range(121,121+73))) + print("result hash:", end=" ") for byte in mac: print(hex(byte)[2:], sep='', end='') print() - expected = [0xdd,0xb9,0xda,0x7d,0xdd,0x5e,0x52,0x79, - 0x27,0x30,0xed,0x5c,0xda,0x5f,0x90,0xa4] - assert mac == bytearray(expected) # print out the intercepts for intercept in intercepts.values(): print (intercept) + + expected = [0xdd,0xb9,0xda,0x7d,0xdd,0x5e,0x52,0x79, + 0x27,0x30,0xed,0x5c,0xda,0x5f,0x90,0xa4] + assert mac == bytearray(expected) +