Class McElieceKobaraImaiCipher
java.lang.Object
org.bouncycastle.pqc.legacy.crypto.mceliece.McElieceKobaraImaiCipher
- All Implemented Interfaces:
MessageEncryptor
This class implements the Kobara/Imai conversion of the McEliecePKCS. This is
a conversion of the McEliecePKCS 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 TypeFieldDescriptionstatic final String
The OID of the algorithm.static final byte[]
A predetermined public constant. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the key size of the given key object.void
init
(boolean forEncryption, CipherParameters param) byte[]
messageDecrypt
(byte[] input) byte[]
messageEncrypt
(byte[] input)
-
Field Details
-
OID
The OID of the algorithm.- See Also:
-
PUBLIC_CONSTANT
public static final byte[] PUBLIC_CONSTANTA predetermined public constant.
-
-
Constructor Details
-
McElieceKobaraImaiCipher
public McElieceKobaraImaiCipher()
-
-
Method Details
-
init
- Specified by:
init
in 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
-
messageEncrypt
public byte[] messageEncrypt(byte[] input) - Specified by:
messageEncrypt
in interfaceMessageEncryptor
- Parameters:
input
- the message to be signed.
-
messageDecrypt
- Specified by:
messageDecrypt
in interfaceMessageEncryptor
- Parameters:
input
- the cipher text of the message- Throws:
InvalidCipherTextException
-