Daniel Kahn Gillmor dkg@fifthhorseman.net writes:
/* _salsa20_core does any needed byteswapping of the output. A memcpy is needed to support unaligned dst; simply casting like _salsa20_core ((uint32_t *) dst, src32, rounds) is not portable. */ memcpy (dst, dst32, sizeof (dst32));
Thanks, that's now tested and "make check" passes on both powerpc and i386.
Thanks for testing. I was about to update this patch too, but then it occured to me that this interface:
+void +salsa20_core (uint8_t *dst,
const uint8_t *src,
unsigned rounds)
is not ideal -- the reason is that the Salsa20 core is not defined with a parametrised number of rounds, so the interface is somewhat of a bastardisation.
In my work space, I have used the namespace 'salsa20r_core' instead. This opens up for later addition of a true 'salsa20_core' function which would use the official 20 rounds.
What do you think?
The patch below is update to apply against latest master.
/Simon