Class McEliecePointchevalCipher
- java.lang.Object
-
- org.bouncycastle.pqc.crypto.mceliece.McEliecePointchevalCipher
-
- All Implemented Interfaces:
MessageEncryptor
public class McEliecePointchevalCipher extends java.lang.Object implements 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 the development of the McEliece Cryptosystem", technical report.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOIDThe OID of the algorithm.
-
Constructor Summary
Constructors Constructor Description McEliecePointchevalCipher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intdecryptOutputSize(int inLen)protected intencryptOutputSize(int inLen)intgetKeySize(McElieceCCA2KeyParameters key)Return the key size of the given key object.voidinit(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:
initin 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
Return the key size of the given key object.- Parameters:
key- the McElieceCCA2KeyParameters object- Returns:
- the key size of the given key object
- Throws:
java.lang.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
public byte[] messageDecrypt(byte[] input) throws InvalidCipherTextException- Specified by:
messageDecryptin interfaceMessageEncryptor- Parameters:
input- the cipher text of the message- Throws:
InvalidCipherTextException
-
-