3 # This file takes as input, the files that have been output from
5 # It prints a table of the relative differences with %100 being 'no difference'
8 ($#ARGV == 1) || die "$0 speedout1 speedout2\n";
10 %one=&loadfile
($ARGV[0]);
11 %two=&loadfile
($ARGV[1]);
14 foreach $a ("md2","md4","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
15 "idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
17 if (defined($one{$a,8}) && defined($two{$a,8}))
19 print "type 8 byte% 64 byte% 256 byte% 1024 byte% 8192 byte%\n"
23 foreach $b (8,64,256,1024,8192)
25 $r=$two{$a,$b}/$one{$a,$b}*100;
33 "rsa 512","rsa 1024","rsa 2048","rsa 4096",
34 "dsa 512","dsa 1024","dsa 2048",
37 if (defined($one{$a,1}) && defined($two{$a,1}))
39 $r1=($one{$a,1}/$two{$a,1})*100;
40 $r2=($one{$a,2}/$two{$a,2})*100;
41 printf "$a bits %% %6.2f %% %6.2f\n",$r1,$r2;
50 open(IN
,"<$file") || die "unable to open '$file' for input\n";
54 $header=0 if /^[dr]sa/;
55 if (/^type/) { $header=0; next; }
59 if ($a[0] =~ /^[dr]sa$/)
61 ($n,$t1,$t2)=($_ =~ /^([dr]sa\s+\d+)\s+bits\s+([.\d]+)s\s+([.\d]+)/);
67 $n=join(' ',grep(/[^k]$/,@a));