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

sha256: Use standard types uint8_t / uint32_t so types doesn't have to be adjusted manually

Open danmar opened this issue 6 years ago • 1 comments

This makes the code more portable. you can use the same code both on a pc and on a embedded system.

if you do not like to use uint8_t and uint32_t for some reason then I would suggest that we use preprocessor to select proper types. Something like:

#if sizeof(int) == 4
typedef unsigned int WORD;
elif sizeof(long) == 4
typedef unsigned long WORD;
#else
#error WORD type not configured properly
#endif

danmar avatar May 17 '18 09:05 danmar