You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Luckily, you don't need bswap_16 which appeared in later clang versions, while 32/64-bit swappers were added early and can simply be assumed to be present as long as clang is defined.
Other than that, your SHA/SHA3 sources compile & run just fine if compiled as C++ btw.
Great implementation - small, easy, nice & fast. Thank you very much!
The text was updated successfully, but these errors were encountered:
Confirmed. Sorry for the alarm, didn't notice that part has meanwhile changed, too.
Just one of those "rare bugs" that sometimes go unnoticed. Sorry again.
Hello everyone,
If byte_order.h is run through clang (in my case, clang++), the file concludes that if all else fails, the fallback macro shall be used:
#define bswap_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
Problem: byte_order.c contains code like: bswap_32( *(src++) )
The above will accidently execute "*(src++)" multiple times as "x" in the fallback macro (instead of just once).
Also, to check if 32/64-bit bswap intrinsics can be used, tests like the following:
#elif (defined(GNUC) && (GNUC >= 4) && (GNUC > 4 || GNUC_MINOR >= 3))
should be expanded to simply check for clang as well, like:
#elif defined(clang) || (defined(GNUC) && (GNUC >= 4) && (GNUC > 4 || GNUC_MINOR >= 3))
Luckily, you don't need bswap_16 which appeared in later clang versions, while 32/64-bit swappers were added early and can simply be assumed to be present as long as clang is defined.
Other than that, your SHA/SHA3 sources compile & run just fine if compiled as C++ btw.
Great implementation - small, easy, nice & fast. Thank you very much!
The text was updated successfully, but these errors were encountered: