/* Implementation by Ronny Van Keer, hereby denoted as "the implementer". For more information, feedback or questions, please refer to our website: https://keccak.team/ To the extent possible under law, the implementer has waived all copyright and related or neighboring rights to the source code in this file. http://creativecommons.org/publicdomain/zero/1.0/ */ /* #define VERBOSE_LEVEL 0 */ #include #include #include #include #include "Xoodoo.h" /* ---------------------------------------------------------------- */ void Xoodoo_StaticInitialize( void ) { } /* ---------------------------------------------------------------- */ void Xoodoo_Initialize(void *state) { memset(state, 0, NLANES*sizeof(tXoodooLane)); } /* ---------------------------------------------------------------- */ void Xoodoo_AddByte(void *state, unsigned char byte, unsigned int offset) { assert(offset < NLANES*sizeof(tXoodooLane)); ((unsigned char *)state)[offset] ^= byte; } /* ---------------------------------------------------------------- */ void Xoodoo_AddBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length) { unsigned int i; assert(offset < NLANES*sizeof(tXoodooLane)); assert(offset+length <= NLANES*sizeof(tXoodooLane)); for(i=0; i> (8*j)) & 0xFF; } static void Xoodoo_Round( tXoodooLane * a, tXoodooLane rc ) { unsigned int x, y; tXoodooLane b[NLANES]; tXoodooLane p[NCOLUMS]; tXoodooLane e[NCOLUMS]; /* Theta: Column Parity Mixer */ for (x=0; x