Skip to content

Commit 783b6e8

Browse files
rozbbpinkforest
andauthored
README changes for 2.0 (dalek-cryptography#275)
* Added items to changelog for 2.0 release * Removed unnecessary uses of std in doctests * Gated `Context` behind `digest` * Fixed noncompiling doctest when only `digest` is enabled * README feature flag list mostly done * Copied changelog to readme * Redid the malleability section in README * Added CONTRIBUTING.md * Bumped version number to 2.0.0-pre.0; small changes to README * Updated changelog for dalek-cryptography#277 * Added pem feature description Co-authored-by: pinkforest(she/her) <[email protected]>
1 parent 5190ad6 commit 783b6e8

10 files changed

+164
-157
lines changed

CHANGELOG.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,33 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## Unreleased
7+
Entries are listed in reverse chronological order per undeprecated major series.
88

9-
### Changes
10-
* Bumped MSRV from 1.41 to 1.60.0
11-
* Removed `ExpandedSecretKey` API ((#205)[https://github.com/dalek-cryptography/ed25519-dalek/pull/205])
12-
* Implemented `Clone` for `SigningKey`
9+
# 2.x series
10+
11+
## 2.0.0
12+
13+
### Breaking changes
14+
15+
* Bump MSRV from 1.41 to 1.60.0
16+
* Bump Rust edition
17+
* Bump `signature` dependency to 2.0
18+
* Make [curve25519-backend selection](https://github.com/dalek-cryptography/curve25519-dalek/#backends) more automatic
19+
* Make `digest` an optional dependency
20+
* Make `zeroize` an optional dependency
21+
* Make `rand_core` an optional dependency
22+
* Make all batch verification deterministic remove `batch_deterministic` ([#256](https://github.com/dalek-cryptography/ed25519-dalek/pull/256))
23+
* Remove `ExpandedSecretKey` API ((#205)[https://github.com/dalek-cryptography/ed25519-dalek/pull/205])
24+
* Rename `Keypair``SigningKey` and `PublicKey``VerifyingKey`
25+
26+
### Other changes
27+
28+
* Add `Context` type for prehashed signing
29+
* Add `VerifyingKey::{verify_prehash_strict, is_weak}`
30+
* Add `pkcs` feature to support PKCS #8 (de)serialization of `SigningKey` and `VerifyingKey`
31+
* Add `fast` feature to include basepoint tables
32+
* Add tests for validation criteria
33+
* Impl `DigestSigner`/`DigestVerifier` for `SigningKey`/`VerifyingKey`, respectively
34+
* Impl `Hash` for `VerifyingKey`
35+
* Impl `Clone`, `Drop`, and `ZeroizeOnDrop` for `SigningKey`
36+
* Remove `rand` dependency

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contributing to ed25519-dalek
2+
3+
If you have questions or comments, please feel free to email the
4+
authors.
5+
6+
For feature requests, suggestions, and bug reports, please open an issue on
7+
[our Github](https://github.com/dalek-cryptography/ed25519-dalek). (Or, send us
8+
an email if you're opposed to using Github for whatever reason.)
9+
10+
Patches are welcomed as pull requests on
11+
[our Github](https://github.com/dalek-cryptography/ed25519-dalek), as well as by
12+
email (preferably sent to all of the authors listed in `Cargo.toml`).
13+
14+
All issues on ed25519-dalek are mentored, if you want help with a bug just
15+
ask @tarcieri or @rozbb.
16+
17+
Some issues are easier than others. The `easy` label can be used to find the
18+
easy issues. If you want to work on an issue, please leave a comment so that we
19+
can assign it to you!

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
[package]
22
name = "ed25519-dalek"
3-
version = "1.0.1"
3+
version = "2.0.0-pre.0"
44
edition = "2021"
5-
authors = ["isis lovecruft <[email protected]>"]
5+
authors = [
6+
"isis lovecruft <[email protected]>",
7+
"Tony Arcieri <[email protected]>",
8+
"Michael Rosenberg <[email protected]>"
9+
]
610
readme = "README.md"
711
license = "BSD-3-Clause"
812
repository = "https://github.com/dalek-cryptography/ed25519-dalek"
9-
homepage = "https://dalek.rs"
1013
documentation = "https://docs.rs/ed25519-dalek"
1114
keywords = ["cryptography", "ed25519", "curve25519", "signature", "ECC"]
1215
categories = ["cryptography", "no-std"]

README.md

Lines changed: 90 additions & 121 deletions
Large diffs are not rendered by default.

src/context.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ use crate::{InternalError, SignatureError};
1515
///
1616
/// # Example
1717
///
18-
#[cfg_attr(feature = "digest", doc = "```")]
19-
#[cfg_attr(not(feature = "digest"), doc = "```ignore")]
18+
#[cfg_attr(all(feature = "digest", feature = "rand_core"), doc = "```")]
19+
#[cfg_attr(
20+
any(not(feature = "digest"), not(feature = "rand_core")),
21+
doc = "```ignore"
22+
)]
2023
/// # fn main() {
2124
/// use ed25519_dalek::{Signature, SigningKey, VerifyingKey, Sha512};
2225
/// # use curve25519_dalek::digest::Digest;

src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub(crate) enum InternalError {
4848
length_c: usize,
4949
},
5050
/// An ed25519ph signature can only take up to 255 octets of context.
51+
#[cfg(feature = "digest")]
5152
PrehashedContextLength,
5253
/// A mismatched (public, secret) key pair.
5354
MismatchedKeypair,
@@ -76,6 +77,7 @@ impl Display for InternalError {
7677
{} has length {}, {} has length {}.",
7778
na, la, nb, lb, nc, lc
7879
),
80+
#[cfg(feature = "digest")]
7981
InternalError::PrehashedContextLength => write!(
8082
f,
8183
"An ed25519ph signature can only take up to 255 octets of context"

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@
113113
//!
114114
#![cfg_attr(feature = "rand_core", doc = "```")]
115115
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
116-
//! # use std::convert::TryFrom;
116+
//! # use core::convert::{TryFrom, TryInto};
117117
//! # use rand::rngs::OsRng;
118-
//! # use std::convert::TryInto;
119118
//! # use ed25519_dalek::{SigningKey, Signature, Signer, VerifyingKey, SecretKey, SignatureError};
120119
//! # use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
121120
//! # fn do_test() -> Result<(SigningKey, VerifyingKey, Signature), SignatureError> {
@@ -258,6 +257,7 @@ pub use ed25519;
258257
#[cfg(feature = "batch")]
259258
mod batch;
260259
mod constants;
260+
#[cfg(feature = "digest")]
261261
mod context;
262262
mod errors;
263263
mod signature;
@@ -272,6 +272,7 @@ pub use sha2::Sha512;
272272
#[cfg(feature = "batch")]
273273
pub use crate::batch::*;
274274
pub use crate::constants::*;
275+
#[cfg(feature = "digest")]
275276
pub use crate::context::Context;
276277
pub use crate::errors::*;
277278
pub use crate::signing::*;

src/signing.rs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ use curve25519_dalek::scalar::Scalar;
3333

3434
use ed25519::signature::{KeypairRef, Signer, Verifier};
3535

36+
#[cfg(feature = "digest")]
37+
use crate::context::Context;
3638
#[cfg(feature = "digest")]
3739
use signature::DigestSigner;
3840

3941
#[cfg(feature = "zeroize")]
4042
use zeroize::{Zeroize, ZeroizeOnDrop};
4143

4244
use crate::constants::*;
43-
use crate::context::Context;
4445
use crate::errors::*;
4546
use crate::signature::*;
4647
use crate::verifying::*;
@@ -161,6 +162,7 @@ impl SigningKey {
161162

162163
/// Create a signing context that can be used for Ed25519ph with
163164
/// [`DigestSigner`].
165+
#[cfg(feature = "digest")]
164166
pub fn with_context<'k, 'v>(
165167
&'k self,
166168
context_value: &'v [u8],
@@ -172,21 +174,15 @@ impl SigningKey {
172174
///
173175
/// # Example
174176
///
175-
/// ```
176-
/// # #[cfg(feature = "std")]
177+
#[cfg_attr(feature = "rand_core", doc = "```")]
178+
#[cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
177179
/// # fn main() {
178-
///
179180
/// use rand::rngs::OsRng;
180-
/// use ed25519_dalek::SigningKey;
181-
/// use ed25519_dalek::Signature;
181+
/// use ed25519_dalek::{Signature, SigningKey};
182182
///
183183
/// let mut csprng = OsRng;
184184
/// let signing_key: SigningKey = SigningKey::generate(&mut csprng);
185-
///
186185
/// # }
187-
/// #
188-
/// # #[cfg(not(feature = "std"))]
189-
/// # fn main() { }
190186
/// ```
191187
///
192188
/// # Input
@@ -239,7 +235,6 @@ impl SigningKey {
239235
/// use sha2::Sha512;
240236
/// use rand::rngs::OsRng;
241237
///
242-
/// # #[cfg(feature = "std")]
243238
/// # fn main() {
244239
/// let mut csprng = OsRng;
245240
/// let signing_key: SigningKey = SigningKey::generate(&mut csprng);
@@ -250,9 +245,6 @@ impl SigningKey {
250245
///
251246
/// prehashed.update(message);
252247
/// # }
253-
/// #
254-
/// # #[cfg(not(feature = "std"))]
255-
/// # fn main() { }
256248
/// ```
257249
///
258250
/// If you want, you can optionally pass a "context". It is generally a
@@ -301,13 +293,9 @@ impl SigningKey {
301293
/// #
302294
/// # Ok(sig)
303295
/// # }
304-
/// # #[cfg(feature = "std")]
305296
/// # fn main() {
306297
/// # do_test();
307298
/// # }
308-
/// #
309-
/// # #[cfg(not(feature = "std"))]
310-
/// # fn main() { }
311299
/// ```
312300
///
313301
/// [rfc8032]: https://tools.ietf.org/html/rfc8032#section-5.1
@@ -385,13 +373,9 @@ impl SigningKey {
385373
/// # verified
386374
/// # }
387375
/// #
388-
/// # #[cfg(feature = "std")]
389376
/// # fn main() {
390377
/// # do_test();
391378
/// # }
392-
/// #
393-
/// # #[cfg(not(feature = "std"))]
394-
/// # fn main() { }
395379
/// ```
396380
///
397381
/// [rfc8032]: https://tools.ietf.org/html/rfc8032#section-5.1

src/verifying.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
3434
#[cfg(feature = "serde")]
3535
use serde_bytes::{ByteBuf as SerdeByteBuf, Bytes as SerdeBytes};
3636

37+
#[cfg(feature = "digest")]
38+
use crate::context::Context;
3739
#[cfg(feature = "digest")]
3840
use signature::DigestVerifier;
3941

4042
use crate::constants::*;
41-
use crate::context::Context;
4243
use crate::errors::*;
4344
use crate::signature::*;
4445
use crate::signing::*;
@@ -156,6 +157,7 @@ impl VerifyingKey {
156157

157158
/// Create a verifying context that can be used for Ed25519ph with
158159
/// [`DigestVerifier`].
160+
#[cfg(feature = "digest")]
159161
pub fn with_context<'k, 'v>(
160162
&'k self,
161163
context_value: &'v [u8],

0 commit comments

Comments
 (0)