PandA-2024.02
Macros | Typedefs | Functions | Variables
Keccak.c File Reference

Go to the source code of this file.

Macros

#define nrRounds   24
 
#define GET_KRC_VAL(index)   (KeccakRoundConstants[index])
 
#define nrLanes   25
 
#define index(x, y)   (((x)%5)+5*((y)%5))
 
#define ROL64(a, offset)   ((offset != 0) ? ((((UINT64)a) << offset) ^ (((UINT64)a) >> (64-offset))) : a)
 

Typedefs

typedef unsigned char UINT8
 
typedef unsigned long long int UINT64
 

Functions

void theta (UINT64 *A)
 
void rho (UINT64 *A)
 
void pi (UINT64 *A)
 
void chi (UINT64 *A)
 
void iota (UINT64 *A, unsigned int indexRound)
 
void kekka_coproc (UINT64 A[25])
 

Variables

static UINT64 KeccakRoundConstants [nrRounds]
 
static unsigned char KeccakRhoOffsets [nrLanes]
 

Macro Definition Documentation

◆ GET_KRC_VAL

#define GET_KRC_VAL (   index)    (KeccakRoundConstants[index])

Definition at line 16 of file Keccak.c.

Referenced by iota().

◆ index

#define index (   x,
 
)    (((x)%5)+5*((y)%5))

Definition at line 74 of file Keccak.c.

Referenced by chi(), iota(), pi(), rho(), and theta().

◆ nrLanes

#define nrLanes   25

Definition at line 45 of file Keccak.c.

◆ nrRounds

#define nrRounds   24

Definition at line 14 of file Keccak.c.

Referenced by kekka_coproc().

◆ ROL64

#define ROL64 (   a,
  offset 
)    ((offset != 0) ? ((((UINT64)a) << offset) ^ (((UINT64)a) >> (64-offset))) : a)

Definition at line 75 of file Keccak.c.

Referenced by rho(), and theta().

Typedef Documentation

◆ UINT64

typedef unsigned long long int UINT64

Definition at line 13 of file Keccak.c.

◆ UINT8

typedef unsigned char UINT8

Definition at line 12 of file Keccak.c.

Function Documentation

◆ chi()

void chi ( UINT64 A)

Definition at line 113 of file Keccak.c.

References C, index, and x.

◆ iota()

void iota ( UINT64 A,
unsigned int  indexRound 
)

Definition at line 126 of file Keccak.c.

References GET_KRC_VAL, and index.

◆ kekka_coproc()

void kekka_coproc ( UINT64  A[25])

Definition at line 132 of file Keccak.c.

References chi(), iota(), nrRounds, pi(), rho(), and theta().

Here is the call graph for this function:

◆ pi()

void pi ( UINT64 A)

Definition at line 102 of file Keccak.c.

References index, and x.

◆ rho()

void rho ( UINT64 A)

Definition at line 94 of file Keccak.c.

References index, KeccakRhoOffsets, ROL64, and x.

◆ theta()

void theta ( UINT64 A)

Definition at line 77 of file Keccak.c.

References C, D, index, ROL64, and x.

Variable Documentation

◆ KeccakRhoOffsets

unsigned char KeccakRhoOffsets[nrLanes]
static
Initial value:
= {
0,
1,
62,
28,
27,
36,
44,
6,
55,
20,
3,
10,
43,
25,
39,
41,
45,
15,
21,
8,
18,
2,
61,
56,
14
}

Definition at line 46 of file Keccak.c.

Referenced by rho().

◆ KeccakRoundConstants

UINT64 KeccakRoundConstants[nrRounds]
static
Initial value:
= {
0x0000000000000001ULL,
0x0000000000008082ULL,
0x800000000000808aULL,
0x8000000080008000ULL,
0x000000000000808bULL,
0x0000000080000001ULL,
0x8000000080008081ULL,
0x8000000000008009ULL,
0x000000000000008aULL,
0x0000000000000088ULL,
0x0000000080008009ULL,
0x000000008000000aULL,
0x000000008000808bULL,
0x800000000000008bULL,
0x8000000000008089ULL,
0x8000000000008003ULL,
0x8000000000008002ULL,
0x8000000000000080ULL,
0x000000000000800aULL,
0x800000008000000aULL,
0x8000000080008081ULL,
0x8000000000008080ULL,
0x0000000080000001ULL,
0x8000000080008008ULL
}

Definition at line 18 of file Keccak.c.


Generated on Mon Feb 12 2024 13:02:58 for PandA-2024.02 by doxygen 1.8.13