| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private boolean | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int[] | |
| private int[] | |
| private int[] | |
| private int[] | |
| private int[] | |
| private int[] | gSubKeys
gSubKeys[] and gSBox[] are eventually used in the encryption and decryption methods. |
| private static final int | |
| private int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final byte[][] | |
| private static final int | P_00
Define the fixed p0/p1 permutations used in keyed S-box lookup. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| private int | |
| private int | |
| private int | |
| private void | decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. |
| private void | encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. |
| private int | |
| private int | |
| private int | |
| public String | getAlgorithmName()
Implements org. Return the name of the algorithm the cipher implements. |
| public int | getBlockSize()
Implements org. Return the block size for this cipher (in bytes). |
| public void | init(boolean
whether or not we are for encryption. encrypting, CipherParameters the parameters required to set up the cipher. params)Implements org. initialise a Twofish cipher. |
| private int | |
| private int | |
| private int | |
| private int | |
| public int | processBlock(byte[]
the array containing the input data. in, int offset into the in array the data starts at. inOff, byte[] the array the output data will be copied into. out, int the offset into the out array the output will start at. outOff)Implements org. Process one block of input from the array in and write it to the out array. |
| public void | |
| private int | Returns: Remainder polynomial generated using RS codefirst 32-bit entity k0, int second 32-bit entity k1)Use (12, 8) Reed-Solomon code over GF(256) to produce a key S-box 32-bit entity from 2 key material 32-bit entities. |
| private int | RS_rem(int x)
Reed-Solomon code parameters: (12,8) reversible code:
g(x) = x^4 + (a+1/a)x^3 + ax^2 + (a+1/a)x + 1 |
| private void |
| BLOCK_SIZE | back to summary |
|---|---|
| private static final int BLOCK_SIZE | |
| encrypting | back to summary |
|---|---|
| private boolean encrypting | |
| GF256_FDBK | back to summary |
|---|---|
| private static final int GF256_FDBK | |
| GF256_FDBK_2 | back to summary |
|---|---|
| private static final int GF256_FDBK_2 | |
| GF256_FDBK_4 | back to summary |
|---|---|
| private static final int GF256_FDBK_4 | |
| gMDS0 | back to summary |
|---|---|
| private int[] gMDS0 | |
| gMDS1 | back to summary |
|---|---|
| private int[] gMDS1 | |
| gMDS2 | back to summary |
|---|---|
| private int[] gMDS2 | |
| gMDS3 | back to summary |
|---|---|
| private int[] gMDS3 | |
| gSBox | back to summary |
|---|---|
| private int[] gSBox | |
| gSubKeys | back to summary |
|---|---|
| private int[] gSubKeys gSubKeys[] and gSBox[] are eventually used in the encryption and decryption methods. | |
| INPUT_WHITEN | back to summary |
|---|---|
| private static final int INPUT_WHITEN | |
| k64Cnt | back to summary |
|---|---|
| private int k64Cnt | |
| MAX_KEY_BITS | back to summary |
|---|---|
| private static final int MAX_KEY_BITS | |
| MAX_ROUNDS | back to summary |
|---|---|
| private static final int MAX_ROUNDS | |
| OUTPUT_WHITEN | back to summary |
|---|---|
| private static final int OUTPUT_WHITEN | |
| P | back to summary |
|---|---|
| private static final byte[][] P | |
| P_00 | back to summary |
|---|---|
| private static final int P_00 Define the fixed p0/p1 permutations used in keyed S-box lookup. By changing the following constant definitions, the S-boxes will automatically get changed in the Twofish engine. | |
| P_01 | back to summary |
|---|---|
| private static final int P_01 | |
| P_02 | back to summary |
|---|---|
| private static final int P_02 | |
| P_03 | back to summary |
|---|---|
| private static final int P_03 | |
| P_04 | back to summary |
|---|---|
| private static final int P_04 | |
| P_10 | back to summary |
|---|---|
| private static final int P_10 | |
| P_11 | back to summary |
|---|---|
| private static final int P_11 | |
| P_12 | back to summary |
|---|---|
| private static final int P_12 | |
| P_13 | back to summary |
|---|---|
| private static final int P_13 | |
| P_14 | back to summary |
|---|---|
| private static final int P_14 | |
| P_20 | back to summary |
|---|---|
| private static final int P_20 | |
| P_21 | back to summary |
|---|---|
| private static final int P_21 | |
| P_22 | back to summary |
|---|---|
| private static final int P_22 | |
| P_23 | back to summary |
|---|---|
| private static final int P_23 | |
| P_24 | back to summary |
|---|---|
| private static final int P_24 | |
| P_30 | back to summary |
|---|---|
| private static final int P_30 | |
| P_31 | back to summary |
|---|---|
| private static final int P_31 | |
| P_32 | back to summary |
|---|---|
| private static final int P_32 | |
| P_33 | back to summary |
|---|---|
| private static final int P_33 | |
| P_34 | back to summary |
|---|---|
| private static final int P_34 | |
| ROUND_SUBKEYS | back to summary |
|---|---|
| private static final int ROUND_SUBKEYS | |
| ROUNDS | back to summary |
|---|---|
| private static final int ROUNDS | |
| RS_GF_FDBK | back to summary |
|---|---|
| private static final int RS_GF_FDBK | |
| SK_BUMP | back to summary |
|---|---|
| private static final int SK_BUMP | |
| SK_ROTL | back to summary |
|---|---|
| private static final int SK_ROTL | |
| SK_STEP | back to summary |
|---|---|
| private static final int SK_STEP | |
| TOTAL_SUBKEYS | back to summary |
|---|---|
| private static final int TOTAL_SUBKEYS | |
| workingKey | back to summary |
|---|---|
| private byte[] workingKey | |
| TwofishEngine | back to summary |
|---|---|
| public TwofishEngine() | |
| b0 | back to summary |
|---|---|
| private int b0(int x) | |
| b1 | back to summary |
|---|---|
| private int b1(int x) | |
| b2 | back to summary |
|---|---|
| private int b2(int x) | |
| b3 | back to summary |
|---|---|
| private int b3(int x) | |
| decryptBlock | back to summary |
|---|---|
| private void decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex) Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. The input will be an exact multiple of our blocksize. | |
| encryptBlock | back to summary |
|---|---|
| private void encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex) Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. The input will be an exact multiple of our blocksize. encryptBlock uses the pre-calculated gSBox[] and subKey[] arrays. | |
| F32 | back to summary |
|---|---|
| private int F32(int x, int[] k32) | |
| Fe32_0 | back to summary |
|---|---|
| private int Fe32_0(int x) | |
| Fe32_3 | back to summary |
|---|---|
| private int Fe32_3(int x) | |
| getAlgorithmName | back to summary |
|---|---|
| public String getAlgorithmName() Implements org. Doc from org. Return the name of the algorithm the cipher implements.
| |
| getBlockSize | back to summary |
|---|---|
| public int getBlockSize() Implements org. Doc from org. Return the block size for this cipher (in bytes).
| |
| init | back to summary |
|---|---|
| public void init(boolean encrypting, CipherParameters params) Implements org. initialise a Twofish cipher.
| |
| LFSR1 | back to summary |
|---|---|
| private int LFSR1(int x) | |
| LFSR2 | back to summary |
|---|---|
| private int LFSR2(int x) | |
| Mx_X | back to summary |
|---|---|
| private int Mx_X(int x) | |
| Mx_Y | back to summary |
|---|---|
| private int Mx_Y(int x) | |
| processBlock | back to summary |
|---|---|
| public int processBlock(byte[] in, int inOff, byte[] out, int outOff) Implements org. Doc from org. Process one block of input from the array in and write it to the out array.
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Doc from org. Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one). | |
| RS_MDS_Encode | back to summary |
|---|---|
| private int RS_MDS_Encode(int k0, int k1) Use (12, 8) Reed-Solomon code over GF(256) to produce a key S-box 32-bit entity from 2 key material 32-bit entities.
| |
| RS_rem | back to summary |
|---|---|
| private int RS_rem(int x) Reed-Solomon code parameters: (12,8) reversible code:
g(x) = x^4 + (a+1/a)x^3 + ax^2 + (a+1/a)x + 1where a = primitive root of field generator 0x14D | |
| setKey | back to summary |
|---|---|
| private void setKey(byte[] key) | |