Simon Josefsson simon@josefsson.org writes:
For some reason I had missed that this went in, thanks for commiting this. How about the attached final cleanup patch, to export the Salsa20 core? I think that is consistent with the approach you outlined.
I've had a quick look, and I think it makes sense. But I'm not sure if it gets byteorder right.
+void +salsa20_core (uint8_t *dst,
const uint8_t *src,
unsigned rounds)
+{
[...]
- _salsa20_core (dst32, src32, rounds);
- for (i = 0; i < _SALSA20_INPUT_LENGTH; i++)
- LE_WRITE_UINT32(&dst[i * sizeof (uint32_t)], dst32[i]);
+}
_salsa20_core produces byteswapped output (a somewhat peculiar interface, but it's an internal function, the reason is to be able do do any needed swap with word operations). So I think it should be a plain memcpy above.
Testing on both little-endian and big-endian would be nice (I should try to get xenofarm up and running again, but last time I tried the git support seemed somewhat lacking).
Regards, /Niels