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

public final Class SEED

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

The SEED encryption algorithm as described in RFC 4269.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SEED.AEADOperatorFactory

Factory for SEED AEAD encryption/decryption operators.

public static class
SEED.AuthParameters

Parameters for SEED AEAD and MAC modes.

private static class
public static class
SEED.KeyGenerator

SEED key generator.

public static class
SEED.KeyWrapOperatorFactory

Factory for SEED key wrap/unwrap operators.

public static class
SEED.MACOperatorFactory

Factory for producing SEED MAC calculators.

public static class
SEED.OperatorFactory

Factory for basic SEED encryption/decryption operators.

public static class
SEED.Parameters

Parameters for general SEED block cipher modes.

public static class
SEED.WrapParameters

SEED general WRAP operator parameters for KW and KWP.

Field Summary

Modifier and TypeField and Description
public static final GeneralAlgorithm
ALGORITHM

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

public static final SEED.Parameters
CBC

SEED in cipher block chaining (CBC) mode.

public static final SEED.Parameters
CBCwithCS1

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

public static final SEED.Parameters
CBCwithCS2

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

public static final SEED.Parameters
CBCwithCS3

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

public static final SEED.Parameters
CBCwithISO10126_2

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

public static final SEED.Parameters
CBCwithISO7816_4

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

public static final SEED.Parameters
CBCwithPKCS7

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

public static final SEED.Parameters
CBCwithTBC

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

public static final SEED.Parameters
CBCwithX923

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

public static final SEED.AuthParameters
CCM

SEED in counter with CBC-MAC (CCM).

public static final SEED.Parameters
CFB128

SEED in cipher feedback (CFB) mode.

public static final SEED.Parameters
CFB8

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

public static final SEED.AuthParameters
CMAC

SEED cipher-based MAC algorithm.

public static final SEED.Parameters
CTR

SEED in counter (CTR) mode.

public static final SEED.AuthParameters
EAX

SEED in EAX mode.

public static final SEED.Parameters
ECB

SEED in electronic code book (ECB) mode.

public static final SEED.Parameters
ECBwithISO10126_2

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

public static final SEED.Parameters
ECBwithISO7816_4

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

public static final SEED.Parameters
ECBwithPKCS7

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

public static final SEED.Parameters
ECBwithTBC

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

public static final SEED.Parameters
ECBwithX923

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

private static final SEED.EngineProvider
public static final SEED.AuthParameters
GCM

SEED in Galois/Counter Mode (GCM).

public static final SEED.AuthParameters
GMAC

SEED cipher-based GMAC algorithm.

public static final SEED.WrapParameters
KW

SEED as a FIPS/RFC 4010 key wrapper.

public static final SEED.WrapParameters
KWP

SEED as a FIPS/RFC 4010 key wrapper.

public static final SEED.AuthParameters
OCB

SEED in offset code book (OCB) mode.

public static final SEED.Parameters
OFB

SEED in output feedback (OFB) mode.

Constructor Summary

AccessConstructor and Description
private
SEED()

Method Summary

Modifier and TypeMethod and Description
private static boolean
private static ValidatedSymmetricKey
validateKey(SymmetricKey key, Algorithm paramAlgorithm)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALGORITHMback to summary
public static final GeneralAlgorithm ALGORITHM

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

CBCback to summary
public static final SEED.Parameters CBC

SEED in cipher block chaining (CBC) mode.

CBCwithCS1back to summary
public static final SEED.Parameters CBCwithCS1

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

CBCwithCS2back to summary
public static final SEED.Parameters CBCwithCS2

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

CBCwithCS3back to summary
public static final SEED.Parameters CBCwithCS3

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

CBCwithISO10126_2back to summary
public static final SEED.Parameters CBCwithISO10126_2

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

CBCwithISO7816_4back to summary
public static final SEED.Parameters CBCwithISO7816_4

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

CBCwithPKCS7back to summary
public static final SEED.Parameters CBCwithPKCS7

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

CBCwithTBCback to summary
public static final SEED.Parameters CBCwithTBC

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

CBCwithX923back to summary
public static final SEED.Parameters CBCwithX923

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

CCMback to summary
public static final SEED.AuthParameters CCM

SEED in counter with CBC-MAC (CCM).

CFB128back to summary
public static final SEED.Parameters CFB128

SEED in cipher feedback (CFB) mode.

CFB8back to summary
public static final SEED.Parameters CFB8

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

CMACback to summary
public static final SEED.AuthParameters CMAC

SEED cipher-based MAC algorithm.

CTRback to summary
public static final SEED.Parameters CTR

SEED in counter (CTR) mode.

EAXback to summary
public static final SEED.AuthParameters EAX

SEED in EAX mode.

ECBback to summary
public static final SEED.Parameters ECB

SEED in electronic code book (ECB) mode.

ECBwithISO10126_2back to summary
public static final SEED.Parameters ECBwithISO10126_2

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

ECBwithISO7816_4back to summary
public static final SEED.Parameters ECBwithISO7816_4

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

ECBwithPKCS7back to summary
public static final SEED.Parameters ECBwithPKCS7

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

ECBwithTBCback to summary
public static final SEED.Parameters ECBwithTBC

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

ECBwithX923back to summary
public static final SEED.Parameters ECBwithX923

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

ENGINE_PROVIDERback to summary
private static final SEED.EngineProvider ENGINE_PROVIDER
GCMback to summary
public static final SEED.AuthParameters GCM

SEED in Galois/Counter Mode (GCM).

GMACback to summary
public static final SEED.AuthParameters GMAC

SEED cipher-based GMAC algorithm.

KWback to summary
public static final SEED.WrapParameters KW

SEED as a FIPS/RFC 4010 key wrapper.

KWPback to summary
public static final SEED.WrapParameters KWP

SEED as a FIPS/RFC 4010 key wrapper.

OCBback to summary
public static final SEED.AuthParameters OCB

SEED in offset code book (OCB) mode.

OFBback to summary
public static final SEED.Parameters OFB

SEED in output feedback (OFB) mode.

Constructor Detail

SEEDback to summary
private SEED()

Method Detail

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

public final Class SEED.AEADOperatorFactory

extends GuardedAEADOperatorFactory<SEED.AuthParameters>
Class Inheritance

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

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

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

public final Class SEED.AuthParameters

extends GeneralAuthParameters<SEED.AuthParameters>
Class Inheritance

Parameters for SEED 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 SEED.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 128 for GCM, CMAC, or GMAC, 64 bits otherwise.

Parameters
algorithm:GeneralAlgorithm

algorithm mode.

Method Detail

createback to summary
protected SEED.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 SEED.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 SEED.KeyGenerator

extends GuardedSymmetricKeyGenerator
Class Inheritance

SEED key generator.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
KeyGenerator(GeneralParameters<T extends Algorithm> parameterSet, SecureRandom random)

private

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(SecureRandom random)
KeyGeneratorback to summary
public KeyGenerator(GeneralParameters<T extends Algorithm> parameterSet, SecureRandom random)
KeyGeneratorback to summary
private KeyGenerator(GeneralAlgorithm algorithm, 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 SEED.KeyWrapOperatorFactory

extends GuardedKeyWrapOperatorFactory<SEED.WrapParameters, SymmetricKey>
Class Inheritance

Factory for SEED key wrap/unwrap operators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Wrapper
Inherited from org.bouncycastle.crypto.general.GuardedKeyWrapOperatorFactory:
createKeyUnwrappercreateKeyWrapper

Constructor Detail

KeyWrapOperatorFactoryback to summary
public KeyWrapOperatorFactory()

Method Detail

createWrapperback to summary
protected Wrapper createWrapper(boolean forWrapping, SymmetricKey key, SEED.WrapParameters parameters, SecureRandom random)

Implements abstract org.bouncycastle.crypto.general.GuardedKeyWrapOperatorFactory.createWrapper.

org.bouncycastle.crypto.general back to summary

public final Class SEED.MACOperatorFactory

extends GuardedMACOperatorFactory<SEED.AuthParameters>
Class Inheritance

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

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

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

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

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

public final Class SEED.OperatorFactory

extends GuardedSymmetricOperatorFactory<SEED.Parameters>
Class Inheritance

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

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

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

public final Class SEED.Parameters

extends GeneralParametersWithIV<SEED.Parameters>
Class Inheritance

Parameters for general SEED 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 SEED.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 SEED.Parameters create(GeneralAlgorithm algorithm, byte[] iv)

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

org.bouncycastle.crypto.general back to summary

public final Class SEED.WrapParameters

extends GeneralParameters<GeneralAlgorithm>
implements ParametersWithIV
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.ParametersWithIV, org.bouncycastle.crypto.Parameters

SEED general WRAP operator parameters for KW and KWP.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final boolean

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public byte[]
getIV()

Implements org.bouncycastle.crypto.ParametersWithIV.getIV.

Return the initialization vector associated with this parameter set.
private int
public boolean
public SEED.WrapParameters
withIV(byte[]
the IV to use.
iv
)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Create a new parameter set with a different IV.
public SEED.WrapParameters
withIV(SecureRandom
the SecureRandom to use as the source of IV data.
random
)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Create a new parameter set with a different IV based on the output of the passed in random.
public SEED.WrapParameters
withUsingInverseFunction(boolean useInverse)

Inherited from org.bouncycastle.crypto.general.GeneralParameters:
getAlgorithm

Field Detail

ivback to summary
private final byte[] iv
useInverseback to summary
private final boolean useInverse

Constructor Detail

WrapParametersback to summary
pack-priv WrapParameters(GeneralAlgorithm algorithm)
WrapParametersback to summary
private WrapParameters(GeneralAlgorithm algorithm, byte[] iv, boolean useInverse)

Method Detail

getIVback to summary
public byte[] getIV()

Implements org.bouncycastle.crypto.ParametersWithIV.getIV.

Doc from org.bouncycastle.crypto.ParametersWithIV.getIV.

Return the initialization vector associated with this parameter set.

Returns:byte[]

the IV for these parameters.

getIvLengthback to summary
private int getIvLength()
isUsingInverseFunctionback to summary
public boolean isUsingInverseFunction()
withIVback to summary
public SEED.WrapParameters withIV(byte[] iv)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Doc from org.bouncycastle.crypto.ParametersWithIV.withIV.

Create a new parameter set with a different IV.

Parameters
iv:byte[]

the IV to use.

Returns:SEED.WrapParameters

a copy of the current parameter set with the new IV.

withIVback to summary
public SEED.WrapParameters withIV(SecureRandom random)

Implements org.bouncycastle.crypto.ParametersWithIV.withIV.

Doc from org.bouncycastle.crypto.ParametersWithIV.withIV.

Create a new parameter set with a different IV based on the output of the passed in random.

Parameters
random:SecureRandom

the SecureRandom to use as the source of IV data.

Returns:SEED.WrapParameters

a copy of the current parameter set with the new IV.

withUsingInverseFunctionback to summary
public SEED.WrapParameters withUsingInverseFunction(boolean useInverse)