87f9a11856c58fe48d6d35b5faf871574e2166f4
[crypto_lab3.git] / src / RsaCrt.h
1 #ifndef RSACRT_H
2 #define RSACRT_H
3
4 #include <utility>
5
6 #include <gmpxx.h>
7
8 #include "Rsa.h"
9
10 class RsaCrt
11 {
12 public:
13 struct KeyPriv {
14 mpz_class n; // Modulus.
15 uint e; // Exponent.
16
17 mpz_class p;
18 mpz_class q;
19 mpz_class dp;
20 mpz_class dq;
21 mpz_class qInv;
22 mpz_class d;
23 };
24
25 static std::pair<Rsa::KeyPub, KeyPriv> generateRSAKeys(uint exponent, uint keySizeBits);
26
27 static mpz_class sign(const mpz_class& m, const KeyPriv& kPriv);
28 };
29
30 #endif