Class SlhDsaKeyGenSpec
java.lang.Object
zeroecho.core.alg.slhdsa.SlhDsaKeyGenSpec
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSLH-DSA hash families (FIPS 205).static enumOptional pre-hash variant selection.static enumSecurity levels as defined by NIST PQC (L1, L3, L5).static enumVariant trading performance against signature size. -
Method Summary
Modifier and TypeMethodDescriptionstatic SlhDsaKeyGenSpecReturns the default SLH-DSA key generation spec.Returns the explicit parameter constant override, if set.hash()Returns the SLH-DSA hash family.static SlhDsaKeyGenSpecof(String providerName, SlhDsaKeyGenSpec.Hash hash, SlhDsaKeyGenSpec.Security security, SlhDsaKeyGenSpec.Variant variant, SlhDsaKeyGenSpec.PreHash preHash) Creates a new specification with explicit algorithm parameters.preHash()Returns the pre-hash selection.Returns the provider name used for key generation.security()Returns the security level.variant()Returns the variant.Returns a copy of this specification with an explicit Bouncy Castle parameter constant override.
-
Method Details
-
defaultSpec
Returns the default SLH-DSA key generation spec.- Returns:
- a singleton default specification (SHAKE, L5, SMALL, no pre-hash)
-
of
public static SlhDsaKeyGenSpec of(String providerName, SlhDsaKeyGenSpec.Hash hash, SlhDsaKeyGenSpec.Security security, SlhDsaKeyGenSpec.Variant variant, SlhDsaKeyGenSpec.PreHash preHash) 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 levelvariant- variant (FAST vs SMALL)preHash- optional pre-hash selection- Returns:
- a new
SlhDsaKeyGenSpec
-
withExplicitParamConstant
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 inSLHDSAParameterSpec- Returns:
- a new
SlhDsaKeyGenSpecwith the override
-
providerName
Returns the provider name used for key generation.- Returns:
- provider name (never
null)
-
hash
-
security
-
variant
-
preHash
Returns the pre-hash selection.- Returns:
- pre-hash selection
-
explicitParamConstant
Returns the explicit parameter constant override, if set.- Returns:
- constant name, or
nullif automatic mapping is used
-