Package org.bouncycastle.crypto.engines
Class SerpentEngine
- java.lang.Object
-
- org.bouncycastle.crypto.engines.SerpentEngineBase
-
- org.bouncycastle.crypto.engines.SerpentEngine
-
- All Implemented Interfaces:
BlockCipher
public final class SerpentEngine extends SerpentEngineBase
Serpent is a 128-bit 32-round block cipher with variable key lengths, including 128, 192 and 256 bit keys conjectured to be at least as secure as three-key triple-DES.Serpent was designed by Ross Anderson, Eli Biham and Lars Knudsen as a candidate algorithm for the NIST AES Quest.
For full details see The Serpent home page
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.crypto.engines.SerpentEngineBase
BLOCK_SIZE, encrypting, wKey, X0, X1, X2, X3
-
-
Constructor Summary
Constructors Constructor Description SerpentEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decryptBlock(byte[] input, int inOff, byte[] output, int outOff)
Decrypt one block of ciphertext.protected void
encryptBlock(byte[] input, int inOff, byte[] output, int outOff)
Encrypt one block of plaintext.protected int[]
makeWorkingKey(byte[] key)
Expand a user-supplied key material into a session key.-
Methods inherited from class org.bouncycastle.crypto.engines.SerpentEngineBase
getAlgorithmName, getBlockSize, ib0, ib1, ib2, ib3, ib4, ib5, ib6, ib7, init, inverseLT, LT, processBlock, reset, rotateLeft, rotateRight, sb0, sb1, sb2, sb3, sb4, sb5, sb6, sb7
-
-
-
-
Method Detail
-
makeWorkingKey
protected int[] makeWorkingKey(byte[] key) throws java.lang.IllegalArgumentException
Expand a user-supplied key material into a session key.- Specified by:
makeWorkingKey
in classSerpentEngineBase
- Parameters:
key
- The user-key bytes (multiples of 4) to use.- Throws:
java.lang.IllegalArgumentException
-
encryptBlock
protected void encryptBlock(byte[] input, int inOff, byte[] output, int outOff)
Encrypt one block of plaintext.- Specified by:
encryptBlock
in classSerpentEngineBase
- Parameters:
input
- the array containing the input data.inOff
- offset into the in array the data starts at.output
- the array the output data will be copied into.outOff
- the offset into the out array the output will start at.
-
decryptBlock
protected void decryptBlock(byte[] input, int inOff, byte[] output, int outOff)
Decrypt one block of ciphertext.- Specified by:
decryptBlock
in classSerpentEngineBase
- Parameters:
input
- the array containing the input data.inOff
- offset into the in array the data starts at.output
- the array the output data will be copied into.outOff
- the offset into the out array the output will start at.
-
-