-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of htobe64 and other non-standard functions #63
Comments
The intention was that platform-specific or compiler-specific alternatives would be provided via #ifdef's in EndianUtil.h, as it is hard to do endian conversions efficiently in standard C in a manner that is safe against side-effects. The byteswap instrinsics in Visual C might do what you want: If you can get it to work, then submit a merge request and I'll add it to the library. |
Thanks for the reply.
can be easily transformed into portable inline function like:
I believe, the generated byte-code may also be efficient enough. |
there seems to be huge difference in the way the code is compiler, the version with extension looks like more than double long, see https://godbolt.org/z/jfzK9G |
The macros like
htobe64
(it is used inSHA512::finalize
) are written in compiler-specific way (gcc-only?), so they make it hard to build the library with other compilers.It would be nice to rewrite them in a standard way to make the library easily portable to other platforms.
PS: I was trying to build the library with Microsoft C++ compiler (VS2017)
The text was updated successfully, but these errors were encountered: