pub struct SigningKey { /* private fields */ }Expand description
Private signing key for
SLH-DSA-SHAKE-192s (automatically zeroized on drop, redacted in Debug).
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Parses a signing key from its exact 4n-byte encoding
(SK.seed || SK.prf || PK.seed || PK.root).
Sourcepub fn expose_bytes(&self) -> &[u8; 96]
pub fn expose_bytes(&self) -> &[u8; 96]
Exposes the raw 4n-byte signing key (handle with extreme care!).
Sourcepub const fn zeroed() -> Self
pub const fn zeroed() -> Self
Returns an all-zero placeholder signing key for in-place heap initialization without stack-to-heap secret moves.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Extracts the embedded 2n-byte verifying key (PK.seed || PK.root).
Sourcepub fn sign_into<R: CryptoRng + ?Sized>(
&self,
msg: &[u8],
ctx: &[u8],
rng: &mut R,
sig_out: &mut [u8; 16224],
) -> Result<()>
pub fn sign_into<R: CryptoRng + ?Sized>( &self, msg: &[u8], ctx: &[u8], rng: &mut R, sig_out: &mut [u8; 16224], ) -> Result<()>
Signs msg with context ctx directly into caller-owned sig_out (hedged mode).
Sourcepub fn sign<R: CryptoRng + ?Sized>(
&self,
msg: &[u8],
ctx: &[u8],
rng: &mut R,
) -> Result<Signature>
pub fn sign<R: CryptoRng + ?Sized>( &self, msg: &[u8], ctx: &[u8], rng: &mut R, ) -> Result<Signature>
Signs msg with context ctx using fresh randomness (hedged mode, FIPS 205 Alg. 22).
Sourcepub fn sign_deterministic_into(
&self,
msg: &[u8],
ctx: &[u8],
sig_out: &mut [u8; 16224],
) -> Result<()>
pub fn sign_deterministic_into( &self, msg: &[u8], ctx: &[u8], sig_out: &mut [u8; 16224], ) -> Result<()>
Signs msg with context ctx directly into sig_out in deterministic mode (opt_rand = PK.seed).
Sourcepub fn sign_deterministic(&self, msg: &[u8], ctx: &[u8]) -> Result<Signature>
pub fn sign_deterministic(&self, msg: &[u8], ctx: &[u8]) -> Result<Signature>
Signs msg with context ctx in deterministic mode (opt_rand = PK.seed).