Skip to content

Commit

Permalink
Bumped MSRV to 1.56.1 and added some documentation about semver (#218)
Browse files Browse the repository at this point in the history
Also fixed benchmark build
  • Loading branch information
rozbb authored Oct 16, 2022
1 parent 9638ab4 commit 8319adb
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ jobs:
args: --features "batch_deterministic"

msrv:
name: Current MSRV is 1.41
name: Current MSRV is 1.56.1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.41
toolchain: 1.56.1
override: true
- uses: actions-rs/cargo@v1
with:
Expand All @@ -128,4 +128,4 @@ jobs:
with:
command: bench
# This filter selects no benchmarks, so we don't run any, only build them.
args: --features "batch" "DONTRUNBENCHMARKS"
args: --features "batch" "nonexistentbenchmark"
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changes
* Bumped MSRV from 1.41 to 1.56.1
* Removed `ExpandedSecretKey` API ((#205)[https://github.com/dalek-cryptography/ed25519-dalek/pull/205])
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ed25519-dalek"
version = "1.0.1"
edition = "2018"
edition = "2021"
authors = ["isis lovecruft <[email protected]>"]
readme = "README.md"
license = "BSD-3-Clause"
Expand Down Expand Up @@ -30,7 +30,7 @@ rand_core = { version = "0.5", default-features = false, optional = true }
serde_crate = { package = "serde", version = "1.0", default-features = false, optional = true }
serde_bytes = { version = "0.11", optional = true }
sha2 = { version = "0.9", default-features = false }
zeroize = { version = "~1.3", default-features = false }
zeroize = { version = "1", default-features = false }

[dev-dependencies]
hex = "^0.4"
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ Documentation is available [here](https://docs.rs/ed25519-dalek).

To install, add the following to your project's `Cargo.toml`:

```toml
[dependencies.ed25519-dalek]
version = "1"
```
# Minimum Supported Rust Version

This crate requires Rust 1.56.1 at a minimum. 1.x releases of this crate supported an MSRV of 1.41.

In the future, MSRV changes will be accompanied by a minor version bump.

# Changelog

See [CHANGELOG.md](CHANGELOG.md) for a list of changes made in past version of this crate.

# Benchmarks

Expand Down
20 changes: 9 additions & 11 deletions benches/ed25519_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ mod ed25519_benches {
use ed25519_dalek::PublicKey;
use ed25519_dalek::Signature;
use ed25519_dalek::Signer;
use ed25519_dalek::verify_batch;
use rand::thread_rng;
use rand::prelude::ThreadRng;
use rand::thread_rng;

fn sign(c: &mut Criterion) {
let mut csprng: ThreadRng = thread_rng();
Expand All @@ -38,9 +37,9 @@ mod ed25519_benches {
let keypair: Keypair = Keypair::generate(&mut csprng);
let msg: &[u8] = b"";
let sig: Signature = keypair.sign(msg);

c.bench_function("Ed25519 signature verification", move |b| {
b.iter(| | keypair.verify(msg, &sig))
b.iter(|| keypair.verify(msg, &sig))
});
}

Expand All @@ -51,7 +50,7 @@ mod ed25519_benches {
let sig: Signature = keypair.sign(msg);

c.bench_function("Ed25519 strict signature verification", move |b| {
b.iter(| | keypair.verify_strict(msg, &sig))
b.iter(|| keypair.verify_strict(msg, &sig))
});
}

Expand All @@ -62,7 +61,8 @@ mod ed25519_benches {
"Ed25519 batch signature verification",
|b, &&size| {
let mut csprng: ThreadRng = thread_rng();
let keypairs: Vec<Keypair> = (0..size).map(|_| Keypair::generate(&mut csprng)).collect();
let keypairs: Vec<Keypair> =
(0..size).map(|_| Keypair::generate(&mut csprng)).collect();
let msg: &[u8] = b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
let messages: Vec<&[u8]> = (0..size).map(|_| msg).collect();
let signatures: Vec<Signature> =
Expand All @@ -80,11 +80,11 @@ mod ed25519_benches {
let mut csprng: ThreadRng = thread_rng();

c.bench_function("Ed25519 keypair generation", move |b| {
b.iter(| | Keypair::generate(&mut csprng))
b.iter(|| Keypair::generate(&mut csprng))
});
}

criterion_group!{
criterion_group! {
name = ed25519_benches;
config = Criterion::default();
targets =
Expand All @@ -96,6 +96,4 @@ mod ed25519_benches {
}
}

criterion_main!(
ed25519_benches::ed25519_benches,
);
criterion_main!(ed25519_benches::ed25519_benches);

0 comments on commit 8319adb

Please sign in to comment.