Sharkysoft home
Class DesSBoxes


public final class DesSBoxes
extends java.lang.Object

DES S boxes.

Details: This class contains the FIPS values for DES's S boxes, defined in FIPS PUB 46-2 as the primitive functions S0, S1, S2, ..., S8.


Field Summary
static int COL_COUNT
          Columns per S box row.
static int ROW_COUNT
          Rows per S box.
static int SBOX_COUNT
          Number of S boxes.
Method Summary
static int getFipsValue(int s, int row, int col)
          Returns FIPS S box value.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final int SBOX_COUNT
Number of S boxes.

Details: This is the number of S boxes defined in the specification and represented in this class: 8.


public static final int ROW_COUNT
Rows per S box.

Details: This is the number of rows per S box: 4.


public static final int COL_COUNT
Columns per S box row.

Details: This is the number of columns per S box row: 16.

Method Detail


public static final int getFipsValue(int s,
                                     int row,
                                     int col)
Returns FIPS S box value.

Details: This method returns the FIPS value from the given column of the given row of the given S box. This method uses the indexing convention as the spec.

s - the S box index (1-8)
row - the row index (0-3)
the - column index (0-15)

Sharkysoft home