Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.09 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.09 KB

Lamport

A Go package implementing Lamport signatures

Build Status codecov GoDoc

Lamport signatures are a one-time signature scheme. Each key is intended to be used only once.

Usage

Generate key

k, err := lamport.GenerateKey(rand.Reader, crypto.SHA256)

Sign message

message := []byte("Hello, Lamport!")
messageHash := sha256.Sum256(message)

sig, _ := lamport.Sign(k, messageHash[:])

Verify signature

if lamport.Verify(&k.PublicKey, messageHash[:], sig); err != nil {
    // signature invalid here
}

Testing & Benchmarking

To test on your machine use:

go test

If you want to run the benchmarks:

go test -bench=.

Documentation

Documentation can be found here.