On 11/27/2012 04:20 PM, Niels Möller wrote:
Now we get to patching patches, which gets a bit messy, but I suspect it will work fine if you replace
for (i = 0; i < _SALSA20_INPUT_LENGTH; i++) LE_WRITE_UINT32(&dst[i * sizeof (uint32_t)], dst32[i]);
at the end of Simon's salsa20_core.c:salsa20_core by
/* _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.
I've attached a revised version of the patch containing the above change.
Regards,
--dkg