GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added testing mechanism to RSA.pl
[mirrors/Programs.git]
/
perl
/
rsa.pl
diff --git
a/perl/rsa.pl
b/perl/rsa.pl
index c442c6eae2e659fea8f4cd480139546bdc18f9f8..522be22e1a79895d44acff37f5e8074e08e316a7 100755
(executable)
--- a/
perl/rsa.pl
+++ b/
perl/rsa.pl
@@
-44,4
+44,6
@@
my $msg=1337;
my $enc=rsa($msg,$n,$e); #encrypt
print "ENC: $enc\n";
my $dec=rsa($enc,$n,$d); #decrypt
my $enc=rsa($msg,$n,$e); #encrypt
print "ENC: $enc\n";
my $dec=rsa($enc,$n,$d); #decrypt
- print "DEC: $dec\nTST: ".$msg.($msg==$dec?"=":"!=").$dec."\n";
+ $test=($msg==$dec);
+ print "DEC: $dec\nTST: ".$msg.($test?"=":"!=").$dec."\n";
+ exit !$test;
This page took
0.818423 seconds
and
4
git commands to generate.