noloader / SHA-Intrinsics

SHA-1, SHA-256 and SHA-512 compression functions using Intel, ARMv8 and Power8 SHA intrinsics
197 stars 40 forks source link

How's it going? #8

Closed rleddy closed 1 year ago

rleddy commented 3 years ago

Some good implementations are out there.

This one looks pretty clean: https://github.com/System-Glitch/SHA256/issues/2

I was just going over Sha256 because I am trying out a Merkle Tree in C++. For that, I decided that to implement it with a list of hashes to take the place of tail duplication on the levels with odd number entries. Seems like a good idea that you could tie the root to a shared (Perhaps in some sort of Byzantine style of sharing) hash list.

But, for all the Sha256 implementations, a lot of them are cumbersome or a little out of date. Or I am missing something about some current issues.

This implementation, here, is something that I am looking for. (Will put the same note there - likely.) Is it fully debugged?

Here is CUDA: https://gist.github.com/allanmac/8745837

How good is that? There is plenty of talk about fixing the bottleneck between the CPU and the GPU. But, those GPUs may be outside of most people's price range. It would be better if the GPU has intrinsics and then we could write a Merkle tree implementation in CUDA.

More work is going on: copiou-world

rleddy commented 3 years ago

Forgot to mention that OpenSSL, which is used by lots of packages, e.g. node.js, Mozilla, Chrome, etc. has Arm implementations, including Neon. But, it does not seem to use Intrinsics. Seems to have not been updated in a few years. Maybe I am looking in the wrong place.

noloader commented 3 years ago

@rleddy,

If you are interested in OpenSSL's asm implementation, then see https://wiki.openssl.org/index.php/Cryptogams_SHA. Cryptogams is Andy Polyakov's high speed library that is used by OpenSSL. The wiki page shows you how to add it to a C project.

There's also a page on AES at https://wiki.openssl.org/index.php/Cryptogams_AES.

rleddy commented 3 years ago

Super cool! Thanks.