Class CMCEEngine

java.lang.Object
org.bouncycastle.crypto.kems.cmce.CMCEEngine

public class CMCEEngine extends Object
The Classic McEliece KEM as standardised in ISO/IEC 18033-2:2006/Amd 2:2026, Clause 13. A single engine implements both the non-pc construction (Encapsulation 13.12.2 / Decapsulation 13.13.2) and the pc ("plaintext confirmation") construction (13.12.3 / 13.13.3), selected by the pc flag: when pc, a 32-byte confirmation C1 = Hash(2, e) is appended to the ciphertext and the session key is hashed over the full C0 || C1. The semi-systematic "f" key-generation variant is selected by the usePivots flag.
  • Method Details

    • getPrivateKeySize

      public int getPrivateKeySize()
    • getPublicKeySize

      public int getPublicKeySize()
    • getCipherTextSize

      public int getCipherTextSize()
    • getInstance

      public static CMCEEngine getInstance(CMCEParameters params)
    • kem_keypair

      public void kem_keypair(byte[] pk, byte[] sk, SecureRandom random)
    • kem_enc

      public int kem_enc(byte[] cipher_text, byte[] key, byte[] pk, SecureRandom random)
    • kem_dec

      public int kem_dec(byte[] key, byte[] cipher_text, byte[] sk)
    • getSessionKeySize

      public int getSessionKeySize()