|
| 1 | +/* |
| 2 | +The eXtended Keccak Code Package (XKCP) |
| 3 | +https://github.com/XKCP/XKCP |
| 4 | +
|
| 5 | +The Keccak-p permutations, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. |
| 6 | +
|
| 7 | +Implementation by Gilles Van Assche and Ronny Van Keer, hereby denoted as "the implementer". |
| 8 | +
|
| 9 | +For more information, feedback or questions, please refer to the Keccak Team website: |
| 10 | +https://keccak.team/ |
| 11 | +
|
| 12 | +To the extent possible under law, the implementer has waived all copyright |
| 13 | +and related or neighboring rights to the source code in this file. |
| 14 | +http://creativecommons.org/publicdomain/zero/1.0/ |
| 15 | +
|
| 16 | +--- |
| 17 | +
|
| 18 | +Please refer to SnP-documentation.h for more details. |
| 19 | +*/ |
| 20 | + |
| 21 | +#ifndef _KeccakP_1600_times2_SnP_h_ |
| 22 | +#define _KeccakP_1600_times2_SnP_h_ |
| 23 | + |
| 24 | +#include "KeccakP-1600-times2-SIMD128.h" |
| 25 | +#include "KeccakP-1600-times2-AVX512.h" |
| 26 | +#include "PlSnP-common.h" |
| 27 | + |
| 28 | +typedef union { |
| 29 | + KeccakP1600times2_SIMD128_states SSSE3_states; |
| 30 | + KeccakP1600times2_align512SIMD128_states AVX512_states; |
| 31 | +} KeccakP1600times2_states; |
| 32 | + |
| 33 | +const char * KeccakP1600times2_GetImplementation(); |
| 34 | +int KeccakP1600times2_GetFeatures(); |
| 35 | + |
| 36 | +void KeccakP1600times2_StaticInitialize(); |
| 37 | +void KeccakP1600times2_InitializeAll(KeccakP1600times2_states *states); |
| 38 | +void KeccakP1600times2_AddByte(KeccakP1600times2_states *states, unsigned int instanceIndex, unsigned char data, unsigned int offset); |
| 39 | +void KeccakP1600times2_AddBytes(KeccakP1600times2_states *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length); |
| 40 | +void KeccakP1600times2_AddLanesAll(KeccakP1600times2_states *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset); |
| 41 | +void KeccakP1600times2_OverwriteBytes(KeccakP1600times2_states *states, unsigned int instanceIndex, const unsigned char *data, unsigned int offset, unsigned int length); |
| 42 | +void KeccakP1600times2_OverwriteLanesAll(KeccakP1600times2_states *states, const unsigned char *data, unsigned int laneCount, unsigned int laneOffset); |
| 43 | +void KeccakP1600times2_OverwriteWithZeroes(KeccakP1600times2_states *states, unsigned int instanceIndex, unsigned int byteCount); |
| 44 | +void KeccakP1600times2_PermuteAll_4rounds(KeccakP1600times2_states *states); |
| 45 | +void KeccakP1600times2_PermuteAll_6rounds(KeccakP1600times2_states *states); |
| 46 | +void KeccakP1600times2_PermuteAll_12rounds(KeccakP1600times2_states *states); |
| 47 | +void KeccakP1600times2_PermuteAll_24rounds(KeccakP1600times2_states *states); |
| 48 | +void KeccakP1600times2_ExtractBytes(const KeccakP1600times2_states *states, unsigned int instanceIndex, unsigned char *data, unsigned int offset, unsigned int length); |
| 49 | +void KeccakP1600times2_ExtractLanesAll(const KeccakP1600times2_states *states, unsigned char *data, unsigned int laneCount, unsigned int laneOffset); |
| 50 | +void KeccakP1600times2_ExtractAndAddBytes(const KeccakP1600times2_states *states, unsigned int instanceIndex, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length); |
| 51 | +void KeccakP1600times2_ExtractAndAddLanesAll(const KeccakP1600times2_states *states, const unsigned char *input, unsigned char *output, unsigned int laneCount, unsigned int laneOffset); |
| 52 | + |
| 53 | +size_t KeccakF1600times2_FastLoop_Absorb(KeccakP1600times2_states *states, unsigned int laneCount, unsigned int laneOffsetParallel, unsigned int laneOffsetSerial, const unsigned char *data, size_t dataByteLen); |
| 54 | +size_t KeccakP1600times2_12rounds_FastLoop_Absorb(KeccakP1600times2_states *states, unsigned int laneCount, unsigned int laneOffsetParallel, unsigned int laneOffsetSerial, const unsigned char *data, size_t dataByteLen); |
| 55 | + |
| 56 | +size_t KeccakP1600times2_KravatteCompress(uint64_t *xAccu, uint64_t *kRoll, const unsigned char *input, size_t inputByteLen); |
| 57 | +size_t KeccakP1600times2_KravatteExpand(uint64_t *yAccu, const uint64_t *kRoll, unsigned char *output, size_t outputByteLen); |
| 58 | + |
| 59 | +void KeccakP1600times2_KT128ProcessLeaves(const unsigned char *input, unsigned char *output); |
| 60 | +void KeccakP1600times2_KT256ProcessLeaves(const unsigned char *input, unsigned char *output); |
| 61 | + |
| 62 | +#endif |
0 commit comments