-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeccakP-1600-SnP.h
50 lines (37 loc) · 2.02 KB
/
KeccakP-1600-SnP.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
The eXtended Keccak Code Package (XKCP)
https://github.com/XKCP/XKCP
The Keccak-p permutations, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche.
Implementation by the designers, hereby denoted as "the implementer".
For more information, feedback or questions, please refer to the Keccak Team 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/
---
Please refer to SnP-documentation.h for more details.
*/
#ifndef _KeccakP_1600_SnP_h_
#define _KeccakP_1600_SnP_h_
#include <stdint.h>
typedef struct {
uint8_t A[200];
} KeccakP1600_plain8_state;
typedef KeccakP1600_plain8_state KeccakP1600_state;
#define KeccakP1600_implementation "64-bit reference implementation"
#ifdef KeccakReference
void KeccakP1600_StaticInitialize( void );
#else
#define KeccakP1600_StaticInitialize()
#endif
void KeccakP1600_Initialize(KeccakP1600_plain8_state *state);
void KeccakP1600_AddByte(KeccakP1600_plain8_state *state, unsigned char data, unsigned int offset);
void KeccakP1600_AddBytes(KeccakP1600_plain8_state *state, const unsigned char *data, unsigned int offset, unsigned int length);
void KeccakP1600_OverwriteBytes(KeccakP1600_plain8_state *state, const unsigned char *data, unsigned int offset, unsigned int length);
void KeccakP1600_OverwriteWithZeroes(KeccakP1600_plain8_state *state, unsigned int byteCount);
void KeccakP1600_Permute_Nrounds(KeccakP1600_plain8_state *state, unsigned int nrounds);
void KeccakP1600_Permute_12rounds(KeccakP1600_plain8_state *state);
void KeccakP1600_Permute_24rounds(KeccakP1600_plain8_state *state);
void KeccakP1600_ExtractBytes(const KeccakP1600_plain8_state *state, unsigned char *data, unsigned int offset, unsigned int length);
void KeccakP1600_ExtractAndAddBytes(const KeccakP1600_plain8_state *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length);
#endif