Package org.bouncycastle.pqc.crypto.mceliece

## Class McElieceKobaraImaiCipher

- java.lang.Object
- - org.bouncycastle.pqc.crypto.mceliece.McElieceKobaraImaiCipher

- All Implemented Interfaces:
    `MessageEncryptor`

      public class McElieceKobaraImaiCipher
      extends java.lang.Object
      implements 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 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.
    `static byte[]` | `PUBLIC_CONSTANT` | A predetermined public constant.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `McElieceKobaraImaiCipher()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getKeySize​(McElieceCCA2KeyParameters key)` | Return the key size of the given key object.
    `void` | `init​(boolean forEncryption, CipherParameters param)` |
    `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

    - #### PUBLIC_CONSTANT

          public static final byte[] PUBLIC_CONSTANT

      A predetermined public constant.

  - ### Constructor Detail

    - #### McElieceKobaraImaiCipher

          public McElieceKobaraImaiCipher()

  - ### Method Detail

    - #### init

          public void init​(boolean forEncryption,
                           CipherParameters param)

      Specified by:
        `init` in interface `MessageEncryptor`
      Parameters:
        `forEncryption` - true if we are encrypting a signature, false otherwise.
        `param` - key parameters for encryption or decryption.

    - #### getKeySize

          public int getKeySize​(McElieceCCA2KeyParameters key)

      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 interface `MessageEncryptor`
      Parameters:
        `input` - the message to be signed.

    - #### messageDecrypt

          public byte[] messageDecrypt​(byte[] input)
                                throws InvalidCipherTextException

      Specified by:
        `messageDecrypt` in interface `MessageEncryptor`
      Parameters:
        `input` - the cipher text of the message
      Throws:
        `InvalidCipherTextException`