Trail Class Reference

#include <Keccak-fTrails.h>

List of all members.

Public Member Functions

 Trail ()
 Trail (istream &fin)
 Trail (const Trail &other)
void append (const vector< SliceValue > &state, unsigned int weight)
void append (const Trail &otherTrail)
void prepend (const vector< SliceValue > &state, unsigned int weight)
void display (const KeccakFPropagation &DCorLC, ostream &fout) const
void load (istream &fin)
void save (ostream &fout) const

Static Public Member Functions

static UINT64 produceHumanReadableFile (const KeccakFPropagation &DCorLC, const string &fileName, bool verbose=true, unsigned int maxWeight=0)

Public Attributes

vector< vector< SliceValue > > states
vector< unsigned int > weights
unsigned int totalWeight


Detailed Description

This class implements a container for a differential or linear trail. A trail makes sense only in the context of a KeccakFPropagation object. The main attribute of the class is the sequence of state values before χ. If Si = states[i], the trail is: S0 χλ S1 χλ S2 χλ ... χλ Sn-1, with n = states.size().

Constructor & Destructor Documentation

Trail::Trail (  ) 

This constructor creates an empty trail.

Trail::Trail ( istream &  fin  ) 

This constructor loads a trail from an input stream.

Parameters:
fin The input stream to read the trail from.

Trail::Trail ( const Trail other  )  [inline]

This constructor initializes a trail by copying the trail given in parameter.

Parameters:
other The original trail to copy.


Member Function Documentation

void Trail::append ( const vector< SliceValue > &  state,
unsigned int  weight 
)

This method appends a state to the end of states, with its corresponding propagation weight.

Parameters:
state The state to add.
weight The propagation weight.

void Trail::append ( const Trail otherTrail  ) 

This method appends another trail to the current trail.

Parameters:
otherTrail The trail to append.

void Trail::prepend ( const vector< SliceValue > &  state,
unsigned int  weight 
)

This method inserts a state at the beginning of states, with its corresponding propagation weight.

Parameters:
state The state to add.
weight The propagation weight.

void Trail::display ( const KeccakFPropagation DCorLC,
ostream &  fout 
) const

This method displays the trail for in a human-readable form.

Parameters:
DCorLC The propagation context of the trail, as a reference to a KeccakFPropagation object.
fout The stream to display to.

void Trail::load ( istream &  fin  ) 

This methods loads the trail from a stream (e.g., file).

Parameters:
fin The input stream to read the trail from.

void Trail::save ( ostream &  fout  )  const

This methods outputs the trail to save it in, e.g., a file.

Parameters:
fout The stream to save the trail to.

UINT64 Trail::produceHumanReadableFile ( const KeccakFPropagation DCorLC,
const string &  fileName,
bool  verbose = true,
unsigned int  maxWeight = 0 
) [static]

This function reads all the trails in a file, checks their consistency and then produces a report. The report is output in a file with the same file name plus ".txt". See also KeccakFPropagation::displayTrailsAndCheck().

Parameters:
DCorLC The propagation context of the trails, as a reference to a KeccakFPropagation object.
fileName The name of the file containing the trails.
verbose If true, the function will display the name of the file written to cout.
maxWeight As in KeccakFPropagation::displayTrailsAndCheck().
Returns:
The number of trails read and checked.


Member Data Documentation

vector<vector<SliceValue> > Trail::states

This attribute contains the list of states round after round, before χ.

vector<unsigned int> Trail::weights

This attribute contains the propagation weights of the states in states. So, weights has the same size as states.

unsigned int Trail::totalWeight

This attribute contains the sum of the weights[i].


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

Generated on Thu Jun 17 18:20:51 2010 for KeccakTools by  doxygen 1.5.6