crypto-algorithms icon indicating copy to clipboard operation
crypto-algorithms copied to clipboard

Typedefs on Windows

Open looki opened this issue 7 years ago • 1 comments

The BYTE and WORD typedefs defined in sha1.h are suboptimal for use in Windows code - Windows resolves WORD to unsigned shorts, which is incompatible with the 32-bit integer that you use (Also, even the identical BYTE typedef will redefine and cause an error). Took me a moment to figure out why the hashes were mostly zero! I suggest using prefixed typedefs or simply stdint.h.

looki avatar Feb 17 '17 04:02 looki

I would also vote for using stdint.h types over WORD. I'm having to copy and fix up the code locally.

petmac avatar Feb 20 '18 11:02 petmac