updated lab5 and 6

This commit is contained in:
Student 2025-09-09 09:35:02 +05:30
parent fefb795f80
commit 5eeb46c4b4

View file

@ -13,7 +13,6 @@ def elgamal_keygen(bits: int = 512) -> Tuple[Tuple[int, int, int], int]:
h = pow(g, x, p)
return (p, g, h), x
def elgamal_encrypt(message: bytes, pub_key: Tuple[int, int, int]) -> Tuple[int, int]:
p, g, h = pub_key
m = int.from_bytes(message, "big")