KeccakP-1600-SnP.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. Implementation by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni,
  3. Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer, hereby
  4. denoted as "the implementer".
  5. For more information, feedback or questions, please refer to our websites:
  6. http://keccak.noekeon.org/
  7. http://keyak.noekeon.org/
  8. http://ketje.noekeon.org/
  9. To the extent possible under law, the implementer has waived all copyright
  10. and related or neighboring rights to the source code in this file.
  11. http://creativecommons.org/publicdomain/zero/1.0/
  12. */
  13. #ifndef _KeccakP_1600_SnP_h_
  14. #define _KeccakP_1600_SnP_h_
  15. /** For the documentation, see SnP-documentation.h.
  16. */
  17. #include "brg_endian.h"
  18. #include "KeccakP-1600-opt64-config.h"
  19. #define KeccakP1600_implementation "generic 64-bit optimized implementation (" KeccakP1600_implementation_config ")"
  20. #define KeccakP1600_stateSizeInBytes 200
  21. #define KeccakP1600_stateAlignment 8
  22. #define KeccakF1600_FastLoop_supported
  23. #include <stddef.h>
  24. #define KeccakP1600_StaticInitialize()
  25. void KeccakP1600_Initialize(void *state);
  26. #if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
  27. #define KeccakP1600_AddByte(state, byte, offset) \
  28. ((unsigned char*)(state))[(offset)] ^= (byte)
  29. #else
  30. void KeccakP1600_AddByte(void *state, unsigned char data, unsigned int offset);
  31. #endif
  32. void KeccakP1600_AddBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length);
  33. void KeccakP1600_OverwriteBytes(void *state, const unsigned char *data, unsigned int offset, unsigned int length);
  34. void KeccakP1600_OverwriteWithZeroes(void *state, unsigned int byteCount);
  35. void KeccakP1600_Permute_Nrounds(void *state, unsigned int nrounds);
  36. void KeccakP1600_Permute_12rounds(void *state);
  37. void KeccakP1600_Permute_24rounds(void *state);
  38. void KeccakP1600_ExtractBytes(const void *state, unsigned char *data, unsigned int offset, unsigned int length);
  39. void KeccakP1600_ExtractAndAddBytes(const void *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length);
  40. size_t KeccakF1600_FastLoop_Absorb(void *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen);
  41. #endif