Remove useless data from the CRT private key.
[crypto_lab3.git] / src / RsaCrt.h
index 29bc4b9..373d583 100644 (file)
@@ -1,20 +1,29 @@
 #ifndef RSACRT_H
 #define RSACRT_H
 
+#include <utility>
+
 #include <gmpxx.h>
 
+#include "Rsa.h"
+
 class RsaCrt
 {
 public:
-   RsaCrt();
-
-   struct KeyPrivCRT {
+   struct KeyPriv {
       mpz_class p;
       mpz_class q;
       mpz_class dp;
       mpz_class dq;
       mpz_class qInv;
    };
+
+   static std::pair<Rsa::KeyPub, KeyPriv> generateRSAKeys(uint exponent, uint keySizeBits);
+
+   /**
+    * m must not be greater or equal than kPriv.n.
+    */
+   static mpz_class sign(const mpz_class& m, const KeyPriv& kPriv);
 };
 
 #endif