KeccakTools

KeccakFDCEquations Class Reference

#include <Keccak-fDCEquations.h>

Inheritance diagram for KeccakFDCEquations:
Collaboration diagram for KeccakFDCEquations:

List of all members.

Public Member Functions

 KeccakFDCEquations (unsigned int aWidth)
void buildDCTrailFromPair (vector< SliceValue > &a1, vector< SliceValue > &a2, Trail &trail) const
void genDCEquations (ostream &fout, const Trail &trail, bool forSage=false) const

Protected Member Functions

void getDCEquations (const vector< SliceValue > &diffIn, const vector< SliceValue > &diffOut, const vector< SymbolicLane > &input, vector< SymbolicBit > &inputRelations) const
void getDCEquations (RowValue diffIn, RowValue diffOut, const vector< SymbolicBit > &inputVariables, vector< SymbolicBit > &inputRelations) const
void displayEquations (ostream &fout, const vector< SymbolicLane > &state, const string &prefixOutput, bool forSage=false) const

Detailed Description

This class is an extension of KeccakFDCLC with additional functionality to display equations related to a differential trail.


Constructor & Destructor Documentation

KeccakFDCEquations::KeccakFDCEquations ( unsigned int  aWidth)

This constructor initializes the Keccak-f instance with the given width, see KeccakF::KeccakF().


Member Function Documentation

void KeccakFDCEquations::buildDCTrailFromPair ( vector< SliceValue > &  a1,
vector< SliceValue > &  a2,
Trail trail 
) const

This method produces a differential trail from a pair of inputs. The state values are given before θ, as in the normal order of the round function.

Parameters:
a1The first state of the pair, as a vector of slices.
a2The second state of the pair, as a vector of slices.
trailThe output trail.
See also:
KeccakFEquations::genAbsoluteValuesBeforeChi()
void KeccakFDCEquations::displayEquations ( ostream &  fout,
const vector< SymbolicLane > &  state,
const string &  prefixOutput,
bool  forSage = false 
) const [protected]

This method produces the display of the equations.

void KeccakFDCEquations::genDCEquations ( ostream &  fout,
const Trail trail,
bool  forSage = false 
) const

This method displays the equations from round to round that a pair has to satisfy to follow the given trail.

Note:
Note that for row patterns 11111, 5 equations are generated, although the fifth is redundant with the 4 first.
Parameters:
foutThe stream to display to.
trailThe trail to follow.
forSageIf true, the equations are displayed in a format suitable for SAGE. In this case, the equations form a comma-separated list of polynomials that must be equal to zero. Otherwise, the equations are displayed in the form X=f(Y).
void KeccakFDCEquations::getDCEquations ( const vector< SliceValue > &  diffIn,
const vector< SliceValue > &  diffOut,
const vector< SymbolicLane > &  input,
vector< SymbolicBit > &  inputRelations 
) const [protected]

This method creates the list of equations that the input of χ must satisfy for the given input difference to propagate to the given output difference.

void KeccakFDCEquations::getDCEquations ( RowValue  diffIn,
RowValue  diffOut,
const vector< SymbolicBit > &  inputVariables,
vector< SymbolicBit > &  inputRelations 
) const [protected]

This method creates the list of equations that the input of χ (for one row) must satisfy for the given input difference to propagate to the given output difference.


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