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

public final Class CAST6Engine

extends CAST5Engine
Class Inheritance

A class that provides CAST6 key encryption operations, such as encoding data and generating keys. All the algorithms herein are from the Internet RFC RFC2612 - CAST6 (128bit block, 128-256bit key) and implement a simplified cryptography interface.

Field Summary

Modifier and TypeField and Description
protected int[]
protected int[]
protected int[]
protected int[]
private int[]
protected static final int
protected static final int
Inherited from org.bouncycastle.crypto.engines.CAST5Engine:
MAX_ROUNDSRED_ROUNDS

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected final void
CAST_Decipher(int
the 00-31 bits of the ciphertext block
A
,
int
the 32-63 bits of the ciphertext block
B
,
int
the 64-95 bits of the ciphertext block
C
,
int
the 96-127 bits of the ciphertext block
D
,
int[]
the resulting plaintext
result
)

Does the 12 quad rounds rounds to decrypt the block.

protected final void
CAST_Encipher(int
the 00-31 bits of the plaintext block
A
,
int
the 32-63 bits of the plaintext block
B
,
int
the 64-95 bits of the plaintext block
C
,
int
the 96-127 bits of the plaintext block
D
,
int[]
the resulting ciphertext
result
)

Does the 12 quad rounds rounds to encrypt the block.

protected int
decryptBlock(byte[]
The plaintext buffer
src
,
int
An offset into src
srcIndex
,
byte[]
The ciphertext buffer
dst
,
int
An offset into dst
dstIndex
)

Overrides org.bouncycastle.crypto.engines.CAST5Engine.decryptBlock.

Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
protected int
encryptBlock(byte[]
The plaintext buffer
src
,
int
An offset into src
srcIndex
,
byte[]
The ciphertext buffer
dst
,
int
An offset into dst
dstIndex
)

Overrides org.bouncycastle.crypto.engines.CAST5Engine.encryptBlock.

Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
public String
public int
public void
protected void
Inherited from org.bouncycastle.crypto.engines.CAST5Engine:
Bits32ToBytesBits32ToIntsBytesTo32bitsCAST_DecipherCAST_EncipherF1F2F3initIntsTo32bitsprocessBlock

Field Detail

_Kmback to summary
protected int[] _Km

Hides org.bouncycastle.crypto.engines.CAST5Engine._Km.

_Krback to summary
protected int[] _Kr

Hides org.bouncycastle.crypto.engines.CAST5Engine._Kr.

_Tmback to summary
protected int[] _Tm
_Trback to summary
protected int[] _Tr
_workingKeyback to summary
private int[] _workingKey

Hides org.bouncycastle.crypto.engines.CAST5Engine._workingKey.

BLOCK_SIZEback to summary
protected static final int BLOCK_SIZE

Hides org.bouncycastle.crypto.engines.CAST5Engine.BLOCK_SIZE.

ROUNDSback to summary
protected static final int ROUNDS

Constructor Detail

CAST6Engineback to summary
public CAST6Engine()

Method Detail

CAST_Decipherback to summary
protected final void CAST_Decipher(int A, int B, int C, int D, int[] result)

Does the 12 quad rounds rounds to decrypt the block.

Parameters
A:int

the 00-31 bits of the ciphertext block

B:int

the 32-63 bits of the ciphertext block

C:int

the 64-95 bits of the ciphertext block

D:int

the 96-127 bits of the ciphertext block

result:int[]

the resulting plaintext

CAST_Encipherback to summary
protected final void CAST_Encipher(int A, int B, int C, int D, int[] result)

Does the 12 quad rounds rounds to encrypt the block.

Parameters
A:int

the 00-31 bits of the plaintext block

B:int

the 32-63 bits of the plaintext block

C:int

the 64-95 bits of the plaintext block

D:int

the 96-127 bits of the plaintext block

result:int[]

the resulting ciphertext

decryptBlockback to summary
protected int decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)

Overrides org.bouncycastle.crypto.engines.CAST5Engine.decryptBlock.

Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.

Parameters
src:byte[]

The plaintext buffer

srcIndex:int

An offset into src

dst:byte[]

The ciphertext buffer

dstIndex:int

An offset into dst

encryptBlockback to summary
protected int encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)

Overrides org.bouncycastle.crypto.engines.CAST5Engine.encryptBlock.

Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.

Parameters
src:byte[]

The plaintext buffer

srcIndex:int

An offset into src

dst:byte[]

The ciphertext buffer

dstIndex:int

An offset into dst

getAlgorithmNameback to summary
public String getAlgorithmName()

Overrides org.bouncycastle.crypto.engines.CAST5Engine.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()

Overrides org.bouncycastle.crypto.engines.CAST5Engine.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.

resetback to summary
public void reset()

Overrides org.bouncycastle.crypto.engines.CAST5Engine.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).

setKeyback to summary
protected void setKey(byte[] key)

Overrides org.bouncycastle.crypto.engines.CAST5Engine.setKey.