Class FrodoAlgorithm


public final class FrodoAlgorithm extends AbstractCryptoAlgorithm

Frodo Key Encapsulation Mechanism (KEM)

Implementation of the FrodoKEM post-quantum algorithm, registered as a CryptoAlgorithm within ZeroEcho.

FrodoKEM is a lattice-based key encapsulation mechanism designed to resist quantum adversaries. It is based on the hardness of the Learning With Errors (LWE) problem, avoiding reliance on structured lattices. This provides conservative security at the cost of relatively large key sizes compared to schemes such as Kyber.

Capabilities

Key Management

  • Key generation is parameterized by FrodoKeyGenSpec, which selects a concrete variant such as FRODO_976_AES or FRODO_1344_SHAKE.
  • Public keys may be imported from FrodoPublicKeySpec using an X.509 encoding.
  • Private keys may be imported from FrodoPrivateKeySpec using a PKCS#8 encoding.
  • Generation and public/private import are registered as independent exact capabilities.

Provider requirements

FrodoKEM operations are delegated to the BouncyCastle provider (BC). The static method ensureProvider() verifies that the provider is installed; otherwise, a NoSuchProviderException is thrown.

Example usage

// Generate a Frodo keypair
CryptoAlgorithm frodo = CryptoAlgorithms.require("Frodo");
KeyPair kp = frodo.asymmetricKeyPairGenerator(FrodoKeyGenSpec.class)
                  .generateKeyPair(FrodoKeyGenSpec.frodo1344aes());

// Encapsulate using the recipient's public key
KemContext enc = frodo.createContext(KeyUsage.ENCAPSULATE, kp.getPublic(), VoidSpec.INSTANCE);

// Decapsulate using the recipient's private key
KemContext dec = frodo.createContext(KeyUsage.DECAPSULATE, kp.getPrivate(), VoidSpec.INSTANCE);

Thread-safety

Instances of FrodoAlgorithm are immutable and may be shared safely across threads. Contexts created via capabilities are not guaranteed to be thread-safe.

Since:
1.0
  • Constructor Details

  • Method Details

    • parameterSets

      public List<ParameterSetDescriptor<? extends AlgorithmKeySpec>> parameterSets()
      Description copied from class: CryptoAlgorithm
      Returns the discoverable parameter sets (or parameterized templates) supported by this algorithm.

      Callers (UIs, provisioning tools, policy engines) use this list to present users with valid, named key-generation options without prior knowledge of the concrete algorithm. Each entry is either a pre-built ParameterSetDescriptor.Concrete (ready spec) or a ParameterSetDescriptor.Template (user-supplied arguments produce the spec).

      The default implementation returns an empty list. Algorithms with finite, enumerable parameter sets should override this method. Overrides must return immutable lists in stable order, with unique nonblank descriptor identifiers. Registry loading validates a snapshot; external providers remain responsible for maintaining the contract on subsequent calls. Implementations may use ParameterSetDescriptor.snapshot(List) to validate and copy their list.

      Overrides:
      parameterSets in class CryptoAlgorithm
      Returns:
      immutable list of parameter set descriptors; never null