Interface KeyEncapsulationMethod.Client

All Known Implementing Classes:
SNTRUP761.Client
Enclosing interface:
KeyEncapsulationMethod

public static interface KeyEncapsulationMethod.Client
Client-side KEM operations.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    extractSecret(byte[] encapsulated)
    Extracts the secret from an encapsulation ciphertext.
    int
    Gets the required encapsulation length in bytes.
    byte[]
    Gets the KEM public key.
    void
    Initializes the KEM and generates a new key pair.
  • Method Details

    • init

      void init()
      Initializes the KEM and generates a new key pair.
    • getPublicKey

      byte[] getPublicKey()
      Gets the KEM public key.
      Returns:
      the KEM public key.
    • extractSecret

      byte[] extractSecret(byte[] encapsulated)
      Extracts the secret from an encapsulation ciphertext.
      Parameters:
      encapsulated - ciphertext to process.
      Returns:
      the secret from an encapsulation ciphertext.
      Throws:
      IllegalArgumentException - if encapsulated doesn't have the expected length
      NullPointerException - if encapsulated == null
    • getEncapsulationLength

      int getEncapsulationLength()
      Gets the required encapsulation length in bytes.
      Returns:
      the length required for a valid encapsulation ciphertext.