forked from sangge/tpre-python
Merge branch 'main' of https://git.mamahaha.work/sangge/mimajingsai
This commit is contained in:
commit
0782fb2145
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,3 +3,6 @@ jiangchao
|
|||||||
__pycache__
|
__pycache__
|
||||||
|
|
||||||
test.py
|
test.py
|
||||||
|
example.py
|
||||||
|
|
||||||
|
ReEncrypt.py
|
||||||
|
@ -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
|
||||||
@ -197,6 +198,7 @@ def GenerateKeyPair(
|
|||||||
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")
|
||||||
|
|
||||||
return public_key, secret_key
|
return public_key, secret_key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user