php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
KeccakP-1600-inplace32BI.c File Reference
#include <string.h>
#include "brg_endian.h"
#include "KeccakP-1600-SnP.h"
#include "SnP-Relaned.h"

Go to the source code of this file.

Macros

#define ALLOW_MISALIGNED_ACCESS
 
#define ROL32(a, offset)
 
#define prepareToBitInterleaving(low, high, temp, temp0, temp1)
 
#define toBitInterleavingAndXOR(low, high, even, odd, temp, temp0, temp1)
 
#define toBitInterleavingAndAND(low, high, even, odd, temp, temp0, temp1)
 
#define toBitInterleavingAndSet(low, high, even, odd, temp, temp0, temp1)
 
#define prepareFromBitInterleaving(even, odd, temp, temp0, temp1)
 
#define fromBitInterleaving(even, odd, low, high, temp, temp0, temp1)
 
#define fromBitInterleavingAndXOR(even, odd, lowIn, highIn, lowOut, highOut, temp, temp0, temp1)
 
#define KeccakRound0()
 
#define KeccakRound1()
 
#define KeccakRound2()
 
#define KeccakRound3()
 
#define Aba0   stateAsHalfLanes[ 0]
 
#define Aba1   stateAsHalfLanes[ 1]
 
#define Abe0   stateAsHalfLanes[ 2]
 
#define Abe1   stateAsHalfLanes[ 3]
 
#define Abi0   stateAsHalfLanes[ 4]
 
#define Abi1   stateAsHalfLanes[ 5]
 
#define Abo0   stateAsHalfLanes[ 6]
 
#define Abo1   stateAsHalfLanes[ 7]
 
#define Abu0   stateAsHalfLanes[ 8]
 
#define Abu1   stateAsHalfLanes[ 9]
 
#define Aga0   stateAsHalfLanes[10]
 
#define Aga1   stateAsHalfLanes[11]
 
#define Age0   stateAsHalfLanes[12]
 
#define Age1   stateAsHalfLanes[13]
 
#define Agi0   stateAsHalfLanes[14]
 
#define Agi1   stateAsHalfLanes[15]
 
#define Ago0   stateAsHalfLanes[16]
 
#define Ago1   stateAsHalfLanes[17]
 
#define Agu0   stateAsHalfLanes[18]
 
#define Agu1   stateAsHalfLanes[19]
 
#define Aka0   stateAsHalfLanes[20]
 
#define Aka1   stateAsHalfLanes[21]
 
#define Ake0   stateAsHalfLanes[22]
 
#define Ake1   stateAsHalfLanes[23]
 
#define Aki0   stateAsHalfLanes[24]
 
#define Aki1   stateAsHalfLanes[25]
 
#define Ako0   stateAsHalfLanes[26]
 
#define Ako1   stateAsHalfLanes[27]
 
#define Aku0   stateAsHalfLanes[28]
 
#define Aku1   stateAsHalfLanes[29]
 
#define Ama0   stateAsHalfLanes[30]
 
#define Ama1   stateAsHalfLanes[31]
 
#define Ame0   stateAsHalfLanes[32]
 
#define Ame1   stateAsHalfLanes[33]
 
#define Ami0   stateAsHalfLanes[34]
 
#define Ami1   stateAsHalfLanes[35]
 
#define Amo0   stateAsHalfLanes[36]
 
#define Amo1   stateAsHalfLanes[37]
 
#define Amu0   stateAsHalfLanes[38]
 
#define Amu1   stateAsHalfLanes[39]
 
#define Asa0   stateAsHalfLanes[40]
 
#define Asa1   stateAsHalfLanes[41]
 
#define Ase0   stateAsHalfLanes[42]
 
#define Ase1   stateAsHalfLanes[43]
 
#define Asi0   stateAsHalfLanes[44]
 
#define Asi1   stateAsHalfLanes[45]
 
#define Aso0   stateAsHalfLanes[46]
 
#define Aso1   stateAsHalfLanes[47]
 
#define Asu0   stateAsHalfLanes[48]
 
#define Asu1   stateAsHalfLanes[49]
 
#define I0   Ba
 
#define I1   Be
 
#define T0   Bi
 
#define T1   Bo
 
#define SwapPI13(in0, in1, in2, in3, eo0, eo1, eo2, eo3)
 
#define SwapPI2(in0, in1, in2, in3)
 
#define SwapEO(even, odd)
 

Typedefs

typedef unsigned char UINT8
 
typedef unsigned int UINT32
 

Functions

void KeccakP1600_SetBytesInLaneToZero (void *state, unsigned int lanePosition, unsigned int offset, unsigned int length)
 
void KeccakP1600_Initialize (void *state)
 
void KeccakP1600_AddByte (void *state, unsigned char byte, unsigned int offset)
 
void KeccakP1600_AddBytesInLane (void *state, unsigned int lanePosition, const unsigned char *data, unsigned int offset, unsigned int length)
 
ALLOW_MISALIGNED_ACCESS void KeccakP1600_AddLanes (void *state, const unsigned char *data, unsigned int laneCount)
 
void KeccakP1600_AddBytes (void *state, const unsigned char *data, unsigned int offset, unsigned int length)
 
void KeccakP1600_OverwriteBytesInLane (void *state, unsigned int lanePosition, const unsigned char *data, unsigned int offset, unsigned int length)
 
ALLOW_MISALIGNED_ACCESS void KeccakP1600_OverwriteLanes (void *state, const unsigned char *data, unsigned int laneCount)
 
void KeccakP1600_OverwriteBytes (void *state, const unsigned char *data, unsigned int offset, unsigned int length)
 
void KeccakP1600_OverwriteWithZeroes (void *state, unsigned int byteCount)
 
void KeccakP1600_ExtractBytesInLane (const void *state, unsigned int lanePosition, unsigned char *data, unsigned int offset, unsigned int length)
 
ALLOW_MISALIGNED_ACCESS void KeccakP1600_ExtractLanes (const void *state, unsigned char *data, unsigned int laneCount)
 
void KeccakP1600_ExtractBytes (const void *state, unsigned char *data, unsigned int offset, unsigned int length)
 
void KeccakP1600_ExtractAndAddBytesInLane (const void *state, unsigned int lanePosition, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
 
ALLOW_MISALIGNED_ACCESS void KeccakP1600_ExtractAndAddLanes (const void *state, const unsigned char *input, unsigned char *output, unsigned int laneCount)
 
void KeccakP1600_ExtractAndAddBytes (const void *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
 
void KeccakP1600_Permute_Nrounds (void *state, unsigned int nRounds)
 
void KeccakP1600_Permute_12rounds (void *state)
 
void KeccakP1600_Permute_24rounds (void *state)
 

Macro Definition Documentation

◆ Aba0

#define Aba0   stateAsHalfLanes[ 0]

◆ Aba1

#define Aba1   stateAsHalfLanes[ 1]

◆ Abe0

#define Abe0   stateAsHalfLanes[ 2]

◆ Abe1

#define Abe1   stateAsHalfLanes[ 3]

◆ Abi0

#define Abi0   stateAsHalfLanes[ 4]

◆ Abi1

#define Abi1   stateAsHalfLanes[ 5]

◆ Abo0

#define Abo0   stateAsHalfLanes[ 6]

◆ Abo1

#define Abo1   stateAsHalfLanes[ 7]

◆ Abu0

#define Abu0   stateAsHalfLanes[ 8]

◆ Abu1

#define Abu1   stateAsHalfLanes[ 9]

◆ Aga0

#define Aga0   stateAsHalfLanes[10]

◆ Aga1

#define Aga1   stateAsHalfLanes[11]

◆ Age0

#define Age0   stateAsHalfLanes[12]

◆ Age1

#define Age1   stateAsHalfLanes[13]

◆ Agi0

#define Agi0   stateAsHalfLanes[14]

◆ Agi1

#define Agi1   stateAsHalfLanes[15]

◆ Ago0

#define Ago0   stateAsHalfLanes[16]

◆ Ago1

#define Ago1   stateAsHalfLanes[17]

◆ Agu0

#define Agu0   stateAsHalfLanes[18]

◆ Agu1

#define Agu1   stateAsHalfLanes[19]

◆ Aka0

#define Aka0   stateAsHalfLanes[20]

◆ Aka1

#define Aka1   stateAsHalfLanes[21]

◆ Ake0

#define Ake0   stateAsHalfLanes[22]

◆ Ake1

#define Ake1   stateAsHalfLanes[23]

◆ Aki0

#define Aki0   stateAsHalfLanes[24]

◆ Aki1

#define Aki1   stateAsHalfLanes[25]

◆ Ako0

#define Ako0   stateAsHalfLanes[26]

◆ Ako1

#define Ako1   stateAsHalfLanes[27]

◆ Aku0

#define Aku0   stateAsHalfLanes[28]

◆ Aku1

#define Aku1   stateAsHalfLanes[29]

◆ ALLOW_MISALIGNED_ACCESS

#define ALLOW_MISALIGNED_ACCESS

Definition at line 26 of file KeccakP-1600-inplace32BI.c.

◆ Ama0

#define Ama0   stateAsHalfLanes[30]

◆ Ama1

#define Ama1   stateAsHalfLanes[31]

◆ Ame0

#define Ame0   stateAsHalfLanes[32]

◆ Ame1

#define Ame1   stateAsHalfLanes[33]

◆ Ami0

#define Ami0   stateAsHalfLanes[34]

◆ Ami1

#define Ami1   stateAsHalfLanes[35]

◆ Amo0

#define Amo0   stateAsHalfLanes[36]

◆ Amo1

#define Amo1   stateAsHalfLanes[37]

◆ Amu0

#define Amu0   stateAsHalfLanes[38]

◆ Amu1

#define Amu1   stateAsHalfLanes[39]

◆ Asa0

#define Asa0   stateAsHalfLanes[40]

◆ Asa1

#define Asa1   stateAsHalfLanes[41]

◆ Ase0

#define Ase0   stateAsHalfLanes[42]

◆ Ase1

#define Ase1   stateAsHalfLanes[43]

◆ Asi0

#define Asi0   stateAsHalfLanes[44]

◆ Asi1

#define Asi1   stateAsHalfLanes[45]

◆ Aso0

#define Aso0   stateAsHalfLanes[46]

◆ Aso1

#define Aso1   stateAsHalfLanes[47]

◆ Asu0

#define Asu0   stateAsHalfLanes[48]

◆ Asu1

#define Asu1   stateAsHalfLanes[49]

◆ fromBitInterleaving

#define fromBitInterleaving ( even,
odd,
low,
high,
temp,
temp0,
temp1 )
Value:
prepareFromBitInterleaving(even, odd, temp, temp0, temp1) \
low = temp0; \
high = temp1;
#define prepareFromBitInterleaving(even, odd, temp, temp0, temp1)

Definition at line 80 of file KeccakP-1600-inplace32BI.c.

◆ fromBitInterleavingAndXOR

#define fromBitInterleavingAndXOR ( even,
odd,
lowIn,
highIn,
lowOut,
highOut,
temp,
temp0,
temp1 )
Value:
prepareFromBitInterleaving(even, odd, temp, temp0, temp1) \
lowOut = lowIn ^ temp0; \
highOut = highIn ^ temp1;

Definition at line 85 of file KeccakP-1600-inplace32BI.c.

◆ I0

#define I0   Ba

◆ I1

#define I1   Be

◆ KeccakRound0

#define KeccakRound0 ( )

Definition at line 470 of file KeccakP-1600-inplace32BI.c.

◆ KeccakRound1

#define KeccakRound1 ( )

Definition at line 595 of file KeccakP-1600-inplace32BI.c.

◆ KeccakRound2

#define KeccakRound2 ( )

Definition at line 720 of file KeccakP-1600-inplace32BI.c.

◆ KeccakRound3

#define KeccakRound3 ( )

Definition at line 845 of file KeccakP-1600-inplace32BI.c.

◆ prepareFromBitInterleaving

#define prepareFromBitInterleaving ( even,
odd,
temp,
temp0,
temp1 )
Value:
temp0 = (even); \
temp1 = (odd); \
temp = (temp0 & 0x0000FFFF) | (temp1 << 16); \
temp1 = (temp0 >> 16) | (temp1 & 0xFFFF0000); \
temp0 = temp; \
temp = (temp0 ^ (temp0 >> 8)) & 0x0000FF00UL; temp0 = temp0 ^ temp ^ (temp << 8); \
temp = (temp0 ^ (temp0 >> 4)) & 0x00F000F0UL; temp0 = temp0 ^ temp ^ (temp << 4); \
temp = (temp0 ^ (temp0 >> 2)) & 0x0C0C0C0CUL; temp0 = temp0 ^ temp ^ (temp << 2); \
temp = (temp0 ^ (temp0 >> 1)) & 0x22222222UL; temp0 = temp0 ^ temp ^ (temp << 1); \
temp = (temp1 ^ (temp1 >> 8)) & 0x0000FF00UL; temp1 = temp1 ^ temp ^ (temp << 8); \
temp = (temp1 ^ (temp1 >> 4)) & 0x00F000F0UL; temp1 = temp1 ^ temp ^ (temp << 4); \
temp = (temp1 ^ (temp1 >> 2)) & 0x0C0C0C0CUL; temp1 = temp1 ^ temp ^ (temp << 2); \
temp = (temp1 ^ (temp1 >> 1)) & 0x22222222UL; temp1 = temp1 ^ temp ^ (temp << 1);

Definition at line 65 of file KeccakP-1600-inplace32BI.c.

◆ prepareToBitInterleaving

#define prepareToBitInterleaving ( low,
high,
temp,
temp0,
temp1 )
Value:
temp0 = (low); \
temp = (temp0 ^ (temp0 >> 1)) & 0x22222222UL; temp0 = temp0 ^ temp ^ (temp << 1); \
temp = (temp0 ^ (temp0 >> 2)) & 0x0C0C0C0CUL; temp0 = temp0 ^ temp ^ (temp << 2); \
temp = (temp0 ^ (temp0 >> 4)) & 0x00F000F0UL; temp0 = temp0 ^ temp ^ (temp << 4); \
temp = (temp0 ^ (temp0 >> 8)) & 0x0000FF00UL; temp0 = temp0 ^ temp ^ (temp << 8); \
temp1 = (high); \
temp = (temp1 ^ (temp1 >> 1)) & 0x22222222UL; temp1 = temp1 ^ temp ^ (temp << 1); \
temp = (temp1 ^ (temp1 >> 2)) & 0x0C0C0C0CUL; temp1 = temp1 ^ temp ^ (temp << 2); \
temp = (temp1 ^ (temp1 >> 4)) & 0x00F000F0UL; temp1 = temp1 ^ temp ^ (temp << 4); \
temp = (temp1 ^ (temp1 >> 8)) & 0x0000FF00UL; temp1 = temp1 ^ temp ^ (temp << 8);

Definition at line 37 of file KeccakP-1600-inplace32BI.c.

◆ ROL32

#define ROL32 ( a,
offset )
Value:
((((UINT32)a) << (offset)) ^ (((UINT32)a) >> (32-(offset))))
unsigned int UINT32
zend_long offset
$obj a
Definition test.php:84

Definition at line 34 of file KeccakP-1600-inplace32BI.c.

◆ SwapEO

#define SwapEO ( even,
odd )
Value:
T0 = even; even = odd; odd = T0
#define T0

◆ SwapPI13

#define SwapPI13 ( in0,
in1,
in2,
in3,
eo0,
eo1,
eo2,
eo3 )
Value:
I0 = (in0)[0]; I1 = (in0)[1]; \
T0 = (in1)[0]; T1 = (in1)[1]; \
(in0)[eo0] = T0; (in0)[eo0^1] = T1; \
T0 = (in2)[0]; T1 = (in2)[1]; \
(in1)[eo1] = T0; (in1)[eo1^1] = T1; \
T0 = (in3)[0]; T1 = (in3)[1]; \
(in2)[eo2] = T0; (in2)[eo2^1] = T1; \
(in3)[eo3] = I0; (in3)[eo3^1] = I1
#define I0
#define T1
#define I1

◆ SwapPI2

#define SwapPI2 ( in0,
in1,
in2,
in3 )
Value:
I0 = (in0)[0]; I1 = (in0)[1]; \
T0 = (in1)[0]; T1 = (in1)[1]; \
(in0)[1] = T0; (in0)[0] = T1; \
(in1)[1] = I0; (in1)[0] = I1; \
I0 = (in2)[0]; I1 = (in2)[1]; \
T0 = (in3)[0]; T1 = (in3)[1]; \
(in2)[1] = T0; (in2)[0] = T1; \
(in3)[1] = I0; (in3)[0] = I1

◆ T0

#define T0   Bi

◆ T1

#define T1   Bo

◆ toBitInterleavingAndAND

#define toBitInterleavingAndAND ( low,
high,
even,
odd,
temp,
temp0,
temp1 )
Value:
prepareToBitInterleaving(low, high, temp, temp0, temp1) \
even &= (temp0 & 0x0000FFFF) | (temp1 << 16); \
odd &= (temp0 >> 16) | (temp1 & 0xFFFF0000);
#define prepareToBitInterleaving(low, high, temp, temp0, temp1)

Definition at line 54 of file KeccakP-1600-inplace32BI.c.

◆ toBitInterleavingAndSet

#define toBitInterleavingAndSet ( low,
high,
even,
odd,
temp,
temp0,
temp1 )
Value:
prepareToBitInterleaving(low, high, temp, temp0, temp1) \
even = (temp0 & 0x0000FFFF) | (temp1 << 16); \
odd = (temp0 >> 16) | (temp1 & 0xFFFF0000);

Definition at line 59 of file KeccakP-1600-inplace32BI.c.

◆ toBitInterleavingAndXOR

#define toBitInterleavingAndXOR ( low,
high,
even,
odd,
temp,
temp0,
temp1 )
Value:
prepareToBitInterleaving(low, high, temp, temp0, temp1) \
even ^= (temp0 & 0x0000FFFF) | (temp1 << 16); \
odd ^= (temp0 >> 16) | (temp1 & 0xFFFF0000);

Definition at line 49 of file KeccakP-1600-inplace32BI.c.

Typedef Documentation

◆ UINT32

typedef unsigned int UINT32

Definition at line 30 of file KeccakP-1600-inplace32BI.c.

◆ UINT8

typedef unsigned char UINT8

Definition at line 29 of file KeccakP-1600-inplace32BI.c.

Function Documentation

◆ KeccakP1600_AddByte()

void KeccakP1600_AddByte ( void * state,
unsigned char byte,
unsigned int offset )

Definition at line 125 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_AddBytes()

void KeccakP1600_AddBytes ( void * state,
const unsigned char * data,
unsigned int offset,
unsigned int length )

Definition at line 214 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_AddBytesInLane()

void KeccakP1600_AddBytesInLane ( void * state,
unsigned int lanePosition,
const unsigned char * data,
unsigned int offset,
unsigned int length )

Definition at line 146 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_AddLanes()

ALLOW_MISALIGNED_ACCESS void KeccakP1600_AddLanes ( void * state,
const unsigned char * data,
unsigned int laneCount )

Definition at line 174 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_ExtractAndAddBytes()

void KeccakP1600_ExtractAndAddBytes ( const void * state,
const unsigned char * input,
unsigned char * output,
unsigned int offset,
unsigned int length )

Definition at line 434 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_ExtractAndAddBytesInLane()

void KeccakP1600_ExtractAndAddBytesInLane ( const void * state,
unsigned int lanePosition,
const unsigned char * input,
unsigned char * output,
unsigned int offset,
unsigned int length )

Definition at line 365 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_ExtractAndAddLanes()

ALLOW_MISALIGNED_ACCESS void KeccakP1600_ExtractAndAddLanes ( const void * state,
const unsigned char * input,
unsigned char * output,
unsigned int laneCount )

Definition at line 393 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_ExtractBytes()

void KeccakP1600_ExtractBytes ( const void * state,
unsigned char * data,
unsigned int offset,
unsigned int length )

Definition at line 358 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_ExtractBytesInLane()

void KeccakP1600_ExtractBytesInLane ( const void * state,
unsigned int lanePosition,
unsigned char * data,
unsigned int offset,
unsigned int length )

Definition at line 292 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_ExtractLanes()

ALLOW_MISALIGNED_ACCESS void KeccakP1600_ExtractLanes ( const void * state,
unsigned char * data,
unsigned int laneCount )

Definition at line 318 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_Initialize()

void KeccakP1600_Initialize ( void * state)

Definition at line 118 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_OverwriteBytes()

void KeccakP1600_OverwriteBytes ( void * state,
const unsigned char * data,
unsigned int offset,
unsigned int length )

Definition at line 270 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_OverwriteBytesInLane()

void KeccakP1600_OverwriteBytesInLane ( void * state,
unsigned int lanePosition,
const unsigned char * data,
unsigned int offset,
unsigned int length )

Definition at line 221 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_OverwriteLanes()

ALLOW_MISALIGNED_ACCESS void KeccakP1600_OverwriteLanes ( void * state,
const unsigned char * data,
unsigned int laneCount )

Definition at line 230 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_OverwriteWithZeroes()

void KeccakP1600_OverwriteWithZeroes ( void * state,
unsigned int byteCount )

Definition at line 277 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_Permute_12rounds()

void KeccakP1600_Permute_12rounds ( void * state)

Definition at line 1160 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_Permute_24rounds()

void KeccakP1600_Permute_24rounds ( void * state)

Definition at line 1167 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_Permute_Nrounds()

void KeccakP1600_Permute_Nrounds ( void * state,
unsigned int nRounds )

Definition at line 970 of file KeccakP-1600-inplace32BI.c.

◆ KeccakP1600_SetBytesInLaneToZero()

void KeccakP1600_SetBytesInLaneToZero ( void * state,
unsigned int lanePosition,
unsigned int offset,
unsigned int length )

Definition at line 90 of file KeccakP-1600-inplace32BI.c.