KeccakTools

KeccakFEquations Class Reference

#include <Keccak-fEquations.h>

Inheritance diagram for KeccakFEquations:
Collaboration diagram for KeccakFEquations:

List of all members.

Public Member Functions

 KeccakFEquations (unsigned int aWidth, unsigned int aNrRounds=0)
void genRoundEquations (ostream &fout, bool forSage=false) const
void genComponentEquations (ostream &fout, const string &prefixInput, const string &prefixOutput) const
void genAbsoluteValuesBeforeChi (ostream &fout, const vector< LaneValue > &input, const string &prefix) const

Static Public Member Functions

static void initializeState (vector< SymbolicLane > &state, const string &prefix, unsigned int laneSize)

Protected Member Functions

void genEquations (ostream &fout, const vector< SymbolicLane > &state, const string &prefixOutput, bool forSage=false) const
void initializeState (vector< SymbolicLane > &state, const string &prefix) const

Detailed Description

Class implementing equation generation for the Keccak-f permutations.


Constructor & Destructor Documentation

KeccakFEquations::KeccakFEquations ( unsigned int  aWidth,
unsigned int  aNrRounds = 0 
)

The constructor. See KeccakF() for more details.


Member Function Documentation

void KeccakFEquations::genAbsoluteValuesBeforeChi ( ostream &  fout,
const vector< LaneValue > &  input,
const string &  prefix 
) const

Method that, given the input to the chosen Keccak-f permutation, generates initialization equations to set the absolute value just before χ at each round. This can be used in combination with KeccakFDCEquations::buildDCTrailFromPair() and KeccakFDCEquations::genDCEquations() to test that the conditions produced by the latter method are indeed satisfied by a known pair value.

Parameters:
foutThe stream to which the equations are sent.
inputThe input state.
prefixThe prefix of the variables.
void KeccakFEquations::genComponentEquations ( ostream &  fout,
const string &  prefixInput,
const string &  prefixOutput 
) const

Method that generate equations for the mappings θ, ρ, π, χ and ι of the chosen Keccak-f instance.

Parameters:
foutThe stream to which the equations are sent.
prefixInputThe prefix of the input variables.
prefixOutputThe prefix of the output variables.
void KeccakFEquations::genEquations ( ostream &  fout,
const vector< SymbolicLane > &  state,
const string &  prefixOutput,
bool  forSage = false 
) const [protected]

Internal method to generate the equations from symbolic lanes. The left hand side of the equations are the variables with prefix prefixOutput. The right hand side of the equations are the symbolic bits in the symbolic lanes in state.

Parameters:
foutThe stream to which the equations are sent.
stateThe symbolic input state (right hand side of equations).
prefixOutputThe prefix of the variables.
forSageA Boolean value telling whether the syntax of Sage should be followed.
void KeccakFEquations::genRoundEquations ( ostream &  fout,
bool  forSage = false 
) const

Method that generate equations for the rounds of the chosen Keccak-f instance. The variables starting with letter A are the input of round #0. The B's are the output of round #0 and the input of round #1. The C's are the output of round #1 and the input of round #2, etc.

Parameters:
foutThe stream to which the equations are sent.
forSageA Boolean value telling whether the syntax of Sage should be followed.
void KeccakFEquations::initializeState ( vector< SymbolicLane > &  state,
const string &  prefix,
unsigned int  laneSize 
) [static]

Method that initializes the symbolic bits of a symbolic state with variables using the given prefix.

Parameters:
stateThe symbolic state to initialize.
prefixThe prefix of the variables.
laneSizeThe number of bits per lane.
void KeccakFEquations::initializeState ( vector< SymbolicLane > &  state,
const string &  prefix 
) const [protected]

Internal method that initializes the symbolic bits of a symbolic state with variables using the given prefix.

Parameters:
stateThe symbolic state to initialize.
prefixThe prefix of the variables.

The documentation for this class was generated from the following files: