aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 0481f6c..60198f7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -143,9 +143,9 @@ void performrsa(){
cout<<"d = "<<privkey.pexp<<endl;
Bigint msg(123456789);
cout<<"msg = "<<msg<<endl;
- Bigint encr=RSA::encrypt(privkey.pub,msg);
+ Bigint encr=RSA::encrypt(msg,privkey.pub);
cout<<"encr = "<<encr<<endl;
- Bigint msg2=RSA::decrypt(privkey,encr);
+ Bigint msg2=RSA::decrypt(encr,privkey);
cout<<"msg = "<<msg2<<endl;
}