KeccakTools

Keccak-fParity.cpp File Reference

#include "Keccak-fParity.h"
Include dependency graph for Keccak-fParity.cpp:

Functions

RowValue getParity (SliceValue slice)
PackedParity getParity (const vector< SliceValue > &state)
PackedParity packParity (const vector< RowValue > &parity)
void unpackParity (PackedParity packedParity, vector< RowValue > &parity, unsigned int laneSize)
void getParity (const vector< SliceValue > &state, vector< RowValue > &parity)
void getParity (const vector< LaneValue > &state, vector< LaneValue > &parity)
void fromSlicesToSheetsParity (const vector< RowValue > &paritySlices, vector< LaneValue > &paritySheet)
void fromSheetsToSlicesParity (const vector< LaneValue > &paritySheet, vector< RowValue > &paritySlices)

Function Documentation

void fromSheetsToSlicesParity ( const vector< LaneValue > &  paritySheets,
vector< RowValue > &  paritySlices 
)

This function converts the parity of a state expressed as a vector of parities of each sheet into a vector of parities of each slice.

Precondition:
paritySlices must be initialized with the correct size (lane size).
Parameters:
paritySheetsThe parity as a vector of lanes.
paritySlicesThe parity as a vector of rows.
void fromSlicesToSheetsParity ( const vector< RowValue > &  paritySlices,
vector< LaneValue > &  paritySheets 
)

This function converts the parity of a state expressed as a vector of parities of each slice into a vector of parities of each sheet.

Parameters:
paritySlicesThe parity as a vector of rows.
paritySheetsThe parity as a vector of lanes.
void getParity ( const vector< LaneValue > &  state,
vector< LaneValue > &  parity 
)

This function computes the parity of a state, sheet per sheet, and returns it in a vector of lane values.

Parameters:
stateThe value of the state given as a vector of lanes.
parityThe parity of state as a vector of 5 lane values.
PackedParity getParity ( const vector< SliceValue > &  state)

This function computes the parity of a state, and returns it in a PackedParity.

Parameters:
stateThe value of the state given as a vector of slices.
Returns:
The parity of the state.
void getParity ( const vector< SliceValue > &  state,
vector< RowValue > &  parity 
)

This function computes the parity of a state, slice per slice, and returns it in a vector of row values.

Parameters:
stateThe value of the state given as a vector of slices.
parityThe parity of state as a vector of row values.
RowValue getParity ( SliceValue  slice)

This function computes the parity of a slice.

Parameters:
sliceThe value of a slice.
Returns:
The parity of the given slice value.
PackedParity packParity ( const vector< RowValue > &  parity)

This function converts from a vector of parity of each slice to a PackedParity value.

Parameters:
parityThe parity of a state as vector of row values.
Returns:
The parity of a state as a PackedParity value.
void unpackParity ( PackedParity  packedParity,
vector< RowValue > &  parity,
unsigned int  laneSize 
)

This function converts from a PackedParity value to a vector of parity of each slice.

Parameters:
packedParityThe parity of a state as a PackedParity value.
parityThe parity of a state as a vector of row values.
laneSizeThe number of slices.