Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.general

public final Class CAST5

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.Algorithm, .IllegalKeyException, .SymmetricKey, .SymmetricSecretKey, org.bouncycastle.crypto.internal.BlockCipher, .BufferedBlockCipher, .KeyGenerationParameters, .Mac, .ValidatedSymmetricKey, org.bouncycastle.crypto.internal.modes.AEADBlockCipher, org.bouncycastle.crypto.internal.params.KeyParameter, .KeyParameterImpl, org.bouncycastle.util.Arrays, org.bouncycastle.util.encoders.Hex

Source class for implementations of CAST5 based algorithms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CAST5.AEADOperatorFactory

Factory for CAST5 AEAD encryption/decryption operators.

public static class
CAST5.AuthParameters

Parameters for CAST5 AEAD and MAC modes..

private static class
public static class
CAST5.KeyGenerator

CAST5 key generator.

public static class
CAST5.MACOperatorFactory

Factory for producing CAST5 MAC calculators.

public static class
CAST5.OperatorFactory

Factory for basic CAST5 encryption/decryption operators.

public static class
CAST5.Parameters

Parameters for general CAST5 block cipher modes.

Field Summary

Modifier and TypeField and Description
public static final GeneralAlgorithm
ALGORITHM

Raw CAST5 algorithm, can be used for creating general purpose CAST5 keys.

public static final CAST5.Parameters
CBC

CAST5 in cipher block chaining (CBC) mode.

public static final CAST5.Parameters
CBCwithCS1

CAST5 in cipher block chaining mode cipher text stealing type 1.

public static final CAST5.Parameters
CBCwithCS2

CAST5 in cipher block chaining mode cipher text stealing type 2.

public static final CAST5.Parameters
CBCwithCS3

CAST5 in cipher block chaining mode cipher text stealing type 3.

public static final CAST5.Parameters
CBCwithISO10126_2

CAST5 in cipher block chaining mode with ISO10126-2 padding.

public static final CAST5.Parameters
CBCwithISO7816_4

CAST5 in cipher block chaining mode with ISO7816-4 padding.

public static final CAST5.Parameters
CBCwithPKCS7

CAST5 in cipher block chaining mode with PKCS#7/PKCS#5 padding.

public static final CAST5.Parameters
CBCwithTBC

CAST5 in cipher block chaining mode with trailing bit complement (TBC) padding.

public static final CAST5.Parameters
CBCwithX923

CAST5 in cipher block chaining mode with X9.23 padding.

public static final CAST5.Parameters
CFB64

CAST5 in cipher feedback (CFB) mode, 64 bit block size.

public static final CAST5.Parameters
CFB8

CAST5 in cipher feedback (CFB) mode, 8 bit block size.

public static final CAST5.AuthParameters
CMAC

CAST5 cipher-based MAC algorithm.

public static final CAST5.Parameters
CTR

CAST5 in counter (CTR) mode.

public static final CAST5.AuthParameters
EAX

CAST5 in EAX mode..

public static final CAST5.Parameters
ECB

CAST5 in electronic code book (ECB) mode.

public static final CAST5.Parameters
ECBwithISO10126_2

CAST5 in electronic code book mode with ISO10126-2 padding.

public static final CAST5.Parameters
ECBwithISO7816_4

CAST5 in electronic code book mode with ISO7816-4 padding.

public static final CAST5.Parameters
ECBwithPKCS7

CAST5 in electronic code book mode with PKCS#7/PKCS#5 padding.

public static final CAST5.Parameters
ECBwithTBC

CAST5 in electronic code book mode with trailing bit complement (TBC) padding.

public static final CAST5.Parameters
ECBwithX923

CAST5 in electronic code book mode with X9.23 padding.

private static final CAST5.EngineProvider
public static final CAST5.Parameters
OFB

CAST5 in output feedback (OFB) mode, 64 bit block size.

public static final CAST5.Parameters
OpenPGPCFB

CAST5 in OpenPGP cipher feedback (CFB) mode.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
invalidKeySize(int keyLength)

private static ValidatedSymmetricKey
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALGORITHMback to summary
public static final GeneralAlgorithm ALGORITHM

Raw CAST5 algorithm, can be used for creating general purpose CAST5 keys.

CBCback to summary
public static final CAST5.Parameters CBC

CAST5 in cipher block chaining (CBC) mode.

CBCwithCS1back to summary
public static final CAST5.Parameters CBCwithCS1

CAST5 in cipher block chaining mode cipher text stealing type 1.

CBCwithCS2back to summary
public static final CAST5.Parameters CBCwithCS2

CAST5 in cipher block chaining mode cipher text stealing type 2.

CBCwithCS3back to summary
public static final CAST5.Parameters CBCwithCS3

CAST5 in cipher block chaining mode cipher text stealing type 3.

CBCwithISO10126_2back to summary
public static final CAST5.Parameters CBCwithISO10126_2

CAST5 in cipher block chaining mode with ISO10126-2 padding.

CBCwithISO7816_4back to summary
public static final CAST5.Parameters CBCwithISO7816_4

CAST5 in cipher block chaining mode with ISO7816-4 padding.

CBCwithPKCS7back to summary
public static final CAST5.Parameters CBCwithPKCS7

CAST5 in cipher block chaining mode with PKCS#7/PKCS#5 padding.

CBCwithTBCback to summary
public static final CAST5.Parameters CBCwithTBC

CAST5 in cipher block chaining mode with trailing bit complement (TBC) padding.

CBCwithX923back to summary
public static final CAST5.Parameters CBCwithX923

CAST5 in cipher block chaining mode with X9.23 padding.

CFB64back to summary
public static final CAST5.Parameters CFB64

CAST5 in cipher feedback (CFB) mode, 64 bit block size.

CFB8back to summary
public static final CAST5.Parameters CFB8

CAST5 in cipher feedback (CFB) mode, 8 bit block size.

CMACback to summary
public static final CAST5.AuthParameters CMAC

CAST5 cipher-based MAC algorithm.

CTRback to summary
public static final CAST5.Parameters CTR

CAST5 in counter (CTR) mode.

EAXback to summary
public static final CAST5.AuthParameters EAX

CAST5 in EAX mode..

ECBback to summary
public static final CAST5.Parameters ECB

CAST5 in electronic code book (ECB) mode.

ECBwithISO10126_2back to summary
public static final CAST5.Parameters ECBwithISO10126_2

CAST5 in electronic code book mode with ISO10126-2 padding.

ECBwithISO7816_4back to summary
public static final CAST5.Parameters ECBwithISO7816_4

CAST5 in electronic code book mode with ISO7816-4 padding.

ECBwithPKCS7back to summary
public static final CAST5.Parameters ECBwithPKCS7

CAST5 in electronic code book mode with PKCS#7/PKCS#5 padding.

ECBwithTBCback to summary
public static final CAST5.Parameters ECBwithTBC

CAST5 in electronic code book mode with trailing bit complement (TBC) padding.

ECBwithX923back to summary
public static final CAST5.Parameters ECBwithX923

CAST5 in electronic code book mode with X9.23 padding.

ENGINE_PROVIDERback to summary
private static final CAST5.EngineProvider ENGINE_PROVIDER
OFBback to summary
public static final CAST5.Parameters OFB

CAST5 in output feedback (OFB) mode, 64 bit block size.

OpenPGPCFBback to summary
public static final CAST5.Parameters OpenPGPCFB

CAST5 in OpenPGP cipher feedback (CFB) mode.

Constructor Detail

CAST5back to summary
private CAST5()

Method Detail

invalidKeySizeback to summary
private static boolean invalidKeySize(int keyLength)
validateKeyback to summary
private static ValidatedSymmetricKey validateKey(SymmetricKey key, Algorithm algorithm)
org.bouncycastle.crypto.general back to summary

public final Class CAST5.AEADOperatorFactory

extends GuardedAEADOperatorFactory<CAST5.AuthParameters>
Class Inheritance

Factory for CAST5 AEAD encryption/decryption operators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected AEADBlockCipher
Inherited from org.bouncycastle.crypto.general.GuardedAEADOperatorFactory:
createInputAEADDecryptorcreateOutputAEADDecryptorcreateOutputAEADEncryptor

Constructor Detail

AEADOperatorFactoryback to summary
public AEADOperatorFactory()

Method Detail

createAEADCipherback to summary
protected AEADBlockCipher createAEADCipher(boolean forEncryption, SymmetricKey key, CAST5.AuthParameters parameters)

Implements abstract org.bouncycastle.crypto.general.GuardedAEADOperatorFactory.createAEADCipher.

Annotations
@Override
org.bouncycastle.crypto.general back to summary

public final Class CAST5.AuthParameters

extends GeneralAuthParameters<CAST5.AuthParameters>
Class Inheritance

Parameters for CAST5 AEAD and MAC modes..

Field Summary

Inherited from org.bouncycastle.crypto.general.GeneralAuthParameters:
macLenInBits

Constructor Summary

AccessConstructor and Description
private
AuthParameters(GeneralAlgorithm algorithm, byte[] iv, int macLenInBits)

pack-priv
AuthParameters(GeneralAlgorithm
algorithm mode.
algorithm
)

Base constructor - the algorithm, null IV.

Method Summary

Modifier and TypeMethod and Description
protected CAST5.AuthParameters
create(GeneralAlgorithm algorithm, byte[] iv, int macSizeInBits)

Implements abstract org.bouncycastle.crypto.general.GeneralAuthParameters.create.

Inherited from org.bouncycastle.crypto.general.GeneralAuthParameters:
creategetMACSizeInBitswithIVwithMACSize

Constructor Detail

AuthParametersback to summary
private AuthParameters(GeneralAlgorithm algorithm, byte[] iv, int macLenInBits)
AuthParametersback to summary
pack-priv AuthParameters(GeneralAlgorithm algorithm)

Base constructor - the algorithm, null IV. In this case the tag length defaults to the 64 for CMAC, 32 bits otherwise.

Parameters
algorithm:GeneralAlgorithm

algorithm mode.

Method Detail

createback to summary
protected CAST5.AuthParameters create(GeneralAlgorithm algorithm, byte[] iv, int macSizeInBits)

Implements abstract org.bouncycastle.crypto.general.GeneralAuthParameters.create.

org.bouncycastle.crypto.general back to summary

private final Class CAST5.EngineProvider

extends Object
implements EngineProvider<BlockCipher>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.EngineProvider

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public BlockCipher
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EngineProviderback to summary
private EngineProvider()

Method Detail

createEngineback to summary
public BlockCipher createEngine()

Implements org.bouncycastle.crypto.internal.EngineProvider.createEngine.

org.bouncycastle.crypto.general back to summary

public final Class CAST5.KeyGenerator

extends GuardedSymmetricKeyGenerator
Class Inheritance

CAST5 key generator.

Field Summary

Modifier and TypeField and Description
private final GeneralAlgorithm
private final int
private final SecureRandom

Constructor Summary

AccessConstructor and Description
public
KeyGenerator(int keySizeInBits, SecureRandom random)

public
KeyGenerator(GeneralParameters<T extends Algorithm> parameterSet, int keySizeInBits, SecureRandom random)

private
KeyGenerator(GeneralAlgorithm algorithm, int keySizeInBits, SecureRandom random)

Method Summary

Modifier and TypeMethod and Description
public SymmetricKey
Inherited from org.bouncycastle.crypto.general.GuardedSymmetricKeyGenerator:
generateKey

Field Detail

algorithmback to summary
private final GeneralAlgorithm algorithm
keySizeInBitsback to summary
private final int keySizeInBits
randomback to summary
private final SecureRandom random

Constructor Detail

KeyGeneratorback to summary
public KeyGenerator(int keySizeInBits, SecureRandom random)
KeyGeneratorback to summary
public KeyGenerator(GeneralParameters<T extends Algorithm> parameterSet, int keySizeInBits, SecureRandom random)
KeyGeneratorback to summary
private KeyGenerator(GeneralAlgorithm algorithm, int keySizeInBits, SecureRandom random)

Method Detail

doGenerateKeyback to summary
public SymmetricKey doGenerateKey()

Implements abstract org.bouncycastle.crypto.general.GuardedSymmetricKeyGenerator.doGenerateKey.

org.bouncycastle.crypto.general back to summary

public final Class CAST5.MACOperatorFactory

extends GuardedMACOperatorFactory<CAST5.AuthParameters>
Class Inheritance

Factory for producing CAST5 MAC calculators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected int
protected Mac
Inherited from org.bouncycastle.crypto.general.GuardedMACOperatorFactory:
createOutputMACCalculator

Constructor Detail

MACOperatorFactoryback to summary
public MACOperatorFactory()

Method Detail

calculateMACSizeback to summary
protected int calculateMACSize(CAST5.AuthParameters parameters)

Implements abstract org.bouncycastle.crypto.general.GuardedMACOperatorFactory.calculateMACSize.

Annotations
@Override
createMACback to summary
protected Mac createMAC(SymmetricKey key, final CAST5.AuthParameters parameters)

Implements abstract org.bouncycastle.crypto.general.GuardedMACOperatorFactory.createMAC.

Annotations
@Override
org.bouncycastle.crypto.general back to summary

public final Class CAST5.OperatorFactory

extends GuardedSymmetricOperatorFactory<CAST5.Parameters>
Class Inheritance

Factory for basic CAST5 encryption/decryption operators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected BufferedBlockCipher
Inherited from org.bouncycastle.crypto.general.GuardedSymmetricOperatorFactory:
createInputDecryptorcreateOutputDecryptorcreateOutputEncryptor

Constructor Detail

OperatorFactoryback to summary
public OperatorFactory()

Method Detail

createCipherback to summary
protected BufferedBlockCipher createCipher(boolean forEncryption, SymmetricKey key, CAST5.Parameters parameters, SecureRandom random)

Implements abstract org.bouncycastle.crypto.general.GuardedSymmetricOperatorFactory.createCipher.

Annotations
@Override
org.bouncycastle.crypto.general back to summary

public final Class CAST5.Parameters

extends GeneralParametersWithIV<CAST5.Parameters>
Class Inheritance

Parameters for general CAST5 block cipher modes.

Field Summary

Inherited from org.bouncycastle.crypto.general.GeneralParametersWithIV:
blockSizeiv

Constructor Summary

AccessConstructor and Description
private
Parameters(GeneralAlgorithm algorithm, byte[] iv)

pack-priv

Method Summary

Modifier and TypeMethod and Description
protected CAST5.Parameters
Inherited from org.bouncycastle.crypto.general.GeneralParametersWithIV:
getIVwithIVwithIV

Constructor Detail

Parametersback to summary
private Parameters(GeneralAlgorithm algorithm, byte[] iv)
Parametersback to summary
pack-priv Parameters(GeneralAlgorithm algorithm)

Method Detail

createback to summary
protected CAST5.Parameters create(GeneralAlgorithm algorithm, byte[] iv)

Implements abstract org.bouncycastle.crypto.general.GeneralParametersWithIV.create.