#[non_exhaustive]pub enum SignatureAlgorithm {
Show 26 variants
EcdsaP256Sha256,
EcdsaP384Sha384,
EcdsaP521Sha512,
Ed25519,
RsaPkcs1Sha256,
RsaPkcs1Sha384,
RsaPkcs1Sha512,
RsaPssSha256,
RsaPssSha384,
RsaPssSha512,
MlDsa44,
MlDsa65,
MlDsa87,
HssLms,
SlhDsaSha2_128s,
SlhDsaSha2_128f,
SlhDsaSha2_192s,
SlhDsaSha2_192f,
SlhDsaSha2_256s,
SlhDsaSha2_256f,
SlhDsaShake_128s,
SlhDsaShake_128f,
SlhDsaShake_192s,
SlhDsaShake_192f,
SlhDsaShake_256s,
SlhDsaShake_256f,
}Expand description
A signature algorithm: the key type and everything that goes with it.
Each names one entry in the ontology, by SignatureAlgorithm::id –
except the twelve SLH-DSA parameter sets, which share the entry slh-dsa
and are named as its sets are. RSA keys serve several of these; every other
key serves exactly one.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EcdsaP256Sha256
ECDSA over P-256 with SHA-256.
EcdsaP384Sha384
ECDSA over P-384 with SHA-384.
EcdsaP521Sha512
ECDSA over P-521 with SHA-512.
Ed25519
Ed25519.
RsaPkcs1Sha256
RSASSA-PKCS1-v1_5 with SHA-256.
RsaPkcs1Sha384
RSASSA-PKCS1-v1_5 with SHA-384.
RsaPkcs1Sha512
RSASSA-PKCS1-v1_5 with SHA-512.
RsaPssSha256
RSASSA-PSS with SHA-256, MGF1-SHA-256 and a 32-byte salt.
RsaPssSha384
RSASSA-PSS with SHA-384, MGF1-SHA-384 and a 48-byte salt.
RsaPssSha512
RSASSA-PSS with SHA-512, MGF1-SHA-512 and a 64-byte salt.
MlDsa44
ML-DSA-44 (FIPS 204), pure, with an empty context.
MlDsa65
ML-DSA-65 (FIPS 204), pure, with an empty context.
MlDsa87
ML-DSA-87 (FIPS 204), pure, with an empty context.
HssLms
HSS/LMS (RFC 8554, SP 800-208). The key names its own parameters, and the hash function with them.
SlhDsaSha2_128s
SLH-DSA-SHA2-128s (FIPS 205), pure, with an empty context.
SlhDsaSha2_128f
SLH-DSA-SHA2-128f (FIPS 205), pure, with an empty context.
SlhDsaSha2_192s
SLH-DSA-SHA2-192s (FIPS 205), pure, with an empty context.
SlhDsaSha2_192f
SLH-DSA-SHA2-192f (FIPS 205), pure, with an empty context.
SlhDsaSha2_256s
SLH-DSA-SHA2-256s (FIPS 205), pure, with an empty context.
SlhDsaSha2_256f
SLH-DSA-SHA2-256f (FIPS 205), pure, with an empty context.
SlhDsaShake_128s
SLH-DSA-SHAKE-128s (FIPS 205), pure, with an empty context.
SlhDsaShake_128f
SLH-DSA-SHAKE-128f (FIPS 205), pure, with an empty context.
SlhDsaShake_192s
SLH-DSA-SHAKE-192s (FIPS 205), pure, with an empty context.
SlhDsaShake_192f
SLH-DSA-SHAKE-192f (FIPS 205), pure, with an empty context.
SlhDsaShake_256s
SLH-DSA-SHAKE-256s (FIPS 205), pure, with an empty context.
SlhDsaShake_256f
SLH-DSA-SHAKE-256f (FIPS 205), pure, with an empty context.
Implementations§
Source§impl SignatureAlgorithm
impl SignatureAlgorithm
Sourcepub const ALL: &'static [SignatureAlgorithm]
pub const ALL: &'static [SignatureAlgorithm]
Every algorithm, for callers that enumerate them.
Sourcepub fn from_id(id: &str) -> Option<Self>
pub fn from_id(id: &str) -> Option<Self>
The algorithm an ontology identifier names, if it is one of these.
Sourcepub const fn max_signature_len(self) -> usize
pub const fn max_signature_len(self) -> usize
The longest signature the algorithm produces, in the encoding this module’s interface uses: a buffer this long always suffices.
ECDSA is the DER Ecdsa-Sig-Value, whose length varies with the
leading bits of r and s. RSA is for the largest modulus this
library accepts, 4096 bits. HSS/LMS is for the largest parameters RFC
8554 allows – eight levels, each a tree of height 25 at Winternitz
width 1 with a 256-bit hash – and most signatures are a small fraction
of it.