Add mult, but it doesn't quite work

This commit is contained in:
Byron Lathi
2025-10-28 08:27:36 -07:00
parent 2fd1136154
commit ad257f4220
7 changed files with 350 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
from typing import List
import random
from modulo_theory import friendly_modular_mult, friendly_modulo
@@ -111,11 +112,19 @@ def test_on_long_string():
print(f"{regular_result:x}")
print(f"{parallel_result:x}")
def test_random():
r = mask_r(random.randint(0, 2**128-1))
s = random.randint(0, 2**128-1)
msg = random.randbytes(random.randint(16, 1500))
parallel_poly1305(msg, r, s, 8)
def main():
test_regular()
test_parallel()
test_on_long_string()
test_random()
if __name__ == "__main__":
main()