
Lamport one-time signature keypair (native, SHA-256)
Source:R/crypto_pqc_extra.R
morie_crypto_lamport_keygen.RdThe textbook hash-based signature (Lamport 1979): 256 secret pairs
of 32 random bytes; the public key is their SHA-256 images.
Security reduces entirely to SHA-256 preimage resistance — a
post-quantum assumption — but each keypair signs EXACTLY ONE
message. Signing twice with the same key leaks enough secrets to
forge; morie_crypto_lamport_sign therefore refuses a
key it has already used in this session. For many-time hash-based
signatures use morie_crypto_slhdsa_keygen (SLH-DSA).
Value
An object of class morie_lamport_keypair: list with
pk (2 x 256 matrix of hex strings) and sk
(2 x 256 list matrix of raw secrets).
Examples
kp <- morie_crypto_lamport_keygen()
sig <- morie_crypto_lamport_sign(kp, "hello")
morie_crypto_lamport_verify(kp$pk, "hello", sig)
#> [1] TRUE