Top Inners Fields Constructors Methods
org.bouncycastle.pqc.jcajce.provider.mceliece

public Class McElieceKobaraImaiCipherSpi

extends AsymmetricHybridCipher
implements PKCSObjectIdentifiers, X509ObjectIdentifiers
Class Inheritance
All Implemented Interfaces
org.bouncycastle.asn1.x509.X509ObjectIdentifiers, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers
Known Direct Subclasses
org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi.McElieceKobaraImai, org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi.McElieceKobaraImai224, org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi.McElieceKobaraImai256, org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi.McElieceKobaraImai384, org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi.McElieceKobaraImai512
Imports
java.io.ByteArrayOutputStream, java.security.InvalidAlgorithmParameterException, .InvalidKeyException, .Key, .PrivateKey, .PublicKey, .SecureRandom, java.security.spec.AlgorithmParameterSpec, javax.crypto.BadPaddingException, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, org.bouncycastle.asn1.x509.X509ObjectIdentifiers, org.bouncycastle.crypto.CipherParameters, .Digest, .InvalidCipherTextException, org.bouncycastle.crypto.params.ParametersWithRandom, org.bouncycastle.crypto.util.DigestFactory, org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher, org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceCCA2KeyParameters, .McElieceKobaraImaiCipher

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private ByteArrayOutputStream
buf

buffer to store the input data

private McElieceKobaraImaiCipher
private Digest
Inherited from org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher:
paramSpec

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
protected int
decryptOutputSize(int
the length of the input
inLen
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.decryptOutputSize.

Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in decryption mode when given input of the specified length.

public byte[]

Returns:

the new buffer with the result
doFinal
(byte[]
the input buffer
input
,
int
the offset in input where the input starts
inOff
,
int
the input length
inLen
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.doFinal.

Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation.

protected int
encryptOutputSize(int
the length of the input
inLen
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.encryptOutputSize.

Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in encryption mode when given input of the specified length.

public int
getKeySize(Key
the key object
key
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.CipherSpiExt.getKeySize.

Return the key size of the given key object in bits.

public String
protected void
initCipherDecrypt(Key
the key which has to be used to decrypt data
key
,
AlgorithmParameterSpec
the algorithm parameters
params
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.initCipherDecrypt.

Initialize the AsymmetricHybridCipher with a certain key for data encryption.

protected void
initCipherEncrypt(Key
the key which has to be used to encrypt data
key
,
AlgorithmParameterSpec
the algorithm parameters
params
,
SecureRandom
the source of randomness
sr
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.initCipherEncrypt.

Initialize the AsymmetricHybridCipher with a certain key for data encryption.

private byte[]

Returns:

the padded message
pad
()

Pad and return the message stored in the message buffer.

private byte[]

Returns:

the message
unpad
(byte[]
the padded message
pmBytes
)

Unpad a message.

public byte[]

Returns:

the processed byte array.
update
(byte[]
byte array containing the next part of the input
input
,
int
index in the array where the input starts
inOff
,
int
length of the input
inLen
)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.update.

Continue a multiple-part encryption or decryption operation.

Inherited from org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher:
doFinalgetBlockSizegetIVgetOutputSizegetParametersinitDecryptinitDecryptinitEncryptinitEncryptinitEncryptinitEncryptsetModesetPaddingupdate

Field Detail

bufback to summary
private ByteArrayOutputStream buf

buffer to store the input data

cipherback to summary
private McElieceKobaraImaiCipher cipher
digestback to summary
private Digest digest

Constructor Detail

McElieceKobaraImaiCipherSpiback to summary
public McElieceKobaraImaiCipherSpi()
McElieceKobaraImaiCipherSpiback to summary
protected McElieceKobaraImaiCipherSpi(Digest digest, McElieceKobaraImaiCipher cipher)

Method Detail

decryptOutputSizeback to summary
protected int decryptOutputSize(int inLen)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.decryptOutputSize.

Doc from org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.decryptOutputSize.

Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in decryption mode when given input of the specified length.

Parameters
inLen:int

the length of the input

Returns:int

the output size

doFinalback to summary
public byte[] doFinal(byte[] input, int inOff, int inLen) throws BadPaddingException

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.doFinal.

Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized.

Parameters
input:byte[]

the input buffer

inOff:int

the offset in input where the input starts

inLen:int

the input length

Returns:byte[]

the new buffer with the result

Exceptions
BadPaddingException:
if this cipher is in decryption mode, and (un)padding has been requested, but the decrypted data is not bounded by the appropriate padding bytes
encryptOutputSizeback to summary
protected int encryptOutputSize(int inLen)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.encryptOutputSize.

Doc from org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.encryptOutputSize.

Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in encryption mode when given input of the specified length.

Parameters
inLen:int

the length of the input

Returns:int

the output size

getKeySizeback to summary
public int getKeySize(Key key) throws InvalidKeyException

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.CipherSpiExt.getKeySize.

Doc from org.bouncycastle.pqc.jcajce.provider.util.CipherSpiExt.getKeySize.

Return the key size of the given key object in bits.

Parameters
key:Key

the key object

Returns:int

the key size in bits of the given key object

Exceptions
InvalidKeyException:
if key is invalid.
getNameback to summary
public String getName()

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.CipherSpiExt.getName.

Returns:String

Doc from org.bouncycastle.pqc.jcajce.provider.util.CipherSpiExt.getName.

the name of this cipher

initCipherDecryptback to summary
protected void initCipherDecrypt(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.initCipherDecrypt.

Doc from org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.initCipherDecrypt.

Initialize the AsymmetricHybridCipher with a certain key for data encryption.

Parameters
key:Key

the key which has to be used to decrypt data

params:AlgorithmParameterSpec

the algorithm parameters

Exceptions
InvalidKeyException:
if the given key is inappropriate for initializing this cipher
InvalidAlgorithmParameterException:
if the given parameters are inappropriate for initializing this cipher.
initCipherEncryptback to summary
protected void initCipherEncrypt(Key key, AlgorithmParameterSpec params, SecureRandom sr) throws InvalidKeyException, InvalidAlgorithmParameterException

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.initCipherEncrypt.

Doc from org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.initCipherEncrypt.

Initialize the AsymmetricHybridCipher with a certain key for data encryption.

Parameters
key:Key

the key which has to be used to encrypt data

params:AlgorithmParameterSpec

the algorithm parameters

sr:SecureRandom

the source of randomness

Exceptions
InvalidKeyException:
if the given key is inappropriate for initializing this cipher.
InvalidAlgorithmParameterException:
if the given parameters are inappropriate for initializing this cipher.
padback to summary
private byte[] pad()

Pad and return the message stored in the message buffer.

Returns:byte[]

the padded message

unpadback to summary
private byte[] unpad(byte[] pmBytes) throws BadPaddingException

Unpad a message.

Parameters
pmBytes:byte[]

the padded message

Returns:byte[]

the message

Exceptions
BadPaddingException:
if the padded message is invalid.
updateback to summary
public byte[] update(byte[] input, int inOff, int inLen)

Implements abstract org.bouncycastle.pqc.jcajce.provider.util.AsymmetricHybridCipher.update.

Continue a multiple-part encryption or decryption operation.

Parameters
input:byte[]

byte array containing the next part of the input

inOff:int

index in the array where the input starts

inLen:int

length of the input

Returns:byte[]

the processed byte array.

org.bouncycastle.pqc.jcajce.provider.mceliece back to summary

public Class McElieceKobaraImaiCipherSpi.McElieceKobaraImai

extends McElieceKobaraImaiCipherSpi
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi:
decryptOutputSizedoFinalencryptOutputSizegetKeySizegetNameinitCipherDecryptinitCipherEncryptupdate

Constructor Detail

McElieceKobaraImaiback to summary
public McElieceKobaraImai()
org.bouncycastle.pqc.jcajce.provider.mceliece back to summary

public Class McElieceKobaraImaiCipherSpi.McElieceKobaraImai224

extends McElieceKobaraImaiCipherSpi
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi:
decryptOutputSizedoFinalencryptOutputSizegetKeySizegetNameinitCipherDecryptinitCipherEncryptupdate

Constructor Detail

McElieceKobaraImai224back to summary
public McElieceKobaraImai224()
org.bouncycastle.pqc.jcajce.provider.mceliece back to summary

public Class McElieceKobaraImaiCipherSpi.McElieceKobaraImai256

extends McElieceKobaraImaiCipherSpi
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi:
decryptOutputSizedoFinalencryptOutputSizegetKeySizegetNameinitCipherDecryptinitCipherEncryptupdate

Constructor Detail

McElieceKobaraImai256back to summary
public McElieceKobaraImai256()
org.bouncycastle.pqc.jcajce.provider.mceliece back to summary

public Class McElieceKobaraImaiCipherSpi.McElieceKobaraImai384

extends McElieceKobaraImaiCipherSpi
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi:
decryptOutputSizedoFinalencryptOutputSizegetKeySizegetNameinitCipherDecryptinitCipherEncryptupdate

Constructor Detail

McElieceKobaraImai384back to summary
public McElieceKobaraImai384()
org.bouncycastle.pqc.jcajce.provider.mceliece back to summary

public Class McElieceKobaraImaiCipherSpi.McElieceKobaraImai512

extends McElieceKobaraImaiCipherSpi
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.bouncycastle.pqc.jcajce.provider.mceliece.McElieceKobaraImaiCipherSpi:
decryptOutputSizedoFinalencryptOutputSizegetKeySizegetNameinitCipherDecryptinitCipherEncryptupdate

Constructor Detail

McElieceKobaraImai512back to summary
public McElieceKobaraImai512()