Top Description Fields Constructors Methods
com.sun.crypto.provider

pack-priv final Class AESCrypt

extends SymmetricCipher
implements AESConstants
Class Inheritance
All Implemented Interfaces
com.sun.crypto.provider.AESConstants
Imports
java.security.InvalidKeyException, .MessageDigest, java.util.Arrays, jdk.internal.vm.annotation.IntrinsicCandidate

Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit block size and variable key-size (128-, 192- and 256-bit).

Rijndael was designed by Vincent Rijmen and Joan Daemen.

Field Summary

Modifier and TypeField and Description
private int[]
K

private byte[]
lastKey

Cipher encryption/decryption key

private int
limit

ROUNDS * 4

private static final int[]
private boolean
private boolean
private static final byte[]
S

private int[][]
sessionK

Session and Sub keys

private static final byte[]
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[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
decryptBlock(byte[]
the input buffer with the data to be decrypted
in
,
int
the offset in cipher
inOffset
,
byte[]
the buffer for the decryption result
out
,
int
the offset in plain
outOffset
)

Implements abstract com.sun.crypto.provider.SymmetricCipher.decryptBlock.

Decrypt exactly one block of plaintext.
pack-priv void
encryptBlock(byte[]
the input buffer with the data to be encrypted
in
,
int
the offset in plain
inOffset
,
byte[]
the buffer for the encryption result
out
,
int
the offset in cipher
outOffset
)

Implements abstract com.sun.crypto.provider.SymmetricCipher.encryptBlock.

Encrypt exactly one block of plaintext.
pack-priv int

Returns:

this cipher's block size
getBlockSize
()

Implements abstract com.sun.crypto.provider.SymmetricCipher.getBlockSize.

Returns this cipher's block size.
private static int

Returns:

The number of rounds.
getRounds
(int
The size of the user key material in bytes. MUST be one of (16, 24, 32).
keySize
)

Return The number of rounds for a given Rijndael keysize.

private void
implDecryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

private void
implEncryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

pack-priv void
init(boolean
flag indicating encryption or decryption
decrypting
,
String
the algorithm name
algorithm
,
byte[]
the key
key
)

Implements abstract com.sun.crypto.provider.SymmetricCipher.init.

Initializes the cipher in the specified mode with the given key.
pack-priv static boolean
isKeySizeValid(int len)

private void
makeSessionKey(byte[]
The 128/192/256-bit cipher key to use.
k
)

Expand a user-supplied key material into a session key.

Field Detail

Kback to summary
private int[] K
lastKeyback to summary
private byte[] lastKey

Cipher encryption/decryption key

limitback to summary
private int limit

ROUNDS * 4

rconback to summary
private static final int[] rcon
ROUNDS_12back to summary
private boolean ROUNDS_12
ROUNDS_14back to summary
private boolean ROUNDS_14
Sback to summary
private static final byte[] S
sessionKback to summary
private int[][] sessionK

Session and Sub keys

Siback to summary
private static final byte[] Si
T1back to summary
private static final int[] T1
T2back to summary
private static final int[] T2
T3back to summary
private static final int[] T3
T4back to summary
private static final int[] T4
T5back to summary
private static final int[] T5
T6back to summary
private static final int[] T6
T7back to summary
private static final int[] T7
T8back to summary
private static final int[] T8
U1back to summary
private static final int[] U1
U2back to summary
private static final int[] U2
U3back to summary
private static final int[] U3
U4back to summary
private static final int[] U4

Constructor Detail

AESCryptback to summary
pack-priv AESCrypt()

Method Detail

decryptBlockback to summary
pack-priv void decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

Implements abstract com.sun.crypto.provider.SymmetricCipher.decryptBlock.

Decrypt exactly one block of plaintext.

Parameters
in:byte[]

Doc from com.sun.crypto.provider.SymmetricCipher.decryptBlock.

the input buffer with the data to be decrypted

inOffset:int

Doc from com.sun.crypto.provider.SymmetricCipher.decryptBlock.

the offset in cipher

out:byte[]

Doc from com.sun.crypto.provider.SymmetricCipher.decryptBlock.

the buffer for the decryption result

outOffset:int

Doc from com.sun.crypto.provider.SymmetricCipher.decryptBlock.

the offset in plain

encryptBlockback to summary
pack-priv void encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)

Implements abstract com.sun.crypto.provider.SymmetricCipher.encryptBlock.

Encrypt exactly one block of plaintext.

Parameters
in:byte[]

Doc from com.sun.crypto.provider.SymmetricCipher.encryptBlock.

the input buffer with the data to be encrypted

inOffset:int

Doc from com.sun.crypto.provider.SymmetricCipher.encryptBlock.

the offset in plain

out:byte[]

Doc from com.sun.crypto.provider.SymmetricCipher.encryptBlock.

the buffer for the encryption result

outOffset:int

Doc from com.sun.crypto.provider.SymmetricCipher.encryptBlock.

the offset in cipher

getBlockSizeback to summary
pack-priv int getBlockSize()

Implements abstract com.sun.crypto.provider.SymmetricCipher.getBlockSize.

Returns this cipher's block size.

Returns:int

this cipher's block size

getRoundsback to summary
private static int getRounds(int keySize)

Return The number of rounds for a given Rijndael keysize.

Parameters
keySize:int

The size of the user key material in bytes. MUST be one of (16, 24, 32).

Returns:int

The number of rounds.

implDecryptBlockback to summary
private void implDecryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
Annotations
@IntrinsicCandidate
implEncryptBlockback to summary
private void implEncryptBlock(byte[] in, int inOffset, byte[] out, int outOffset)
Annotations
@IntrinsicCandidate
initback to summary
pack-priv void init(boolean decrypting, String algorithm, byte[] key) throws InvalidKeyException

Implements abstract com.sun.crypto.provider.SymmetricCipher.init.

Doc from com.sun.crypto.provider.SymmetricCipher.init.

Initializes the cipher in the specified mode with the given key.

Parameters
decrypting:boolean

flag indicating encryption or decryption

algorithm:String

the algorithm name

key:byte[]

the key

Exceptions
InvalidKeyException:
if the given key is inappropriate for initializing this cipher
isKeySizeValidback to summary
pack-priv static boolean isKeySizeValid(int len)
makeSessionKeyback to summary
private void makeSessionKey(byte[] k) throws InvalidKeyException

Expand a user-supplied key material into a session key.

Parameters
k:byte[]

The 128/192/256-bit cipher key to use.

Exceptions
InvalidKeyException:
If the key is invalid.