Class McEliecePointchevalCipher
java.lang.Object
org.bouncycastle.pqc.legacy.crypto.mceliece.McEliecePointchevalCipher
- All Implemented Interfaces:
MessageEncryptor
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intdecryptOutputSize(int inLen) protected intencryptOutputSize(int inLen) intReturn the key size of the given key object.voidinit(boolean forEncryption, CipherParameters param) byte[]messageDecrypt(byte[] input) byte[]messageEncrypt(byte[] input)
-
Field Details
-
OID
The OID of the algorithm.- See Also:
-
-
Constructor Details
-
McEliecePointchevalCipher
public McEliecePointchevalCipher()
-
-
Method Details
-
init
- Specified by:
initin interfaceMessageEncryptor- Parameters:
forEncryption- true if we are encrypting a signature, false otherwise.param- key parameters for encryption or decryption.
-
getKeySize
Return the key size of the given key object.- Parameters:
key- the McElieceCCA2KeyParameters object- Returns:
- the key size of the given key object
- Throws:
IllegalArgumentException- if the key is invalid
-
decryptOutputSize
protected int decryptOutputSize(int inLen) -
encryptOutputSize
protected int encryptOutputSize(int inLen) -
messageEncrypt
public byte[] messageEncrypt(byte[] input) - Specified by:
messageEncryptin interfaceMessageEncryptor- Parameters:
input- the message to be signed.
-
messageDecrypt
- Specified by:
messageDecryptin interfaceMessageEncryptor- Parameters:
input- the cipher text of the message- Throws:
InvalidCipherTextException
-