That change looks good. Some minor points: > +/* Given an unsigned 16-bit argument X, return the value corresponding > + to rotating the bits N steps to the left. N must be between 1 to > + 15 inclusive. */ > +static inline uint16_t > +rotl16 (uint16_t x, int n)
On all targets of interest for GNU software (including all POSIX-2001 or later targets), N can also be 0 or 16. That is because 'int' must be at least 32 bits on these platforms, and the arguments must widen to at least 32 bits before being shifted. Perhaps this should be noted in the comment? Similarly for rotr16. > return ((x << n) | (x >> (64 - n))) & 0xFFFFFFFFFFFFFFFFULL; I found myself wondering "is that the right number of Fs?". How about the following rewording instead? Similarly for the other functions. return ((x << n) | (x >> (64 - n))) & UINT64_MAX; One other thing: if memory serves, the C standard does not require the existence of uint32_t and uint16_t (this is for portability to 36-bit hosts, I expect); this can easily be worked around by using #ifdef UINT32_MAX and #ifdef UINT16_MAX.