cbc3676188a9150e28206b9352ef0df9747f9966
[crypto_lab3.git] / src / Rsa.h
1 #ifndef RSA_H
2 #define RSA_H
3
4 #include <utility>
5 #include <gmpxx.h>
6
7 class Rsa
8 {
9 public:
10 struct KeyPub {
11 mpz_class n;
12 mpz_class e;
13 };
14
15 struct KeyPriv {
16 mpz_class n;
17 mpz_class d;
18 };
19
20 static std::pair<KeyPub, KeyPriv> generateRSAKeys(uint exponent, uint keySizeBits);
21
22 static mpz_class sign(const mpz_class& m, const KeyPriv& kPriv);
23
24 static bool verifySignature(const mpz_class& m, const mpz_class& sig, const KeyPub& kPub);
25 };
26
27 #endif