Package org.bouncycastle.crypto.engines
Class AESPacketCipher
java.lang.Object
org.bouncycastle.crypto.engines.AESPacketCipher
A collection of blockwise methods implementing AES
Copied from AESEngine
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckKeyLength(int keyLen) Check the key len and fail if not valid.static byte[]createS(boolean forEncryption) static int[][]generateWorkingKey(boolean forEncryption, byte[] key) Calculate the necessary round keys The number of calculations depends on key size and block size AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits This code is written assuming those are the only possible valuesstatic voidprocessBlock(boolean forEncryption, int[][] schedule, byte[] s, byte[] in, int inOff, byte[] out, int outOff) Does not allocate, does not do any bounds verification Intended to be used within larger implementation that asserts limits.
-
Field Details
-
BLOCK_SIZE
public static final int BLOCK_SIZE- See Also:
-
-
Constructor Details
-
AESPacketCipher
public AESPacketCipher()
-
-
Method Details
-
createS
public static byte[] createS(boolean forEncryption) -
generateWorkingKey
public static int[][] generateWorkingKey(boolean forEncryption, byte[] key) Calculate the necessary round keys The number of calculations depends on key size and block size AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits This code is written assuming those are the only possible values -
processBlock
public static void processBlock(boolean forEncryption, int[][] schedule, byte[] s, byte[] in, int inOff, byte[] out, int outOff) Does not allocate, does not do any bounds verification Intended to be used within larger implementation that asserts limits.- Parameters:
forEncryption- directionschedule- the key schedules-in-inOff-out-outOff-
-
checkKeyLength
Check the key len and fail if not valid.- Parameters:
keyLen- The key len- Throws:
PacketCipherException
-