https://github.com/ureeves/lamport
  
  
    A Go package implementing Lamport signatures 
    https://github.com/ureeves/lamport
  
        Last synced: 8 months ago 
        JSON representation
    
A Go package implementing Lamport signatures
- Host: GitHub
- URL: https://github.com/ureeves/lamport
- Owner: ureeves
- License: mit
- Created: 2019-05-06T21:27:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-06T22:56:42.000Z (over 6 years ago)
- Last Synced: 2025-01-15T05:53:09.477Z (10 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE.txt
 
Awesome Lists containing this project
README
          # Lamport
## A Go package implementing Lamport signatures
[](https://travis-ci.org/ureeves/lamport)
[](https://codecov.io/gh/ureeves/lamport)
[](https://godoc.org/github.com/ureeves/lamport)
Lamport signatures are a one-time signature scheme. Each key is intended to be used only once.
### Usage
Generate key
``` Go
k, err := lamport.GenerateKey(rand.Reader, crypto.SHA256)
```
Sign message
``` Go
message := []byte("Hello, Lamport!")
messageHash := sha256.Sum256(message)
sig, _ := lamport.Sign(k, messageHash[:])
```
Verify signature
``` Go
if lamport.Verify(&k.PublicKey, messageHash[:], sig); err != nil {
    // signature invalid here
}
```
### Testing & Benchmarking
To test on your machine use:
``` Bash
go test
```
If you want to run the benchmarks:
``` Bash
go test -bench=.
```
### Documentation
Documentation can be found [here](https://godoc.org/github.com/ureeves/lamport).