Add measures and tests.
[crypto_lab3.git] / src / RsaStd.h
1 #ifndef RSASTD_H
2 #define RSASTD_H
3
4 #include <utility>
5 #include <gmpxx.h>
6
7 #include "Rsa.h"
8
9 class RsaStd
10 {
11 public:
12 struct KeyPriv {
13 mpz_class n;
14 mpz_class d;
15 };
16
17 static std::pair<Rsa::KeyPub, KeyPriv> generateRSAKeys(uint exponent, uint keySizeBits);
18
19 /**
20 * Return m^d (mod n).
21 * m must not be greater or equal than kPriv.n.
22 */
23 static mpz_class sign(const mpz_class& m, const KeyPriv& kPriv);
24 };
25
26 #endif