Class SlhDsaKeyGenSpec

java.lang.Object
zeroecho.core.alg.slhdsa.SlhDsaKeyGenSpec
All Implemented Interfaces:
AlgorithmKeySpec

public final class SlhDsaKeyGenSpec extends Object implements AlgorithmKeySpec
Specification for generating SLH-DSA key pairs (FIPS 205).

SLH-DSA is parameterized by hash family (SHA2 or SHAKE), a security strength (128/192/256), and a variant (fast vs small). Additionally, Bouncy Castle exposes pre-hash variants (e.g., "with SHA-256") as separate parameter specs.

This spec intentionally restricts the available choices to SLH-DSA parameters (i.e., no Haraka and no SPHINCS+ "simple/robust" split).

Since:
1.0
  • Method Details

    • defaultSpec

      public static SlhDsaKeyGenSpec defaultSpec()
      Returns the default SLH-DSA key generation spec.
      Returns:
      a singleton default specification (SHAKE, L5, SMALL, no pre-hash)
    • of

      Creates a new specification with explicit algorithm parameters.
      Parameters:
      providerName - JCA provider name (e.g., "BC", "BCPQC")
      hash - hash family (SHA2 or SHAKE)
      security - security level
      variant - variant (FAST vs SMALL)
      preHash - optional pre-hash selection
      Returns:
      a new SlhDsaKeyGenSpec
    • withExplicitParamConstant

      public SlhDsaKeyGenSpec withExplicitParamConstant(String name)
      Returns a copy of this specification with an explicit Bouncy Castle parameter constant override.

      This bypasses automatic mapping. The name must match a static field in org.bouncycastle.jcajce.spec.SLHDSAParameterSpec.

      Parameters:
      name - field name in SLHDSAParameterSpec
      Returns:
      a new SlhDsaKeyGenSpec with the override
    • providerName

      public String providerName()
      Returns the provider name used for key generation.
      Returns:
      provider name (never null)
    • hash

      public SlhDsaKeyGenSpec.Hash hash()
      Returns the SLH-DSA hash family.
      Returns:
      hash family
    • security

      public SlhDsaKeyGenSpec.Security security()
      Returns the security level.
      Returns:
      security level
    • variant

      public SlhDsaKeyGenSpec.Variant variant()
      Returns the variant.
      Returns:
      variant
    • preHash

      public SlhDsaKeyGenSpec.PreHash preHash()
      Returns the pre-hash selection.
      Returns:
      pre-hash selection
    • explicitParamConstant

      public String explicitParamConstant()
      Returns the explicit parameter constant override, if set.
      Returns:
      constant name, or null if automatic mapping is used