Top Description Fields Constructors Methods
org.bouncycastle.crypto.engines

public Class ARIAEngine

extends Object
implements BlockCipher
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.BlockCipher
Imports
org.bouncycastle.crypto.BlockCipher, .CipherParameters, .CryptoServicesRegistrar, .DataLengthException, .OutputLengthException, org.bouncycastle.crypto.constraints.DefaultServiceProperties, org.bouncycastle.crypto.params.KeyParameter, org.bouncycastle.util.Bytes, org.bouncycastle.util.encoders.Hex

RFC 5794. ARIA is a 128-bit block cipher with 128-, 192-, and 256-bit keys.

Field Summary

Modifier and TypeField and Description
protected static final int
private static final byte[][]
C

pack-priv boolean
private byte[][]
private static final byte[]
private static final byte[]
private static final byte[]
private static final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected static void
A(byte[] z)

private int
protected static void
FE(byte[] D, byte[] RK)

protected static void
FO(byte[] D, byte[] RK)

public String
getAlgorithmName()

Implements org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

public int
getBlockSize()

Implements org.bouncycastle.crypto.BlockCipher.getBlockSize.

Return the block size for this cipher (in bytes).

public void
init(boolean
if true the cipher is initialised for encryption, if false for decryption.
forEncryption
,
CipherParameters
the key and other data required by the cipher.
params
)

Implements org.bouncycastle.crypto.BlockCipher.init.

Initialise the cipher.

protected static byte[][]
keySchedule(boolean forEncryption, byte[] K)

protected static void
keyScheduleRound(byte[] rk, byte[] w, byte[] wr, int n)

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.bouncycastle.crypto.BlockCipher.processBlock.

Process one block of input from the array in and write it to the out array.

public void
reset()

Implements org.bouncycastle.crypto.BlockCipher.reset.

Reset the cipher.

protected static void
reverseKeys(byte[][] keys)

protected static byte
SB1(byte x)

protected static byte
SB2(byte x)

protected static byte
SB3(byte x)

protected static byte
SB4(byte x)

protected static void
SL1(byte[] z)

protected static void
SL2(byte[] z)

protected static void
xor(byte[] z, byte[] x)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BLOCK_SIZEback to summary
protected static final int BLOCK_SIZE
Cback to summary
private static final byte[][] C
forEncryptionback to summary
pack-priv boolean forEncryption
roundKeysback to summary
private byte[][] roundKeys
SB1_sboxback to summary
private static final byte[] SB1_sbox
SB2_sboxback to summary
private static final byte[] SB2_sbox
SB3_sboxback to summary
private static final byte[] SB3_sbox
SB4_sboxback to summary
private static final byte[] SB4_sbox

Constructor Detail

ARIAEngineback to summary
public ARIAEngine()

Method Detail

Aback to summary
protected static void A(byte[] z)
bitsOfSecurityback to summary
private int bitsOfSecurity()
FEback to summary
protected static void FE(byte[] D, byte[] RK)
FOback to summary
protected static void FO(byte[] D, byte[] RK)
getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Doc from org.bouncycastle.crypto.BlockCipher.getAlgorithmName.

Return the name of the algorithm the cipher implements.

Returns:String

the name of the algorithm the cipher implements.

getBlockSizeback to summary
public int getBlockSize()

Implements org.bouncycastle.crypto.BlockCipher.getBlockSize.

Doc from org.bouncycastle.crypto.BlockCipher.getBlockSize.

Return the block size for this cipher (in bytes).

Returns:int

the block size for this cipher in bytes.

initback to summary
public void init(boolean forEncryption, CipherParameters params) throws IllegalArgumentException

Implements org.bouncycastle.crypto.BlockCipher.init.

Doc from org.bouncycastle.crypto.BlockCipher.init.

Initialise the cipher.

Parameters
forEncryption:boolean

if true the cipher is initialised for encryption, if false for decryption.

params:CipherParameters

the key and other data required by the cipher.

Exceptions
IllegalArgumentException:
if the params argument is inappropriate.
keyScheduleback to summary
protected static byte[][] keySchedule(boolean forEncryption, byte[] K)
keyScheduleRoundback to summary
protected static void keyScheduleRound(byte[] rk, byte[] w, byte[] wr, int n)
processBlockback to summary
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException

Implements org.bouncycastle.crypto.BlockCipher.processBlock.

Doc from org.bouncycastle.crypto.BlockCipher.processBlock.

Process one block of input from the array in and write it to the out array.

Parameters
in:byte[]

the array containing the input data.

inOff:int

offset into the in array the data starts at.

out:byte[]

the array the output data will be copied into.

outOff:int

the offset into the out array the output will start at.

Returns:int

the number of bytes processed and produced.

Exceptions
DataLengthException:
if there isn't enough data in input , or space in out.
IllegalStateException:
if the cipher isn't initialised.
resetback to summary
public void reset()

Implements org.bouncycastle.crypto.BlockCipher.reset.

Doc from org.bouncycastle.crypto.BlockCipher.reset.

Reset the cipher. After resetting the cipher is in the same state as it was after the last init (if there was one).

reverseKeysback to summary
protected static void reverseKeys(byte[][] keys)
SB1back to summary
protected static byte SB1(byte x)
SB2back to summary
protected static byte SB2(byte x)
SB3back to summary
protected static byte SB3(byte x)
SB4back to summary
protected static byte SB4(byte x)
SL1back to summary
protected static void SL1(byte[] z)
SL2back to summary
protected static void SL2(byte[] z)
xorback to summary
protected static void xor(byte[] z, byte[] x)