In article <Xns9A1823D9220Dtoelavabitcom@194.125.133.14>, Tomás Ó
hÉilidhe <> writes
>
>(SHA-1 is a cryptographic hash function. For info on what SHA-1 is:
>http://en.wikipedia.org/wiki/SHA-1)
>
>I'm writing fullportable C89 code that needs to make use of the SHA-1
>algorithm. Does anyone know if there's been a fully-portable C89
>implementation of the SHA-1 algorithm?
You will probably want an ISO C95 version. C89 was superseded by ISO
C90 and some amendments in 93-95. You will find more compilers support
c95 than anything else.
>If not, could someone please point me to a very good implementation of
>the algorithm, an implementation which is very portable (perhaps
>portable to machines with 8-Bit bytes and which have exact 16-Bit,
>32-Bit and 64-Bit integer types)?
You don't want much do you... I am sure some one can sell you what you
need.
>I've done a few Google searches but I'm getting back a lot of
>sub-standard platform-specific code.
I think for a lot of crypto work you are going to find most of the
implementations are architecture or compiler specific. People usually
need the crypto code to be fast and compact. Generic code will be
neither.
Also in many cases for security the writer will want it less accessible
to hackers. We used various hardware resources to make things less
obvious and more secure. Whist security by concealment is not
recommended as a prime defence it does help when layered on top of other
things.
BTW for a repository of cypher sources see
http://www.phaedsys.demon.co.uk/chris/index.htm
And click on ciphers. There is an SHA1, SHA2 and SHA3 implementation
Apologies for the state of the web site but it needs an overhaul.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/
www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/