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

public Class McElieceFujisakiCipher

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 Fujisaki/Okamoto conversion of the McEliecePKCS. Fujisaki and Okamoto propose hybrid encryption that merges a symmetric encryption scheme which is secure in the find-guess model with an asymmetric one-way encryption scheme which is sufficiently probabilistic to obtain a public key cryptosystem which is CCA2-secure. 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 static final String
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
public int
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

DEFAULT_PRNG_NAMEback to summary
private static final String DEFAULT_PRNG_NAME
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

McElieceFujisakiCipherback to summary
public McElieceFujisakiCipher()

Method Detail

getKeySizeback to summary
public int getKeySize(McElieceCCA2KeyParameters key) throws IllegalArgumentException
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.