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

public final Class IDEA

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 IDEA based algorithms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
IDEA.AEADOperatorFactory

Factory for IDEA AEAD encryption/decryption operators.

public static class
IDEA.AuthParameters

Parameters for IDEA AEAD and MAC modes.

private static class
public static class
IDEA.KeyGenerator

IDEA key generator.

public static class
IDEA.MACOperatorFactory

Factory for producing IDEA MAC calculators.

public static class
IDEA.OperatorFactory

Factory for basic IDEA encryption/decryption operators.

public static class
IDEA.Parameters

Parameters for general IDEA block cipher modes.

Field Summary

Modifier and TypeField and Description
public static final GeneralAlgorithm
ALGORITHM

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

public static final IDEA.Parameters
CBC

IDEA in cipher block chaining (CBC) mode.

public static final IDEA.AuthParameters
CBC_MAC

IDEA CBC_MAC.

public static final IDEA.Parameters
CBCwithCS1

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

public static final IDEA.Parameters
CBCwithCS2

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

public static final IDEA.Parameters
CBCwithCS3

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

public static final IDEA.Parameters
CBCwithISO10126_2

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

public static final IDEA.Parameters
CBCwithISO7816_4

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

public static final IDEA.Parameters
CBCwithPKCS7

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

public static final IDEA.Parameters
CBCwithTBC

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

public static final IDEA.Parameters
CBCwithX923

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

public static final IDEA.Parameters
CFB64

IDEA in cipher feedback (CFB) mode.

public static final IDEA.Parameters
CFB8

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

public static final IDEA.AuthParameters
CFB8_MAC

IDEA CFB8MAC.

public static final IDEA.AuthParameters
CMAC

IDEA cipher-based MAC algorithm.

public static final IDEA.Parameters
CTR

IDEA in counter (CTR) mode.

public static final IDEA.AuthParameters
EAX

IDEA in EAX mode.

public static final IDEA.Parameters
ECB

IDEA in electronic code book (ECB) mode.

public static final IDEA.Parameters
ECBwithISO10126_2

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

public static final IDEA.Parameters
ECBwithISO7816_4

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

public static final IDEA.Parameters
ECBwithPKCS7

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

public static final IDEA.Parameters
ECBwithTBC

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

public static final IDEA.Parameters
ECBwithX923

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

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

IDEA in output feedback (OFB) mode.

public static final IDEA.Parameters
OpenPGPCFB

IDEA in OpenPGP cipher feedback (CFB) mode.

Constructor Summary

AccessConstructor and Description
private
IDEA()

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 IDEA algorithm, can be used for creating general purpose IDEA keys.

CBCback to summary
public static final IDEA.Parameters CBC

IDEA in cipher block chaining (CBC) mode.

CBC_MACback to summary
public static final IDEA.AuthParameters CBC_MAC

IDEA CBC_MAC.

CBCwithCS1back to summary
public static final IDEA.Parameters CBCwithCS1

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

CBCwithCS2back to summary
public static final IDEA.Parameters CBCwithCS2

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

CBCwithCS3back to summary
public static final IDEA.Parameters CBCwithCS3

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

CBCwithISO10126_2back to summary
public static final IDEA.Parameters CBCwithISO10126_2

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

CBCwithISO7816_4back to summary
public static final IDEA.Parameters CBCwithISO7816_4

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

CBCwithPKCS7back to summary
public static final IDEA.Parameters CBCwithPKCS7

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

CBCwithTBCback to summary
public static final IDEA.Parameters CBCwithTBC

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

CBCwithX923back to summary
public static final IDEA.Parameters CBCwithX923

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

CFB64back to summary
public static final IDEA.Parameters CFB64

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

CFB8back to summary
public static final IDEA.Parameters CFB8

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

CFB8_MACback to summary
public static final IDEA.AuthParameters CFB8_MAC

IDEA CFB8MAC.

CMACback to summary
public static final IDEA.AuthParameters CMAC

IDEA cipher-based MAC algorithm.

CTRback to summary
public static final IDEA.Parameters CTR

IDEA in counter (CTR) mode.

EAXback to summary
public static final IDEA.AuthParameters EAX

IDEA in EAX mode.

ECBback to summary
public static final IDEA.Parameters ECB

IDEA in electronic code book (ECB) mode.

ECBwithISO10126_2back to summary
public static final IDEA.Parameters ECBwithISO10126_2

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

ECBwithISO7816_4back to summary
public static final IDEA.Parameters ECBwithISO7816_4

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

ECBwithPKCS7back to summary
public static final IDEA.Parameters ECBwithPKCS7

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

ECBwithTBCback to summary
public static final IDEA.Parameters ECBwithTBC

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

ECBwithX923back to summary
public static final IDEA.Parameters ECBwithX923

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

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

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

OpenPGPCFBback to summary
public static final IDEA.Parameters OpenPGPCFB

IDEA in OpenPGP cipher feedback (CFB) mode.

Constructor Detail

IDEAback to summary
private IDEA()

Method Detail

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

public final Class IDEA.AEADOperatorFactory

extends GuardedAEADOperatorFactory<IDEA.AuthParameters>
Class Inheritance

Factory for IDEA 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, IDEA.AuthParameters parameters)

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

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

public final Class IDEA.AuthParameters

extends GeneralAuthParameters<IDEA.AuthParameters>
Class Inheritance

Parameters for IDEA 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 tagLenInBits)

pack-priv
AuthParameters(GeneralAlgorithm
algorithm mode.
algorithm
)

Base constructor - the algorithm, null IV.

Method Summary

Modifier and TypeMethod and Description
protected IDEA.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 tagLenInBits)
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 IDEA.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 IDEA.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 IDEA.KeyGenerator

extends GuardedSymmetricKeyGenerator
Class Inheritance

IDEA 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 IDEA.MACOperatorFactory

extends GuardedMACOperatorFactory<IDEA.AuthParameters>
Class Inheritance

Factory for producing IDEA 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(IDEA.AuthParameters parameters)

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

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

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

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

public final Class IDEA.OperatorFactory

extends GuardedSymmetricOperatorFactory<IDEA.Parameters>
Class Inheritance

Factory for basic IDEA 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, IDEA.Parameters parameters, SecureRandom random)

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

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

public final Class IDEA.Parameters

extends GeneralParametersWithIV<IDEA.Parameters>
Class Inheritance

Parameters for general IDEA block cipher modes.

Field Summary

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

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
pack-priv IDEA.Parameters
public IDEA.Parameters
withIV(SecureRandom
the SecureRandom to use as the source of IV data.
random
)

Overrides org.bouncycastle.crypto.general.GeneralParametersWithIV.withIV.

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.
public IDEA.Parameters
withIV(byte[]
the bytes making up the iv, or nonce, to use.
iv
)

Overrides org.bouncycastle.crypto.general.GeneralParametersWithIV.withIV.

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Return an implementation of our parameterized type containing the passed in IV.
Inherited from org.bouncycastle.crypto.general.GeneralParametersWithIV:
getIV

Constructor Detail

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

Method Detail

createback to summary
pack-priv IDEA.Parameters create(GeneralAlgorithm algorithm, byte[] iv)

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

Annotations
@Override
withIVback to summary
public IDEA.Parameters withIV(SecureRandom random)

Overrides org.bouncycastle.crypto.general.GeneralParametersWithIV.withIV.

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Doc from org.bouncycastle.crypto.general.GeneralParametersWithIV.withIV.

Return an implementation of our parameterized type with an IV constructed from the passed in SecureRandom.

Parameters
random:SecureRandom

the SecureRandom to use as the source of IV data.

Returns:IDEA.Parameters

a new instance of our parameterized type with a new IV.

withIVback to summary
public IDEA.Parameters withIV(byte[] iv)

Overrides org.bouncycastle.crypto.general.GeneralParametersWithIV.withIV.

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Doc from org.bouncycastle.crypto.general.GeneralParametersWithIV.withIV.

Return an implementation of our parameterized type containing the passed in IV.

Parameters
iv:byte[]

the bytes making up the iv, or nonce, to use.

Returns:IDEA.Parameters

a new instance of our parameterized type with a new IV.