KeccakTools

main.cpp File Reference

#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string.h>
#include "duplex.h"
#include "Keccak.h"
#include "KeccakCrunchyContest.h"
#include "Keccak-f25LUT.h"
#include "Keccak-fCodeGen.h"
#include "Keccak-fDCEquations.h"
#include "Keccak-fDCLC.h"
#include "Keccak-fEquations.h"
#include "Keccak-fPropagation.h"
#include "Keccak-fTrailExtension.h"
#include "Keccak-fTrails.h"
Include dependency graph for main.cpp:

Functions

void testKeccakF ()
void display (const UINT8 *data, unsigned int length)
void testKeccakSponge (const char *message, unsigned int length)
void testKeccakSponge ()
void testKeccakDuplex ()
void generateEquations ()
void generateCode ()
void testKeccakF25LUT ()
void genKATShortMsg_main ()
void testKeccakFDCLC ()
void displayTrails ()
void extendTrailAtTheEnd ()
void extendTrailAtTheBeginning ()
void generateDCTrailEquations ()
void generateTrailFromDinurDunkelmanShamirCollision ()
void extendTrails (KeccakFPropagation::DCorLC DCLC, unsigned int width, const string &inFileName, unsigned int nrRounds, int maxWeight, bool reverse, bool allPrefixes=false, const string &knownSmallWeightStateFileName="", int maxSmallWeight=0)
void extendTrails ()
int main (int argc, char *argv[])

Function Documentation

void display ( const UINT8 data,
unsigned int  length 
)
void displayTrails ( )

Example function that produces the text files in Example trails.

void extendTrailAtTheBeginning ( )

Example function that extends a trail backward.

void extendTrailAtTheEnd ( )

Example function that uses the affine base representation to extend a trail forward.

void extendTrails ( KeccakFPropagation::DCorLC  DCLC,
unsigned int  width,
const string &  inFileName,
unsigned int  nrRounds,
int  maxWeight,
bool  reverse,
bool  allPrefixes = false,
const string &  knownSmallWeightStateFileName = "",
int  maxSmallWeight = 0 
)

Example function that takes trails from a file and extends them forward or backward up to a given weight and given number of rounds.

Parameters:
DCLCWhether linear or differential trails are processed.
widthThe Keccak-f width.
inFileNameThe name of the file containing trails.
nrRoundsThe target number of rounds.
maxWeightThe maximum weight of the trails to be produced.
reverseIf true, it does backward extension. If false, it does forward extension.
allPrefixesIf true, the backward extension of trail cores looks for all prefixes, not just trail cores.
knownSmallWeightStateFileNameOptionally, the name of the file containing states with small weight to optimize the search. See also KeccakFTrailExtension::knownSmallWeightStates.
maxSmallWeightUp to which weight the small-weight state file is complete.
void extendTrails ( )

Example function that uses extendTrails().

void generateCode ( )

Example function that generate C code to implement Keccak-f[1600].

void generateDCTrailEquations ( )

Example function that generates equations in GF(2) for a pair to follow a given differential trail.

void generateEquations ( )

Example function that generates the round equations for Keccak-f[25] to Keccak-f[1600].

void generateTrailFromDinurDunkelmanShamirCollision ( )

Example function that generates a trail from a pair of inputs. In this example, we use the messages found by I. Dinur, O. Dunkelman and A. Shamir to produce a collision on Keccak[r=1088, c=512] reduced to 4 rounds.

void genKATShortMsg_main ( )
int main ( int  argc,
char *  argv[] 
)
void testKeccakDuplex ( )

Example function that uses the Keccak[r=1026, c=574] duplex object.

void testKeccakF ( )

Example function that uses the Keccak-f[1600] permutation and its inverse.

void testKeccakF25LUT ( )

Example function that uses the Keccak-f[25] look-up tables.

void testKeccakFDCLC ( )

Example function that displays DC/LC propagation on rows.

void testKeccakSponge ( const char *  message,
unsigned int  length 
)

Example function that uses the Keccak[] sponge function.

void testKeccakSponge ( )

Example function that uses the Keccak[] sponge function.