views:

1068

answers:

6

What's a high performance hashing library that's also cross platform for C/C++. For algorithms such as MD5, SHA1, CRC32 and Adler32.

I initially had the impression that Boost had these, but apparently not (yet).

The most promising one I have found so far is Crypto++, any other suggestions? http://www.cryptopp.com/ This seems to be quite comprehensive.

A: 

QT seem to implement MD4, MD5 and SHA1

shoosh
Why include a whole Widget-library just to use its MD5 and SHA-1 implementations? *If* you're already using QT this could be a feasibel option otherwise it's overkill.
Andreas Magnusson
+1  A: 

zlib has a built-in implementation of a crc32 variant, and is widely ported. =)

leander
+2  A: 

I'd definitely go with CryptoPP, it has a nice license to go with it as well.

Andreas Magnusson
Yeah, just nick the code you need and you'll be set.
Skurmedel
+4  A: 

For usual crypto hashes (MD?, SHA? etc.), openssl is the most portable and probably fastest. None of the hashes you mentioned are good for high performance data structures like hash tables. The recommended hash functions for these data structures these days are: FNV, Jenkins and MurmurHash.

obecalp
interesting. could you post links? (yes I know, I can google those...)
Jason S
Thanks, I will look in to openssl. The use of the hashes won't be for hash tables, but used as hashes for authentication and document verifications (was it tampered etc)
The Unknown
+1  A: 

Device cross platform? If it means to you what it means to me that means not linux or perhaps operating system independent. I would and did avoid such things as openssl. I went with libtomcrypt. Now as far as speed goes? Well fast, portable, C, chose any two.

dwelch
That libtomcrypt locks interesting.
Johan
A: 

Maybe you can use libbeecrypt?

Johan