net.i2p.router.crypto.pqc

## Class MLKEM

- java.lang.Object
- - net.i2p.router.crypto.pqc.MLKEM

-     public final class MLKEM
      extends Object

  Wrapper around bouncycastle

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static KeyFactory` | `MLKEM1024KeyFactory`
    `static KeyFactory` | `MLKEM512KeyFactory` all non-threaded for now
    `static KeyFactory` | `MLKEM768KeyFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MLKEM()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static byte[]` | `decaps(EncType type, byte[] ciphertext, byte[] decapkey)` Alice side Note that this will not fail???
    `static byte[][]` | `encaps(EncType type, byte[] pub)` Bob side
    `static byte[][]` | `generateKeys(EncType type)` Alice side
    `static KeyPair` | `getKeys(EncType type)` Alice side

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MLKEM1024KeyFactory

          public static final KeyFactory MLKEM1024KeyFactory

    - #### MLKEM512KeyFactory

          public static final KeyFactory MLKEM512KeyFactory

      all non-threaded for now

    - #### MLKEM768KeyFactory

          public static final KeyFactory MLKEM768KeyFactory

  - ### Constructor Detail

    - #### MLKEM

          public MLKEM()

  - ### Method Detail

    - #### decaps

          public static byte[] decaps(EncType type,
                                      byte[] ciphertext,
                                      byte[] decapkey)
                               throws GeneralSecurityException

      Alice side Note that this will not fail???
      Returns:
        sharedkey, 32 bytes, non-null
      Throws:
        `GeneralSecurityException`

    - #### encaps

          public static byte[][] encaps(EncType type,
                                        byte[] pub)
                                 throws GeneralSecurityException

      Bob side
      Returns:
        ciphertext sharedkey, non-null
      Throws:
        `GeneralSecurityException`

    - #### generateKeys

          public static byte[][] generateKeys(EncType type)
                                       throws GeneralSecurityException

      Alice side
      Parameters:
        `type` - must be one of the internal types MLKEM*_INT
      Returns:
        encapkey decapkey
      Throws:
        `GeneralSecurityException`

    - #### getKeys

          public static KeyPair getKeys(EncType type)
                                 throws GeneralSecurityException

      Alice side
      Parameters:
        `type` - must be one of the internal types MLKEM*_INT
      Returns:
        encapkey decapkey
      Throws:
        `GeneralSecurityException`