Skip to contents

Verify a Lamport one-time signature (native)

Usage

morie_crypto_lamport_verify(pk, message, signature)

Arguments

pk

The 2 x 256 hex public-key matrix.

message

Raw vector or single string.

signature

From morie_crypto_lamport_sign.

Value

TRUE if every revealed secret hashes to the committed public value selected by the message digest bits.

Examples

if (morie_crypto_sodium_available()) {
  kp <- morie_crypto_lamport_keygen()
  sig <- morie_crypto_lamport_sign(kp, "the die is cast")
  print(morie_crypto_lamport_verify(kp$pk, "the die is cast", sig))
  print(morie_crypto_lamport_verify(kp$pk, "tampered message", sig))
}
#> [1] TRUE
#> [1] FALSE