public final class

CAST6Engine

extends CAST5Engine
java.lang.Object
   ↳ org.bouncycastle.crypto.engines.CAST5Engine
     ↳ org.bouncycastle.crypto.engines.CAST6Engine

Class Overview

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.

Summary

Constants
int BLOCK_SIZE
int ROUNDS
[Expand]
Inherited Constants
From class org.bouncycastle.crypto.engines.CAST5Engine
Fields
protected int[] _Km
protected int[] _Kr
protected int[] _Tm
protected int[] _Tr
[Expand]
Inherited Fields
From class org.bouncycastle.crypto.engines.CAST5Engine
Public Constructors
CAST6Engine()
Public Methods
String getAlgorithmName()
Return the name of the algorithm the cipher implements.
int getBlockSize()
Return the block size for this cipher (in bytes).
void reset()
Reset the cipher.
Protected Methods
final void CAST_Decipher(int A, int B, int C, int D, int[] result)
Does the 12 quad rounds rounds to decrypt the block.
final void CAST_Encipher(int A, int B, int C, int D, int[] result)
Does the 12 quad rounds rounds to encrypt the block.
int decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
int encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
void setKey(byte[] key)
[Expand]
Inherited Methods
From class org.bouncycastle.crypto.engines.CAST5Engine
From class java.lang.Object
From interface org.bouncycastle.crypto.BlockCipher

Constants

protected static final int BLOCK_SIZE

Constant Value: 16 (0x00000010)

protected static final int ROUNDS

Constant Value: 12 (0x0000000c)

Fields

protected int[] _Km

protected int[] _Kr

protected int[] _Tm

protected int[] _Tr

Public Constructors

public CAST6Engine ()

Public Methods

public String getAlgorithmName ()

Return the name of the algorithm the cipher implements.

Returns
  • the name of the algorithm the cipher implements.

public int getBlockSize ()

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

Returns
  • the block size for this cipher in bytes.

public void reset ()

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

Protected Methods

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 the 00-31 bits of the ciphertext block
B the 32-63 bits of the ciphertext block
C the 64-95 bits of the ciphertext block
D the 96-127 bits of the ciphertext block
result the resulting plaintext

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 the 00-31 bits of the plaintext block
B the 32-63 bits of the plaintext block
C the 64-95 bits of the plaintext block
D the 96-127 bits of the plaintext block
result the resulting ciphertext

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

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

Parameters
src The plaintext buffer
srcIndex An offset into src
dst The ciphertext buffer
dstIndex An offset into dst

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

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

Parameters
src The plaintext buffer
srcIndex An offset into src
dst The ciphertext buffer
dstIndex An offset into dst

protected void setKey (byte[] key)