|
KeccakTools
|


Typedefs | |
| typedef unsigned char | RowValue |
| typedef unsigned char | ColumnValue |
| typedef UINT32 | SliceValue |
| typedef unsigned int | LaneIndex |
Functions | |
| LaneIndex | getLaneIndex (unsigned int x, unsigned int y) |
| LaneIndex | getLaneIndexSafely (int x, int y) |
| int | getBit (const vector< SliceValue > &slices, unsigned int x, unsigned int y, unsigned int z) |
| int | getBit (const vector< SliceValue > &slices, const BitPosition &p) |
| void | setBitToZero (vector< SliceValue > &slices, unsigned int x, unsigned int y, unsigned int z) |
| void | setBitToZero (vector< SliceValue > &slices, const BitPosition &p) |
| void | setBitToOne (vector< SliceValue > &slices, unsigned int x, unsigned int y, unsigned int z) |
| void | setBitToOne (vector< SliceValue > &slices, const BitPosition &p) |
| void | invertBit (vector< SliceValue > &slices, unsigned int x, unsigned int y, unsigned int z) |
| void | invertBit (vector< SliceValue > &slices, const BitPosition &p) |
| SliceValue | getSliceFromRow (const RowValue &row, const unsigned int &y) |
| RowValue | getRowFromSlice (const SliceValue &slice, const unsigned int &y) |
| int | getBit (const vector< RowValue > &rows, unsigned int x, unsigned int z) |
| void | setBitToZero (vector< RowValue > &rows, unsigned int x, unsigned int z) |
| void | setBitToOne (vector< RowValue > &rows, unsigned int x, unsigned int z) |
| RowValue | getRow (const vector< SliceValue > &slices, unsigned int y=0, unsigned int z=0) |
| RowValue | getRow (const vector< SliceValue > &slices, const RowPosition &p) |
| void | setRow (vector< SliceValue > &slices, RowValue row, unsigned int y=0, unsigned int z=0) |
| void | setRow (vector< SliceValue > &slices, RowValue row, const RowPosition &p) |
| SliceValue | getSliceValue (RowValue row0, RowValue row1, RowValue row2, RowValue row3, RowValue row4) |
| ColumnValue | getColumn (const vector< SliceValue > &slices, unsigned int x=0, unsigned int z=0) |
| void | setColumn (vector< SliceValue > &slices, ColumnValue column, unsigned int x=0, unsigned int z=0) |
| void | invertColumn (vector< SliceValue > &slices, unsigned int x=0, unsigned int z=0) |
| RowValue | translateRow (const RowValue &row, const unsigned int &dx) |
| RowValue | translateRowSafely (RowValue row, int dx) |
| SliceValue | translateSlice (SliceValue slice, unsigned int dx, unsigned int dy) |
| SliceValue | translateSliceSafely (SliceValue slice, int dx, int dy) |
| void | translateStateAlongZ (vector< SliceValue > &state, unsigned int dz) |
| RowValue | getRow (const vector< LaneValue > &lanes, unsigned int y=0, unsigned int z=0) |
| void | setRow (vector< LaneValue > &lanes, RowValue row, unsigned int y=0, unsigned int z=0) |
| SliceValue | getSlice (const vector< LaneValue > &lanes, unsigned int z=0) |
| void | setSlice (vector< LaneValue > &lanes, SliceValue slice, unsigned int z=0) |
| void | fromLanesToSlices (const vector< LaneValue > &lanes, vector< SliceValue > &slices, unsigned int laneSize) |
| void | fromSlicesToLanes (const vector< SliceValue > &slices, vector< LaneValue > &lanes) |
| unsigned int | getHammingWeightRow (RowValue row) |
| unsigned int | getHammingWeightColumn (ColumnValue column) |
| unsigned int | getHammingWeightSlice (SliceValue slice) |
| unsigned int | getHammingWeight (const vector< SliceValue > &state) |
| unsigned int | getHammingWeightLane (LaneValue lane) |
| unsigned int | getHammingWeight (const vector< LaneValue > &state) |
| unsigned int | getNrActiveRows (const SliceValue &slice) |
| unsigned int | getNrActiveRows (const vector< SliceValue > &slices) |
| unsigned int | getNrActiveRows (const vector< LaneValue > &lanes) |
Variables | |
| const int | nrRowsAndColumns = 5 |
| const SliceValue | maxSliceValue = 0x1FFFFFF |
| typedef unsigned char ColumnValue |
The ColumnsValue type is one byte, containing the 5 bits of a column, in the least significant bits of the byte.
| typedef unsigned int LaneIndex |
The LaneIndex type codes the x and y coordinates as the single integer x + 5y.
| typedef unsigned char RowValue |
The RowValue type is one byte, containing the 5 bits of a row, in the least significant bits of the byte.
| typedef UINT32 SliceValue |
The SliceValue type is one 32-bit word, containing the 5 rows of a slice, each located in 5 bits of this word. The row y is in the bits corresponding to numerical value (0-31)*32^y in the word. See getSliceFromRow() and getRowFromSlice() for more details.
| void fromLanesToSlices | ( | const vector< LaneValue > & | lanes, |
| vector< SliceValue > & | slices, | ||
| unsigned int | laneSize | ||
| ) |
This method creates the value of a state represented as a vector of slices from a state represented as a vector of lanes.
| slices | The destination for the slices. |
| lanes | The state as a vector of lanes. |
| laneSize | The lane size, which is also the number of slices. |
| void fromSlicesToLanes | ( | const vector< SliceValue > & | slices, |
| vector< LaneValue > & | lanes | ||
| ) |
This method creates the value of a state represented as a vector of lanes from a state represented as a vector of slices.
| lanes | The destination for the lanes. |
| slices | The state as a vector of slices. |
| int getBit | ( | const vector< SliceValue > & | slices, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | z | ||
| ) | [inline] |
This method returns the value of a given bit in a state.
| slices | The state as a vector of slices. |
| x | The x coordinate. |
| y | The y coordinate. |
| z | The z coordinate. |
| int getBit | ( | const vector< SliceValue > & | slices, |
| const BitPosition & | p | ||
| ) | [inline] |
This method returns the value of a given bit in a state.
| slices | The state as a vector of slices. |
| p | The x, y, z coordinates. |
| int getBit | ( | const vector< RowValue > & | rows, |
| unsigned int | x, | ||
| unsigned int | z | ||
| ) | [inline] |
This method returns the value of a given bit in a plane.
| slices | The state as a vector of rows. |
| x | The x coordinate. |
| z | The z coordinate. |
| ColumnValue getColumn | ( | const vector< SliceValue > & | slices, |
| unsigned int | x = 0, |
||
| unsigned int | z = 0 |
||
| ) |
This method returns the value of a given column in a slice.
| slices | The state as a vector of slices. |
| x | The x coordinate. |
| z | The z coordinate. |
| unsigned int getHammingWeight | ( | const vector< SliceValue > & | state | ) |
This function returns the Hamming weight of the given state.
| unsigned int getHammingWeight | ( | const vector< LaneValue > & | state | ) |
This function returns the Hamming weight of the given state.
| unsigned int getHammingWeightColumn | ( | ColumnValue | column | ) |
This function returns the Hamming weight of the given column value.
| unsigned int getHammingWeightLane | ( | LaneValue | lane | ) |
This function returns the Hamming weight of the given lane.
| unsigned int getHammingWeightRow | ( | RowValue | row | ) |
This function returns the Hamming weight of the given row value.
| unsigned int getHammingWeightSlice | ( | SliceValue | slice | ) |
This function returns the Hamming weight of the given slice value.
| LaneIndex getLaneIndex | ( | unsigned int | x, |
| unsigned int | y | ||
| ) | [inline] |
This method returns the lane index from (x,y) coordinates.
| x | The x coordinate, with 0 ≤ x < 5. |
| y | The y coordinate, with 0 ≤ y < 5. |
| LaneIndex getLaneIndexSafely | ( | int | x, |
| int | y | ||
| ) |
This method returns the lane index from (x,y) coordinates.
| x | The x coordinate, which can be any signed integer (reduced modulo 5). |
| y | The y coordinate, which can be any signed integer (reduced modulo 5). |
| unsigned int getNrActiveRows | ( | const vector< LaneValue > & | lanes | ) |
This method returns the number of active rows in the state given as lanes.
| unsigned int getNrActiveRows | ( | const SliceValue & | slice | ) |
This method returns the number of active rows in the given slice value.
| unsigned int getNrActiveRows | ( | const vector< SliceValue > & | slices | ) |
This method returns the number of active rows in the state given as slices.
| RowValue getRow | ( | const vector< SliceValue > & | slices, |
| unsigned int | y = 0, |
||
| unsigned int | z = 0 |
||
| ) |
This method returns the value of a given row in a slice.
| slices | The state as a vector of slices. |
| y | The y coordinate. |
| z | The z coordinate. |
| RowValue getRow | ( | const vector< SliceValue > & | slices, |
| const RowPosition & | p | ||
| ) | [inline] |
This method returns the value of a given row in a slice.
| slices | The state as a vector of slices. |
| p | The y, z coordinates. |
This method returns the value of a given row in a slice.
| lanes | The state as a vector of lanes. |
| y | The y coordinate. |
| z | The z coordinate. |
| RowValue getRowFromSlice | ( | const SliceValue & | slice, |
| const unsigned int & | y | ||
| ) | [inline] |
This function returns the row value at row y in the given slice value.
| SliceValue getSlice | ( | const vector< LaneValue > & | lanes, |
| unsigned int | z = 0 |
||
| ) |
This method returns the value of a given slice in a state represented as a vector of lanes.
| lanes | The state as a vector of lanes. |
| z | The slice index (z coordinate). |
| SliceValue getSliceFromRow | ( | const RowValue & | row, |
| const unsigned int & | y | ||
| ) | [inline] |
This function returns a SliceValue with bits set to zero, except at row y, where the value is given by the argument row.
| SliceValue getSliceValue | ( | RowValue | row0, |
| RowValue | row1, | ||
| RowValue | row2, | ||
| RowValue | row3, | ||
| RowValue | row4 | ||
| ) |
This method constructs a slice value from 5 row values.
| void invertBit | ( | vector< SliceValue > & | slices, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | z | ||
| ) | [inline] |
This method inverts a particular bit in a state.
| slices | The state as a vector of slices. |
| x | The x coordinate. |
| y | The y coordinate. |
| z | The z coordinate. |
| void invertBit | ( | vector< SliceValue > & | slices, |
| const BitPosition & | p | ||
| ) | [inline] |
This method inverts a particular bit in a state.
| slices | The state as a vector of slices. |
| p | The x, y, z coordinates. |
| void invertColumn | ( | vector< SliceValue > & | slices, |
| unsigned int | x = 0, |
||
| unsigned int | z = 0 |
||
| ) |
This method complements all the bits of a particular column in a vector of slices.
| slices | The state as a vector of slices. |
| x | The x coordinate. |
| z | The z coordinate. |
| void setBitToOne | ( | vector< SliceValue > & | slices, |
| const BitPosition & | p | ||
| ) | [inline] |
This method sets to 1 a particular bit in a state.
| slices | The state as a vector of slices. |
| p | The x, y, z coordinates. |
| void setBitToOne | ( | vector< SliceValue > & | slices, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | z | ||
| ) | [inline] |
This method sets to 1 a particular bit in a state.
| slices | The state as a vector of slices. |
| x | The x coordinate. |
| y | The y coordinate. |
| z | The z coordinate. |
| void setBitToOne | ( | vector< RowValue > & | rows, |
| unsigned int | x, | ||
| unsigned int | z | ||
| ) | [inline] |
This method sets to 1 a particular bit in a plane.
| slices | The state as a vector of rows. |
| x | The x coordinate. |
| z | The z coordinate. |
| void setBitToZero | ( | vector< RowValue > & | rows, |
| unsigned int | x, | ||
| unsigned int | z | ||
| ) | [inline] |
This method sets to 0 a particular bit in a plane.
| slices | The state as a vector of rows. |
| x | The x coordinate. |
| z | The z coordinate. |
| void setBitToZero | ( | vector< SliceValue > & | slices, |
| const BitPosition & | p | ||
| ) | [inline] |
This method sets to 0 a particular bit in a state.
| slices | The state as a vector of slices. |
| p | The x, y, z coordinates. |
| void setBitToZero | ( | vector< SliceValue > & | slices, |
| unsigned int | x, | ||
| unsigned int | y, | ||
| unsigned int | z | ||
| ) | [inline] |
This method sets to 0 a particular bit in a state.
| slices | The state as a vector of slices. |
| x | The x coordinate. |
| y | The y coordinate. |
| z | The z coordinate. |
| void setColumn | ( | vector< SliceValue > & | slices, |
| ColumnValue | column, | ||
| unsigned int | x = 0, |
||
| unsigned int | z = 0 |
||
| ) |
This method sets the value of a particular column in a vector of slices.
| slices | The state as a vector of slices. |
| column | The row value. |
| x | The x coordinate. |
| z | The z coordinate. |
This method sets the value of a particular row in a vector of lanes.
| lanes | The state as a vector of lanes. |
| row | The row value. |
| y | The y coordinate. |
| z | The z coordinate. |
| void setRow | ( | vector< SliceValue > & | slices, |
| RowValue | row, | ||
| const RowPosition & | p | ||
| ) | [inline] |
This method sets the value of a particular row in a vector of slices.
| slices | The state as a vector of slices. |
| row | The row value. |
| p | The y, z coordinates. |
| void setRow | ( | vector< SliceValue > & | slices, |
| RowValue | row, | ||
| unsigned int | y = 0, |
||
| unsigned int | z = 0 |
||
| ) |
This method sets the value of a particular row in a vector of slices.
| slices | The state as a vector of slices. |
| row | The row value. |
| y | The y coordinate. |
| z | The z coordinate. |
| void setSlice | ( | vector< LaneValue > & | lanes, |
| SliceValue | slice, | ||
| unsigned int | z = 0 |
||
| ) |
This method sets the value of a particular slice in a vector of lanes.
| lanes | The state as a vector of lanes. |
| slice | The slice value. |
| z | The z coordinate. |
This function translates a row value along the X axis and returns the translated value. Note that 0 <= dx < 5 is required.
Same as translateRow, but any (negative and positive) value of dx is allowed.
| SliceValue translateSlice | ( | SliceValue | slice, |
| unsigned int | dx, | ||
| unsigned int | dy | ||
| ) |
This function translates a slice value along the X and Y axes and returns the translated value. Note that 0 <= dx < 5 and 0 <= dy < 5 are required.
| SliceValue translateSliceSafely | ( | SliceValue | slice, |
| int | dx, | ||
| int | dy | ||
| ) |
Same as translateSlice(), but any (negative and positive) value of dx and dy is allowed.
| void translateStateAlongZ | ( | vector< SliceValue > & | state, |
| unsigned int | dz | ||
| ) |
This function translates the state along the Z axis.
| const SliceValue maxSliceValue = 0x1FFFFFF |
This constant indicates the maximum value if one needs to loop through all the possible slice values.
| const int nrRowsAndColumns = 5 |
The number of rows and columns in Keccak-f.