diff options
author | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 10:56:39 +0000 |
---|---|---|
committer | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 10:56:39 +0000 |
commit | 58964a492275ca9a59a0cd9c8155cb2491b4b909 (patch) | |
tree | c7b16876a5789463bbbb468ef4829c8129b3d718 /perl/z.pl | |
parent | d02b48c63a58ea4367a0e905979f140b7d090f86 (diff) | |
download | openssl-58964a492275ca9a59a0cd9c8155cb2491b4b909.tar.gz |
Import of old SSLeay release: SSLeay 0.9.0b
Diffstat (limited to 'perl/z.pl')
-rw-r--r-- | perl/z.pl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/perl/z.pl b/perl/z.pl new file mode 100644 index 0000000000..8bba1bdbd2 --- /dev/null +++ b/perl/z.pl @@ -0,0 +1,32 @@ +#!/usr/local/bin/perl + +use ExtUtils::testlib; + +use SSLeay; +use Benchmark; + +$buf=('x' x (1024*1024)); +$buf=('x' x (1024*1024)); + +@md=(); +foreach $name ("md2", "mdc2", "sha", "ripemd160", "sha1", "md5") + { + if (($name eq "md2") || ($name eq "mdc2")) + { $num=5; } + else { $num=100; } + + $t=timeit($num,'&hash($name)'); + printf "%6d000 bytes/sec:$name\n",int(($num*1024*1024)/$t->[1]/1000); + } + +sub hash + { + my($name)=@_; + my($f,$digest); + + ($f=MD->new($name)) || + die "$_ is an unknown message digest algorithm\n"; + $f->update($buf); + $digest=$f->final(); + } + |