updated lab5 and 6
This commit is contained in:
parent
fefb795f80
commit
5eeb46c4b4
1 changed files with 0 additions and 1 deletions
|
@ -13,7 +13,6 @@ def elgamal_keygen(bits: int = 512) -> Tuple[Tuple[int, int, int], int]:
|
||||||
h = pow(g, x, p)
|
h = pow(g, x, p)
|
||||||
return (p, g, h), x
|
return (p, g, h), x
|
||||||
|
|
||||||
|
|
||||||
def elgamal_encrypt(message: bytes, pub_key: Tuple[int, int, int]) -> Tuple[int, int]:
|
def elgamal_encrypt(message: bytes, pub_key: Tuple[int, int, int]) -> Tuple[int, int]:
|
||||||
p, g, h = pub_key
|
p, g, h = pub_key
|
||||||
m = int.from_bytes(message, "big")
|
m = int.from_bytes(message, "big")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue