projects
/
crypto_lab3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add measures and tests.
[crypto_lab3.git]
/
src
/
RsaCrt.cpp
diff --git
a/src/RsaCrt.cpp
b/src/RsaCrt.cpp
index
9e2c3c9
..
19bc4d7
100644
(file)
--- a/
src/RsaCrt.cpp
+++ b/
src/RsaCrt.cpp
@@
-20,6
+20,7
@@
pair<Rsa::KeyPub, RsaCrt::KeyPriv> RsaCrt::generateRSAKeys(uint exponent, uint k
kPriv.n = kPub.n = kPriv.p * kPriv.q;
phi = (kPriv.p - 1) * (kPriv.q - 1);
+ // d = e^-1 (mode phi).
} while (mpz_invert(kPriv.d.get_mpz_t(), kPub.e.get_mpz_t(), phi.get_mpz_t()) == 0);
kPriv.dp = kPriv.d % (kPriv.p - 1);