KeccakTools

AffineSpaceOfSlices Class Reference

#include <Keccak-fAffineBases.h>

List of all members.

Public Member Functions

 AffineSpaceOfSlices (vector< SliceValue > &aGenerators, vector< RowValue > &aGeneratorParities, SliceValue aOffset, RowValue aOffsetParity)
bool getOffsetWithGivenParity (RowValue parity, SliceValue &output) const
void display (ostream &fout) const

Public Attributes

vector< SliceValueoriginalGenerators
vector< SliceValuekernelGenerators
vector< SliceValueoffsetGenerators
vector< RowValueoffsetParities
SliceValue offset
RowValue offsetParity

Detailed Description

This class expresses an affine space of slice values. The members of the affine space are determined by the offset plus any linear combination of the generators.

The parity of a slice is the sum of all its rows. In order to easily generate all the slice values with a given parity, the generators are grouped in two sets.

  • The parity-kernel generators (in kernelGenerators) are the generators with parity zero.
  • The parity-offset generators (in offsetGenerators) are the generators with non-zero parity.

The generators in offsetGenerators have linearly independent parities. Hence, to generate all the slice values with a given requested parity, one has to

  • first, take the parity of the slice offset
  • then, combine it with some parity-offset generators to obtain the requested parity (if possible); when possible, this is uniquely determined thanks to the linear independence
  • finally, combine it with the vector space of parity-kernel generators (which will not alter the parity)

Constructor & Destructor Documentation

AffineSpaceOfSlices::AffineSpaceOfSlices ( vector< SliceValue > &  aGenerators,
vector< RowValue > &  aGeneratorParities,
SliceValue  aOffset,
RowValue  aOffsetParity 
)

Constructor of AffineSpaceOfSlices. Warning: the passed vectors aGenerators and aGeneratorParities are modified.


Member Function Documentation

void AffineSpaceOfSlices::display ( ostream &  fout) const

This method displays information about the object.

bool AffineSpaceOfSlices::getOffsetWithGivenParity ( RowValue  parity,
SliceValue output 
) const

This method returns an offset slice (in argument output) with a given parity pattern. If such a pattern could not be built, false is returned.


Member Data Documentation

The set of parity-kernel generators of the affine space. This generates a subspace with all-zero parity pattern.

The offset of the affine space.

The set of parity-offset generators of the affine space. This can be used to generate an offset for each of the parity patterns. The parity-offset generators are organized such that their parity makes an upper-triangular matrix. In other words, whenever a generator has parity bit #n at 1 and parity bits #m<n at 0, the next generators necessarily have parity bits #m<=n at 0.

This vector contains the parities of offsetGenerators, i.e., offsetParities[i] contains the parity of offsetGenerators[i].

The parity of the offset of the affine space.

The set of generators, before separation into parity-kernel and parity-offset sets.


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