News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

fast hashing algos

Started by brethren, July 29, 2011, 01:54:26 PM

Previous topic - Next topic

brethren

the app i'm coding uses the sha-1 hashing function. Currently i'm using a version of sha-1 written in C and linking it in with my app.:)

what do you guys use when you need a fast sha-1 implementation? Has anyone written a highly optimized asm version?

thanks
nick

Twister

ASM + GPU. That's as optimized as it can get.

hutch--

brethren,

Funny enough the Crypto API SHA1 is not slow. If you have not played with it, have a look and see if its fast enough. MichaelW did a prototype that I translated to another language and it was very good when chomping through very large files > 2 gig. Seemed to work best with a much smaller buffer size than I expected, from about 16k to about 64k from memory.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

brethren

thanks for the replies, guys. i'm gonna do some timing tests with my current code against the crypto api. as for using the gpu i've had no experience in this area but i'm gonna look into it as i've just found a version written using openCL :wink

still, if anyone has an optimized asm version that'd be great:D

Glenn9999

Quote from: brethren on July 29, 2011, 11:04:26 PM
thanks for the replies, guys. i'm gonna do some timing tests with my current code against the crypto api. as for using the gpu i've had no experience in this area but i'm gonna look into it as i've just found a version written using openCL :wink

still, if anyone has an optimized asm version that'd be great:D

The cryptoAPI is very good for a number of things, and probably will be sufficient unless you really want to experiment.  That said, here's what I came up with when I was doing hashes as a learning project.  All the x86 asm code for SHA-1 that profiled out to be needed for optimization in my Delphi main program.  The rest in the Delphi source is just file I/O and routine things.

http://www.masm32.com/board/index.php?topic=15788.msg130634#msg130634

Can post the Delphi source part as well if desired, though if you have a C implementation you should know where these parts fit.  Good luck.

brethren

thanks for posting, glenn :U i'm gonna have a good look at your code