X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=src%2FRsaCrt.h;h=b680e3101c205998149923c3acf3f4900d712dd3;hb=2745bc6570ac32789650336b8c84a52d1883c62a;hp=87f9a11856c58fe48d6d35b5faf871574e2166f4;hpb=91989c2627abc2cdf511f17169e4f862dc55e838;p=crypto_lab3.git diff --git a/src/RsaCrt.h b/src/RsaCrt.h index 87f9a11..b680e31 100644 --- a/src/RsaCrt.h +++ b/src/RsaCrt.h @@ -11,20 +11,24 @@ class RsaCrt { public: struct KeyPriv { - mpz_class n; // Modulus. - uint e; // Exponent. - mpz_class p; mpz_class q; mpz_class dp; mpz_class dq; mpz_class qInv; - mpz_class d; }; + /** + * Generate a pair of keys (public, private). + */ 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); + + static mpz_class signWithFaultySp(const mpz_class& m, const KeyPriv& kPriv); }; #endif