Project

General

Profile

Actions

SHA-1 prototype (oldHaskell) » History » Revision 2

« Previous | Revision 2/6 (diff) | Next »
Greg Burri, 03/25/2009 11:46 AM


SHA-1 prototype

Goals

  • Compute the SHA-1 of each part of a given file.
  • Compute the SHA-1 for a given part of a given file.
  • Compute the SHA-1 of a stream.

Speed measures

file : 01.wmv : 17'639'245 byte ~ 17Mo

sha1sum from GNU coreutils (Reference)

speed : 173 MB/s

<gburri@overnux:~/code/lang/haskell/SHA1$> time sha1sum < 01.wmv
3aec84601612e8c604ac01971e0ecd9d536dbead  -

real    0m0.098s
user    0m0.092s
sys     0m0.004s

SHA 1.2.0

file : Hash.hs
speed : 18 times slower (13 MB/s)

<gburri@overnux:~/code/lang/haskell/SHA1$> ghc --make -O2 Hash.hs -o hash && time ./hash 01.wmv
[0 - 3aec84601612e8c604ac01971e0ecd9d536dbead]

real    0m1.244s
user    0m1.212s
sys     0m0.036s$

Crypto 4.2.0

file : Hash2.hs
speed : 267 times slower (1 MB/s) :

<gburri@overnux:~/code/lang/haskell/SHA1$> ghc --make -O2 Hash2.hs -o hash2 && time ./hash2 01.wmv
[0 - Word160 988578912 370337990 78381463 504286621 1399701165]

real    0m17.078s
user    0m16.921s
sys     0m0.072s

Binding with sha1.h from coreutils

file : Hash3.hs

TODO...

Updated by Greg Burri about 15 years ago · 2 revisions