Bouncy Castle Cryptography Library 1.48

org.bouncycastle.pqc.crypto.mceliece
Class McEliecePointchevalCipher

java.lang.Object
  extended by 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
static java.lang.String OID
          The OID of the algorithm.
 
Constructor Summary
McEliecePointchevalCipher()
           
 
Method Summary
protected  int decryptOutputSize(int inLen)
           
protected  int encryptOutputSize(int inLen)
           
 int getKeySize(McElieceCCA2KeyParameters key)
          Return the key size of the given key object.
 void init(boolean forSigning, CipherParameters param)
           
 void initCipherDecrypt(McElieceCCA2PrivateKeyParameters privKey)
           
 void initCipherEncrypt(McElieceCCA2PublicKeyParameters pubKey)
           
 byte[] messageDecrypt(byte[] input)
           
 byte[] messageEncrypt(byte[] input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OID

public static final java.lang.String OID
The OID of the algorithm.

See Also:
Constant Field Values
Constructor Detail

McEliecePointchevalCipher

public McEliecePointchevalCipher()
Method Detail

init

public void init(boolean forSigning,
                 CipherParameters param)
Specified by:
init in interface MessageEncryptor
Parameters:
forSigning - 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)

initCipherEncrypt

public void initCipherEncrypt(McElieceCCA2PublicKeyParameters pubKey)

initCipherDecrypt

public void initCipherDecrypt(McElieceCCA2PrivateKeyParameters privKey)

messageEncrypt

public byte[] messageEncrypt(byte[] input)
                      throws java.lang.Exception
Specified by:
messageEncrypt in interface MessageEncryptor
Parameters:
input - the message to be signed.
Throws:
java.lang.Exception

messageDecrypt

public byte[] messageDecrypt(byte[] input)
                      throws java.lang.Exception
Specified by:
messageDecrypt in interface MessageEncryptor
Parameters:
input - the cipher text of the message
Throws:
java.lang.Exception

Bouncy Castle Cryptography Library 1.48