aboutsummaryrefslogtreecommitdiff
path: root/rsa.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-10-08 11:56:47 +0200
committertomsmeding <tom.smeding@gmail.com>2016-10-08 11:56:47 +0200
commitf49e2058ad2c6d7eedded27fa41bd30405db5aaa (patch)
tree30dc9842617c58ffc9313c8a9c1b254fdc1e8176 /rsa.cpp
parent2fe3a5f06bf4423fbb881238b30f6f592b5c0127 (diff)
Make parameter order a bit more consistent
Diffstat (limited to 'rsa.cpp')
-rw-r--r--rsa.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/rsa.cpp b/rsa.cpp
index b6ad5ed..cfa1fee 100644
--- a/rsa.cpp
+++ b/rsa.cpp
@@ -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);
}