This commit is contained in:
sangge 2023-10-14 13:08:18 +08:00
commit 0782fb2145
2 changed files with 5 additions and 0 deletions

3
.gitignore vendored
View File

@ -3,3 +3,6 @@ jiangchao
__pycache__ __pycache__
test.py test.py
example.py
ReEncrypt.py

View File

@ -125,6 +125,7 @@ def Setup(sec: int) -> Tuple[CurveFp, Tuple[int, int],
sec: an init safety param sec: an init safety param
return: return:
<<<<<<< HEAD
G: sm2 curve G: sm2 curve
g: generator g: generator
U: another generator U: another generator
@ -196,6 +197,7 @@ def GenerateKeyPair(
public_key_x = int.from_bytes(bytes(sm2.public_key.x),"big") public_key_x = int.from_bytes(bytes(sm2.public_key.x),"big")
public_key_y = int.from_bytes(bytes(sm2.public_key.y),"big") public_key_y = int.from_bytes(bytes(sm2.public_key.y),"big")
public_key = (public_key_x, public_key_y) public_key = (public_key_x, public_key_y)
secret_key = int.from_bytes(bytes(sm2.private_key),"big") secret_key = int.from_bytes(bytes(sm2.private_key),"big")