Skip to content
Snippets Groups Projects
Commit 82d6dd45 authored by Arian Ubuntu's avatar Arian Ubuntu
Browse files

Correction inverse

parent cf3eecfd
Branches
No related tags found
No related merge requests found
......@@ -78,11 +78,8 @@ def sign(m: int, k: int, privkey: Privkey) -> Signature:
a = privkey.a
Y = pow(g, k, p)
inverse = xgcd(k, p)[1] % (p - 1)
inverse = xgcd(k, p-1)[1] % (p - 1)
S = ((m - a * Y) * inverse) % (p - 1)
print(
f"Y = {Y}, S = {S}, p = {p}, g = {g} a = {a}, k = {k}, m = {m}, A = {pow(g,a,p)}"
)
return Signature(Y, S)
......
3621 5011
2353 2497
Il faut pas respirer la compote, ça fait tousser.
\ No newline at end of file
7297 14 7057
\ No newline at end of file
6317 5416 5989
\ No newline at end of file
7297 14 1356
\ No newline at end of file
6317 5416 5265
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment