GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbca6c3
)
Added testing mechanism to RSA.pl
author
Harvie
<tomas@mudrunka.cz>
Thu, 4 Nov 2010 22:34:55 +0000
(23:34 +0100)
committer
Harvie
<tomas@mudrunka.cz>
Thu, 4 Nov 2010 22:34:55 +0000
(23:34 +0100)
perl/rsa.pl
patch
|
blob
|
blame
|
history
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
- 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.135883 seconds
and
4
git commands to generate.