1
- # Leighton-Micali Hash-Based Signatures
1
+ # [ RustCrypto] : Leighton-Micali Signatures
2
+
3
+ [ ![ crate] [ crate-image ]] [ crate-link ]
4
+ [ ![ Docs] [ docs-image ]] [ docs-link ]
5
+ [ ![ Build Status] [ build-image ]] [ build-link ]
6
+ ![ Apache2/MIT licensed] [ license-image ]
7
+ ![ MSRV] [ rustc-image ]
8
+ [ ![ Project Chat] [ chat-image ]] [ chat-link ]
2
9
3
10
This repository contains implementations of [ Leighton-Micali Hash-Based
4
11
Signatures (RFC 8554)] ( https://datatracker.ietf.org/doc/html/rfc8554 ) .
@@ -17,10 +24,9 @@ persistent storage after each signature is generated and before it is released
17
24
to the rest of the application. Failure to adhere to this requirement is a
18
25
security vulnerability in your application.
19
26
20
- For a stateless hash-based signature algorithm, see
21
- [ SPHINCS+] ( https://sphincs.org ) .
27
+ For a stateless hash-based signature algorithm, see [ SLH-DSA] .
22
28
23
- NOTE: this project has not been externally audited, but the entire codebase
29
+ NOTE: this project has not been externally audited, but the entire codebase
24
30
was internally reviewed by cryptographers at Trail of Bits.
25
31
26
32
## Installation
@@ -35,10 +41,10 @@ Our implementation uses strongly typed private and public key types.
35
41
36
42
``` rust
37
43
let mut rng = thread_rng ();
38
- let mut seckey = lms :: lms :: PrivateKey :: new :: <LmsSha256M32H10 <LmsOtsSha256N32W4 >>( & mut rng );
44
+ let mut seckey = lms :: lms :: PrivateKey :: new :: <LmsSha256M32H10 <LmsOtsSha256N32W4 > > ( & mut rng );
39
45
let pubkey = seckey . public (); // of type lms::lms::PublicKey<LmsSha256M32H10>
40
- let sig = seckey . try_sign_with_rng (& mut rng , " example" . as_bytes ()). unwrap ();
41
- let sig_valid = pubkey . verify (" example" . as_bytes (), & sig ). is_ok ();
46
+ let sig = seckey . try_sign_with_rng ( & mut rng , " example" . as_bytes ()). unwrap ();
47
+ let sig_valid = pubkey . verify (" example" . as_bytes (), & sig ). is_ok ();
42
48
```
43
49
44
50
We can generate LMOTS signatures in the same way using ` lms::ots::PrivateKey `
@@ -58,13 +64,31 @@ good**.
58
64
59
65
All crates licensed under either of
60
66
61
- * [ Apache License, Version 2.0] ( http://www.apache.org/licenses/LICENSE-2.0 )
62
- * [ MIT license] ( http://opensource.org/licenses/MIT )
67
+ * [ Apache License, Version 2.0] ( http://www.apache.org/licenses/LICENSE-2.0 )
68
+ * [ MIT license] ( http://opensource.org/licenses/MIT )
63
69
64
70
at your option.
65
71
66
72
## Contribution
67
73
68
74
Unless you explicitly state otherwise, any contribution intentionally submitted
69
75
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
70
- dual licensed as above, without any additional terms or conditions.
76
+ dual licensed as above, without any additional terms or conditions.
77
+
78
+ [ // ] : # ( badges )
79
+
80
+ [ crate-image ] : https://buildstats.info/crate/lms-signature
81
+ [ crate-link ] : https://crates.io/crates/lms-signature
82
+ [ docs-image ] : https://docs.rs/lms-signature/badge.svg
83
+ [ docs-link ] : https://docs.rs/lms-signature/
84
+ [ build-image ] : https://github.com/RustCrypto/signatures/actions/workflows/lms.yml/badge.svg
85
+ [ build-link ] : https://github.com/RustCrypto/signatures/actions/workflows/lms.yml
86
+ [ license-image ] : https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
87
+ [ rustc-image ] : https://img.shields.io/badge/rustc-1.73+-blue.svg
88
+ [ chat-image ] : https://img.shields.io/badge/zulip-join_chat-blue.svg
89
+ [ chat-link ] : https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures
90
+
91
+ [ // ] : # ( links )
92
+
93
+ [ RustCrypto ] : https://github.com/RustCrypto
94
+ [ SLH-DSA ] : https://github.com/RustCrypto/signatures/tree/master/slh-dsa
0 commit comments