|
KeccakTools
|
#include <Keccak-fAffineBases.h>
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< SliceValue > | originalGenerators |
| vector< SliceValue > | kernelGenerators |
| vector< SliceValue > | offsetGenerators |
| vector< RowValue > | offsetParities |
| SliceValue | offset |
| RowValue | offsetParity |
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 generators in offsetGenerators have linearly independent parities. Hence, to generate all the slice values with a given requested parity, one has to
| AffineSpaceOfSlices::AffineSpaceOfSlices | ( | vector< SliceValue > & | aGenerators, |
| vector< RowValue > & | aGeneratorParities, | ||
| SliceValue | aOffset, | ||
| RowValue | aOffsetParity | ||
| ) |
Constructor of AffineSpaceOfSlices. Warning: the passed vectors aGenerators and aGeneratorParities are modified.
| 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.
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.