SHA256 icon indicating copy to clipboard operation
SHA256 copied to clipboard

How's it going?

Open rleddy opened this issue 3 years ago • 2 comments

Some good implementations are out there. This one looks pretty clean.

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.

Here is something that I am looking for. (Will put the same note there - likely.)

https://github.com/noloader/SHA-Intrinsics

Not sure if that is 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 avatar Jul 30 '21 22:07 rleddy

https://wiki.openssl.org/index.php/Cryptogams_SHA

noloader pointed me to that. But, it is not so easy to build. I have been wasting much time today trying to just get the latest openssl to build into anything. So, I gave your package a try.

As I am on a Mac using clang, I did not succeed with your makefile. However, I put it into my directory that I have for CODINGS (as I am calling it at the moment) and ran your test program. Very nice.

You might take a look at CODING: https://github.com/copious-world/CODINGS. Just threw these together. But, I am preferring base64 at the moment. Was checking out base58 - suffers from bitcoin popularity. So, your toString could be have some options.

So, for just getting started on my little toying with a Merkle tree, your code got me there. Now, for somehow extracting the intrinsics out of cryptogams ... also not very documented. I believe that gnu is needed instead of clang just for some command options. But, I have several boxes. Convenience is problematic always - anytime that I have ssh into something - it's actually less convenient even with little shell scripts and the like - there is always some little extra step here or there - some lack of documentation here or there.

Now, crypto++ is a great option, but it has a grandiose package size like many things. So, I did not use that.

rleddy avatar Aug 01 '21 01:08 rleddy

Hello and sorry for the extremely late response. This implementation has not been audited and battle tested, so you shouldn't use it for applications that need real security. Also I don't maintain it because this project was for research purposes and learning how hashing works.

I forgot how overkill I made this makefile and wonder why I did that in the first place. Sorry for the inconvenience. You should be able to build that easily with a single command since there are no dependencies.

System-Glitch avatar Sep 09 '21 09:09 System-Glitch