mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
Bumped MSRV to 1.56.1 and added some documentation about semver (#218)
Also fixed benchmark build
This commit is contained in:
parent
9638ab40a5
commit
8319adbff4
5 changed files with 34 additions and 20 deletions
6
.github/workflows/rust.yml
vendored
6
.github/workflows/rust.yml
vendored
|
|
@ -101,14 +101,14 @@ jobs:
|
||||||
args: --features "batch_deterministic"
|
args: --features "batch_deterministic"
|
||||||
|
|
||||||
msrv:
|
msrv:
|
||||||
name: Current MSRV is 1.41
|
name: Current MSRV is 1.56.1
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: 1.41
|
toolchain: 1.56.1
|
||||||
override: true
|
override: true
|
||||||
- uses: actions-rs/cargo@v1
|
- uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -128,4 +128,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
command: bench
|
command: bench
|
||||||
# This filter selects no benchmarks, so we don't run any, only build them.
|
# This filter selects no benchmarks, so we don't run any, only build them.
|
||||||
args: --features "batch" "DONTRUNBENCHMARKS"
|
args: --features "batch" "nonexistentbenchmark"
|
||||||
|
|
|
||||||
11
CHANGELOG.md
Normal file
11
CHANGELOG.md
Normal file
|
|
@ -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])
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ed25519-dalek"
|
name = "ed25519-dalek"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
authors = ["isis lovecruft <isis@patternsinthevoid.net>"]
|
authors = ["isis lovecruft <isis@patternsinthevoid.net>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "BSD-3-Clause"
|
license = "BSD-3-Clause"
|
||||||
|
|
@ -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_crate = { package = "serde", version = "1.0", default-features = false, optional = true }
|
||||||
serde_bytes = { version = "0.11", optional = true }
|
serde_bytes = { version = "0.11", optional = true }
|
||||||
sha2 = { version = "0.9", default-features = false }
|
sha2 = { version = "0.9", default-features = false }
|
||||||
zeroize = { version = "~1.3", default-features = false }
|
zeroize = { version = "1", default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hex = "^0.4"
|
hex = "^0.4"
|
||||||
|
|
|
||||||
13
README.md
13
README.md
|
|
@ -11,10 +11,15 @@ Documentation is available [here](https://docs.rs/ed25519-dalek).
|
||||||
|
|
||||||
To install, add the following to your project's `Cargo.toml`:
|
To install, add the following to your project's `Cargo.toml`:
|
||||||
|
|
||||||
```toml
|
# Minimum Supported Rust Version
|
||||||
[dependencies.ed25519-dalek]
|
|
||||||
version = "1"
|
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
|
# Benchmarks
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,8 @@ mod ed25519_benches {
|
||||||
use ed25519_dalek::PublicKey;
|
use ed25519_dalek::PublicKey;
|
||||||
use ed25519_dalek::Signature;
|
use ed25519_dalek::Signature;
|
||||||
use ed25519_dalek::Signer;
|
use ed25519_dalek::Signer;
|
||||||
use ed25519_dalek::verify_batch;
|
|
||||||
use rand::thread_rng;
|
|
||||||
use rand::prelude::ThreadRng;
|
use rand::prelude::ThreadRng;
|
||||||
|
use rand::thread_rng;
|
||||||
|
|
||||||
fn sign(c: &mut Criterion) {
|
fn sign(c: &mut Criterion) {
|
||||||
let mut csprng: ThreadRng = thread_rng();
|
let mut csprng: ThreadRng = thread_rng();
|
||||||
|
|
@ -38,9 +37,9 @@ mod ed25519_benches {
|
||||||
let keypair: Keypair = Keypair::generate(&mut csprng);
|
let keypair: Keypair = Keypair::generate(&mut csprng);
|
||||||
let msg: &[u8] = b"";
|
let msg: &[u8] = b"";
|
||||||
let sig: Signature = keypair.sign(msg);
|
let sig: Signature = keypair.sign(msg);
|
||||||
|
|
||||||
c.bench_function("Ed25519 signature verification", move |b| {
|
c.bench_function("Ed25519 signature verification", move |b| {
|
||||||
b.iter(| | keypair.verify(msg, &sig))
|
b.iter(|| keypair.verify(msg, &sig))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,7 +50,7 @@ mod ed25519_benches {
|
||||||
let sig: Signature = keypair.sign(msg);
|
let sig: Signature = keypair.sign(msg);
|
||||||
|
|
||||||
c.bench_function("Ed25519 strict signature verification", move |b| {
|
c.bench_function("Ed25519 strict signature verification", move |b| {
|
||||||
b.iter(| | keypair.verify_strict(msg, &sig))
|
b.iter(|| keypair.verify_strict(msg, &sig))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +61,8 @@ mod ed25519_benches {
|
||||||
"Ed25519 batch signature verification",
|
"Ed25519 batch signature verification",
|
||||||
|b, &&size| {
|
|b, &&size| {
|
||||||
let mut csprng: ThreadRng = thread_rng();
|
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 msg: &[u8] = b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||||
let messages: Vec<&[u8]> = (0..size).map(|_| msg).collect();
|
let messages: Vec<&[u8]> = (0..size).map(|_| msg).collect();
|
||||||
let signatures: Vec<Signature> =
|
let signatures: Vec<Signature> =
|
||||||
|
|
@ -80,11 +80,11 @@ mod ed25519_benches {
|
||||||
let mut csprng: ThreadRng = thread_rng();
|
let mut csprng: ThreadRng = thread_rng();
|
||||||
|
|
||||||
c.bench_function("Ed25519 keypair generation", move |b| {
|
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;
|
name = ed25519_benches;
|
||||||
config = Criterion::default();
|
config = Criterion::default();
|
||||||
targets =
|
targets =
|
||||||
|
|
@ -96,6 +96,4 @@ mod ed25519_benches {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
criterion_main!(
|
criterion_main!(ed25519_benches::ed25519_benches);
|
||||||
ed25519_benches::ed25519_benches,
|
|
||||||
);
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue