class MLKEMEngine extends Object
| Modifier and Type | Field and Description |
|---|---|
static int | KyberNKyber N parameter |
static int | KyberPolyBytesKyber polynomial bytes |
static int | KyberQKyber Q parameter |
static int | KyberQinvKyber Q inverse parameter |
static int | KyberSymBytesNumber of bytes for Hashes and Seeds |
| Constructor and Description |
|---|
MLKEMEngine(int k) |
| Modifier and Type | Method and Description |
|---|---|
byte[][] | generateKemKeyPair() |
byte[][] | generateKemKeyPairInternal(byte[] d,
byte[] z) |
int | getCryptoBytes() |
int | getCryptoCipherTextBytes() |
int | getCryptoPublicKeyBytes() |
int | getCryptoSecretKeyBytes() |
int | getKyberCipherTextBytes() |
int | getKyberEta1() |
static int | getKyberEta2() |
int | getKyberIndCpaBytes() |
static int | getKyberIndCpaMsgBytes() |
int | getKyberIndCpaPublicKeyBytes() |
int | getKyberIndCpaSecretKeyBytes() |
int | getKyberK() |
int | getKyberPolyCompressedBytes() |
int | getKyberPolyVecBytes() |
int | getKyberPolyVecCompressedBytes() |
int | getKyberPublicKeyBytes() |
int | getKyberSecretKeyBytes() |
void | getRandomBytes(byte[] buf) |
Symmetric | getSymmetric() |
void | init(SecureRandom random) |
byte[] | kemDecrypt(byte[] secretKey,
byte[] cipherText) |
byte[] | kemDecryptInternal(byte[] secretKey,
byte[] cipherText) |
byte[][] | kemEncrypt(byte[] publicKeyInput,
byte[] randBytes) |
byte[][] | kemEncryptInternal(byte[] publicKeyInput,
byte[] randBytes) |
public static final int KyberN
public static final int KyberPolyBytes
public static final int KyberQ
public static final int KyberQinv
public static final int KyberSymBytes
public MLKEMEngine(int k)
k - the security parameter (2, 3, or 4)public byte[][] generateKemKeyPair()
public byte[][] generateKemKeyPairInternal(byte[] d,
byte[] z)d - seedz - seedpublic int getCryptoBytes()
public int getCryptoCipherTextBytes()
public int getCryptoPublicKeyBytes()
public int getCryptoSecretKeyBytes()
public int getKyberCipherTextBytes()
public int getKyberEta1()
public static int getKyberEta2()
public int getKyberIndCpaBytes()
public static int getKyberIndCpaMsgBytes()
public int getKyberIndCpaPublicKeyBytes()
public int getKyberIndCpaSecretKeyBytes()
public int getKyberK()
public int getKyberPolyCompressedBytes()
public int getKyberPolyVecBytes()
public int getKyberPolyVecCompressedBytes()
public int getKyberPublicKeyBytes()
public int getKyberSecretKeyBytes()
public void getRandomBytes(byte[] buf)
buf - the buffer to fillpublic Symmetric getSymmetric()
public void init(SecureRandom random)
random - the secure randompublic byte[] kemDecrypt(byte[] secretKey,
byte[] cipherText)secretKey - the secret keycipherText - the ciphertextpublic byte[] kemDecryptInternal(byte[] secretKey,
byte[] cipherText)secretKey - the secret keycipherText - the ciphertextpublic byte[][] kemEncrypt(byte[] publicKeyInput,
byte[] randBytes)publicKeyInput - the public keyrandBytes - random bytespublic byte[][] kemEncryptInternal(byte[] publicKeyInput,
byte[] randBytes)publicKeyInput - the public keyrandBytes - random bytes