Interface KeyEncapsulationMethod.Server

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

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

    Modifier and Type
    Method
    Description
    byte[]
    Retrieves the encapsulation of the secret.
    byte[]
    Retrieves the secret.
    byte[]
    init(byte[] publicKey)
    Initializes the KEM with a public key received from a client and prepares an encapsulated secret.
  • Method Details

    • init

      byte[] init(byte[] publicKey)
      Initializes the KEM with a public key received from a client and prepares an encapsulated secret.
      Parameters:
      publicKey - data received from the client, expected to contain the public key at the start
      Returns:
      the remaining bytes of publicKey after the public key
      Throws:
      IllegalArgumentException - if publicKey does not have enough bytes for a valid public key
      NullPointerException - if publicKey == null
    • getSecret

      byte[] getSecret()
      Retrieves the secret.
      Returns:
      the secret, not encapsulated
    • getEncapsulation

      byte[] getEncapsulation()
      Retrieves the encapsulation of the secret.
      Returns:
      the encapsulation of the secret that may be sent to the client