diff options
Diffstat (limited to 'rsa.cpp')
-rw-r--r-- | rsa.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -10,12 +10,14 @@ using namespace std; namespace RSA{ - Bigint encrypt(const PublicKey &pubkey,Bigint msg){ + Bigint encrypt(Bigint msg,const PublicKey &pubkey){ + // cerr<<"msg="<<msg<<endl; + // cerr<<"mod="<<pubkey.mod<<endl; assert(msg>1&&msg<pubkey.mod); return expmod(msg,pubkey.exp,pubkey.mod); } - Bigint decrypt(const PrivateKey &privkey,Bigint encr){ + Bigint decrypt(Bigint encr,const PrivateKey &privkey){ return expmod(encr,privkey.pexp,privkey.pub.mod); } |