add a quick usage demo to poly1305.py, to serve later as a check
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 17 Sep 2023 12:20:57 +0000 (13:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 17 Sep 2023 12:20:57 +0000 (13:20 +0100)
src/openpower/decoder/isa/poly1305.py

index 83411597ee9c4c7f96b90244cdec05b4a4e9c4dc..93f37afd90c6802bbf3bf165047a6ccfe05478ec 100644 (file)
@@ -46,3 +46,9 @@ class Poly1305(object):
         self.acc += self.s
         return self.num_to_16_le_bytes(self.acc)
 
+
+# quick usage demo
+if __name__ == '__main__':
+    key = list(range(223, 255))
+    mac = Poly1305(key).create_tag(bytearray(range(0,32)))
+    print (mac)