Top Description Fields Constructors Methods
org.bouncycastle.pqc.legacy.crypto.mceliece

public Class McEliecePointchevalCipher

extends Object
implements MessageEncryptor
Class Inheritance
All Implemented Interfaces
org.bouncycastle.pqc.crypto.MessageEncryptor
Imports
java.security.SecureRandom, org.bouncycastle.crypto.CipherParameters, .CryptoServicesRegistrar, .Digest, .InvalidCipherTextException, org.bouncycastle.crypto.digests.SHA1Digest, org.bouncycastle.crypto.params.ParametersWithRandom, org.bouncycastle.crypto.prng.DigestRandomGenerator, org.bouncycastle.pqc.crypto.MessageEncryptor, org.bouncycastle.pqc.legacy.math.linearalgebra.ByteUtils, .GF2Vector

This class implements the Pointcheval conversion of the McEliecePKCS. Pointcheval presents a generic technique to make a CCA2-secure cryptosystem from any partially trapdoor one-way function in the random oracle model. For details, see D. Engelbert, R. Overbeck, A. Schmidt, "A Summary of McEliece-Type Cryptosystems and their Security", technical report. https://www.degruyter.com/document/doi/10.1515/JMC.2007.009/html

Field Summary

Modifier and TypeField and Description
private boolean
private int
k

The McEliece main parameters

pack-priv McElieceCCA2KeyParameters
private Digest
private int
n

The McEliece main parameters

public static final String
OID

The OID of the algorithm.

private SecureRandom
private int
t

The McEliece main parameters

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected int
decryptOutputSize(int inLen)

protected int
encryptOutputSize(int inLen)

public int

Returns:

the key size of the given key object
getKeySize
(McElieceCCA2KeyParameters
the McElieceCCA2KeyParameters object
key
)

Return the key size of the given key object.

public void
init(boolean
true if we are encrypting a signature, false otherwise.
forEncryption
,
CipherParameters
key parameters for encryption or decryption.
param
)

Implements org.bouncycastle.pqc.crypto.MessageEncryptor.init.

private void
private void
public byte[]
messageDecrypt(byte[]
the cipher text of the message
input
)

Implements org.bouncycastle.pqc.crypto.MessageEncryptor.messageDecrypt.

public byte[]
messageEncrypt(byte[]
the message to be signed.
input
)

Implements org.bouncycastle.pqc.crypto.MessageEncryptor.messageEncrypt.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

forEncryptionback to summary
private boolean forEncryption
kback to summary
private int k

The McEliece main parameters

keyback to summary
pack-priv McElieceCCA2KeyParameters key
messDigestback to summary
private Digest messDigest
nback to summary
private int n

The McEliece main parameters

OIDback to summary
public static final String OID

The OID of the algorithm.

srback to summary
private SecureRandom sr
tback to summary
private int t

The McEliece main parameters

Constructor Detail

McEliecePointchevalCipherback to summary
public McEliecePointchevalCipher()

Method Detail

decryptOutputSizeback to summary
protected int decryptOutputSize(int inLen)
encryptOutputSizeback to summary
protected int encryptOutputSize(int inLen)
getKeySizeback to summary
public int getKeySize(McElieceCCA2KeyParameters key) throws IllegalArgumentException

Return the key size of the given key object.

Parameters
key:McElieceCCA2KeyParameters

the McElieceCCA2KeyParameters object

Returns:int

the key size of the given key object

Exceptions
IllegalArgumentException:
if the key is invalid
initback to summary
public void init(boolean forEncryption, CipherParameters param)

Implements org.bouncycastle.pqc.crypto.MessageEncryptor.init.

Parameters
forEncryption:boolean

Doc from org.bouncycastle.pqc.crypto.MessageEncryptor.init.

true if we are encrypting a signature, false otherwise.

param:CipherParameters

Doc from org.bouncycastle.pqc.crypto.MessageEncryptor.init.

key parameters for encryption or decryption.

initCipherDecryptback to summary
private void initCipherDecrypt(McElieceCCA2PrivateKeyParameters privKey)
initCipherEncryptback to summary
private void initCipherEncrypt(McElieceCCA2PublicKeyParameters pubKey)
messageDecryptback to summary
public byte[] messageDecrypt(byte[] input) throws InvalidCipherTextException

Implements org.bouncycastle.pqc.crypto.MessageEncryptor.messageDecrypt.

Parameters
input:byte[]

Doc from org.bouncycastle.pqc.crypto.MessageEncryptor.messageDecrypt.

the cipher text of the message

messageEncryptback to summary
public byte[] messageEncrypt(byte[] input)

Implements org.bouncycastle.pqc.crypto.MessageEncryptor.messageEncrypt.

Parameters
input:byte[]

Doc from org.bouncycastle.pqc.crypto.MessageEncryptor.messageEncrypt.

the message to be signed.