X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=src%2FRsaCrt.h;h=2341939de47445c6e015290ad13b13ced9cb7c01;hb=fb173a9728e915fc7b3f99bc41f55034757105df;hp=29bc4b91d34a6e2b183700f429d3aa80d4a672ca;hpb=7975d02c6c1ee679a236087e86955c086f1a9a8e;p=crypto_lab3.git diff --git a/src/RsaCrt.h b/src/RsaCrt.h index 29bc4b9..2341939 100644 --- a/src/RsaCrt.h +++ b/src/RsaCrt.h @@ -1,20 +1,33 @@ #ifndef RSACRT_H #define RSACRT_H +#include + #include +#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 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