From: Christian Heimes Date: Sat, 13 Oct 2012 22:59:29 +0000 (+0200) Subject: Keccak: fromBytesToWord() and fromWordToBytes() are required on 64bit big endian... X-Git-Tag: v3.4.0a1~2260 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba3e4a0bc07b2bfead826216b46b9093facdbc6e;p=python Keccak: fromBytesToWord() and fromWordToBytes() are required on 64bit big endian platforms --- diff --git a/Modules/_sha3/keccak/KeccakF-1600-opt64.c b/Modules/_sha3/keccak/KeccakF-1600-opt64.c index 5987046685..57e2aa4500 100644 --- a/Modules/_sha3/keccak/KeccakF-1600-opt64.c +++ b/Modules/_sha3/keccak/KeccakF-1600-opt64.c @@ -324,7 +324,7 @@ static void KeccakPermutation(unsigned char *state) KeccakPermutationOnWords((UINT64*)state); } -/* +#if (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN) static void fromBytesToWord(UINT64 *word, const UINT8 *bytes) { unsigned int i; @@ -333,7 +333,8 @@ static void fromBytesToWord(UINT64 *word, const UINT8 *bytes) for(i=0; i<(64/8); i++) *word |= (UINT64)(bytes[i]) << (8*i); } -*/ +#endif + #ifdef ProvideFast576 static void KeccakAbsorb576bits(unsigned char *state, const unsigned char *data) @@ -445,7 +446,7 @@ static void KeccakAbsorb(unsigned char *state, const unsigned char *data, unsign #endif } -/* +#if (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN) static void fromWordToBytes(UINT8 *bytes, const UINT64 word) { unsigned int i; @@ -453,7 +454,8 @@ static void fromWordToBytes(UINT8 *bytes, const UINT64 word) for(i=0; i<(64/8); i++) bytes[i] = (word >> (8*i)) & 0xFF; } -*/ +#endif + #ifdef ProvideFast1024 static void KeccakExtract1024bits(const unsigned char *state, unsigned char *data)