First part: RSA CRT versus RSA std.
[crypto_lab3.git] / src / RsaCrt.h
index 29bc4b9..87f9a11 100644 (file)
@@ -1,20 +1,30 @@
 #ifndef RSACRT_H
 #define RSACRT_H
 
+#include <utility>
+
 #include <gmpxx.h>
 
+#include "Rsa.h"
+
 class RsaCrt
 {
 public:
-   RsaCrt();
+   struct KeyPriv {
+      mpz_class n; // Modulus.
+      uint e; // Exponent.
 
-   struct KeyPrivCRT {
       mpz_class p;
       mpz_class q;
       mpz_class dp;
       mpz_class dq;
       mpz_class qInv;
+      mpz_class d;
    };
+
+   static std::pair<Rsa::KeyPub, KeyPriv> generateRSAKeys(uint exponent, uint keySizeBits);
+
+   static mpz_class sign(const mpz_class& m, const KeyPriv& kPriv);
 };
 
 #endif