Class SphincsPlusAlgorithm


public final class SphincsPlusAlgorithm extends AbstractCryptoAlgorithm
SPHINCS+ signature algorithm binding for the ZeroEcho framework.

SphincsPlusAlgorithm retains the SPHINCS+ identifier as a compatibility binding for pure SLH-DSA; legacy SPHINCS+ keys and ROBUST are unsupported. It registers signing and verification roles, along with asymmetric key builders for generation and import of SPHINCS+ key material.

Capabilities

Each role is bound to a SignatureContext created via SphincsPlusSignatureContext. Both roles are configured with a VoidSpec, as SPHINCS+ requires no runtime context parameters.

Key builders

Example

CryptoAlgorithm alg = new SphincsPlusAlgorithm();
KeyPair kp = alg.asymmetricKeyPairGenerator(SphincsPlusKeyGenSpec.class)
                .generateKeyPair(SphincsPlusKeyGenSpec.defaultSpec());

try (SignatureContext signer =
         alg.createContext(KeyUsage.SIGN, kp.getPrivate(), null)) {
    signer.update(message);
    byte[] sig = signer.sign();
}

try (SignatureContext verifier =
         alg.createContext(KeyUsage.VERIFY, kp.getPublic(), null)) {
    verifier.update(message);
    boolean ok = verifier.verify(sig);
}

Thread-safety

Instances of this class are immutable and can be shared across threads. The created SignatureContext objects are not 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