Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - potuz

Pages: [1]
Found the answer, bitcoin's implementation hashes twice the input instead of just once.


Hi, I'm trying to use the vectorized sha256 implementation in the several src/crypto/sha256_*.cpp files on my project. Admittedly I haven't really spent much time digging the code, but a first try of simply calling `SHA256D64` with a null block of 64 bytes of zero, gives me the hash `{0xe2, 0xf6, 0x1c, 0x3f, 0x71, 0xd1, 0xde, 0xfd, 0x3f, 0xa9, 0x99, 0xdf, 0xa3, 0x69, 0x53, 0x75,
    0x5c, 0x69, 0x6, 0x89, 0x79, 0x99, 0x62, 0xb4, 0x8b, 0xeb, 0xd8, 0x36, 0x97, 0x4e, 0x8c, 0xf9}` which does not agree with the one openssl gives `f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b`. This does not seem to be an endianess issue. I figured it would be faster to ask here if there is something I should be aware of these implementations.

EDIT: even the test vectors in `src/test/crytpo_tests.cpp`  do not seem to agree with their openssl counterpart. Is the format different?


Pages: [1]