Class McElieceFujisakiCipher
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.mceliece.McElieceFujisakiCipher
-
- All Implemented Interfaces:
MessageEncryptor
public class McElieceFujisakiCipher extends java.lang.Object implements MessageEncryptor
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 the development of the McEliece Cryptosystem", technical report.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OID
The OID of the algorithm.
-
Constructor Summary
Constructors Constructor Description McElieceFujisakiCipher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getKeySize(McElieceCCA2KeyParameters key)
void
init(boolean forEncryption, CipherParameters param)
byte[]
messageDecrypt(byte[] input)
byte[]
messageEncrypt(byte[] input)
-
-
-
Field Detail
-
OID
public static final java.lang.String OID
The OID of the algorithm.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(boolean forEncryption, CipherParameters param)
- Specified by:
init
in interfaceMessageEncryptor
- Parameters:
forEncryption
- true if we are encrypting a signature, false otherwise.param
- key parameters for encryption or decryption.
-
getKeySize
public int getKeySize(McElieceCCA2KeyParameters key) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
messageEncrypt
public byte[] messageEncrypt(byte[] input)
- Specified by:
messageEncrypt
in interfaceMessageEncryptor
- Parameters:
input
- the message to be signed.
-
messageDecrypt
public byte[] messageDecrypt(byte[] input) throws InvalidCipherTextException
- Specified by:
messageDecrypt
in interfaceMessageEncryptor
- Parameters:
input
- the cipher text of the message- Throws:
InvalidCipherTextException
-
-