SHA2 Module

Q&A's, tips, howto's
Locked
kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

SHA2 Module

Post by kanen »

Has anyone written an SHA2 module or function that doesn't rely on libcrypto?

I have an MD5 hash function that works, but I'm worried about collisions.

Anyone?
. Kanen Flowers http://kanen.me .

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: SHA2 Module

Post by Lutz »

You could do a smaller library using those two files:

http://www.opensource.apple.com/source/ ... sha2.c?txt
http://www.opensource.apple.com/source/ ... Priv.h?txt

gcc sha2.c -shared -o sha2.dylib

compiles without a problem on OSX to a sha2.dylib of about 29K

kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

Re: SHA2 Module

Post by kanen »

I'm trying to do this in newLisp, so I don't ever have to rely on a an external library.
Lutz wrote:You could do a smaller library using those two files:

http://www.opensource.apple.com/source/ ... sha2.c?txt
http://www.opensource.apple.com/source/ ... Priv.h?txt

gcc sha2.c -shared -o sha2.dylib

compiles without a problem on OSX to a sha2.dylib of about 29K
. Kanen Flowers http://kanen.me .

kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

Re: SHA2 Module

Post by kanen »

I'm basically thinking of porting this link http://www.movable-type.co.uk/scripts/sha256.html to newLisp.

Unfortunately, I'm waist-deep in Android right now...
. Kanen Flowers http://kanen.me .

hilti
Posts: 140
Joined: Sun Apr 19, 2009 10:09 pm
Location: Hannover, Germany
Contact:

Re: SHA2 Module

Post by hilti »

Good idea doing a native newLISP SHA2.

Here's another version written in Common Lisp. Maybe it's another starting point.
http://common-lisp.net/project/clbuild/ ... ha256.lisp
--()o Dragonfly web framework for newLISP
http://dragonfly.apptruck.de

Locked