Commit graph

168 commits

Author SHA1 Message Date
pinkforest
d62def9c22
Workspace ed25519 under ed25519-dalek 2023-06-27 04:04:09 +00:00
pinkforest(she/her)
58a967f6fb
chore: Release 2.0.0-rc.3 (#307)
* chore: Release 2.0.0-rc.3

* cargo update -p curve25519-dalek

* Removed some old backend selection prose and env vars

---------

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-23 23:53:10 -04:00
Michael Rosenberg
9b166b75e0
Update to new Scalar API (#293)
* Updated to new curve25519 scalar API

* Made ExpandedSecretKey.scalar_bytes unclamped; clamping occurs in all scalar-point multiplication

* Added legacy compat deprecation notice

* Removed deprecation notice on check_scalar

* Removed unnecessary unwraps
2023-06-12 00:06:00 -04:00
Michael Rosenberg
4afbf09e1c
Add hazmat module with ExpandedSecretKey, raw_sign, raw_sign_prehashed (#299)
* Added raw_sign() and raw_sign_prehashed() functions

* Renamed `nonce` to `hash_prefix` in signing because it's really not a nonce

* Moved raw signing to hazmat module

* impl From<EdwardsPoint> for VerifyingKey

* Brought back ExpandedSecretKey; made raw_* functions take it as input

* Added remaining features to docs.rs feature set

* Removed redundant ExpandedSecretKey def; made raw signing use a generic CtxDigest

* Implemented raw_verify with generic CtxDigest

* Implemented raw_verify_prehashed with generic MsgDigest and CtxDigest

* Wrote hazmat tests; fixed errors; switched ordering of MsgDigest and CtxDigest

* Updated changelog

* ExpandedSecretKey::from_bytes takes an array and is now infallible

* Add TODO comment for split_array_ref

* Added from_slice and TryFrom<&[u8]> for ExpandedSecretKey

---------

Co-authored-by: Tony Arcieri <bascule@gmail.com>
2023-05-15 00:50:38 -04:00
pinkforest(she/her)
5014c91270
chore: Release 2.0.0-rc.2 (#295)
Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-03-26 11:23:14 -04:00
ryan
2931c688eb
Fix serde / no_std incompatibility
Co-authored-by: ryan kurte <ryan@kurte.nz>
Co-authored-by: Vlad Semenov <semenov.vlad.by@gmail.com>
2023-03-21 13:45:33 -06:00
Tony Arcieri
e0e02cfcf4
Bump ed25519 to v2.2; pkcs8 to v0.10 (#285)
The `ed25519` v2.2.0 crate bumps the `pkcs8` dependency to v0.10.

This updates `ed25519` to the latest version and updates the PKCS#8
support to use the new API.
2023-03-07 02:20:09 -05:00
Michael Rosenberg
b77fa51569
Bump curve25519-dalek dep to rc.1 2023-02-04 03:21:36 -05:00
Michael Rosenberg
57a8add0fd
Removed vestigial nightly feature from docsrs instructions 2023-02-02 17:18:47 -05:00
Michael Rosenberg
783b6e81c4
README changes for 2.0 (#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 #277

* Added pem feature description

Co-authored-by: pinkforest(she/her) <36498018+pinkforest@users.noreply.github.com>
2023-02-02 17:07:56 -05:00
Tony Arcieri
1b86ff1d3e
Bump curve25519-dalek to v4.0.0-rc.0 (#276)
Eliminates the `patch.crates-io` directive by using the latest RC
release of `curve25519-dalek` on crates.io
2023-01-28 18:56:35 -05:00
pinkforest(she/her)
928d6d15f8
Docs.rs + README changes for 2.x (#241) 2023-01-27 01:06:24 -05:00
Tony Arcieri
27ba9dd614
Bump ed25519 crate dependency to v2.1 (#272)
The original v2.0.0 release has been yanked.

This release includes a different infallible parsing API which can be
used to eliminate some usages of `unwrap()`.
2023-01-21 17:59:11 -05:00
Tony Arcieri
ba765a5988
Impl signature::Digest* traits for Ed25519ph (#270)
* Impl `signature::Digest*` traits for Ed25519ph

Adds the following trait impls:

- impl DigestSigner for SigningKey
- impl DigestVerifier for VerifyingKey

These traits can be used to create and verify Ed25519 signatures,
thunking to `SigningKey::sign_prehashed` and
`VerifyingKey::verify_prehashed` respectively.

* Add rustdoc comments for trait impls
2023-01-21 00:02:27 -05:00
Tony Arcieri
f61e9dcf9b
Add on-by-default fast crate feature for gating basepoint tables (#251)
* Add on-by-default `fast` crate feature

Disabling the feature reduces overall code size at the cost of
performance, which is useful for e.g. embedded users.

This feature transitively enables the `basepoint-tables` feature in
`curve25519-dalek` where the basepoint tables are actually defined.

* Consolidated a lot of verification code

* Bump `curve25519-dalek`; use `precomputed-tables` feature

The feature name changed in dalek-cryptography/curve25519-dalek#499

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-01-20 15:46:17 -05:00
pinkforest(she/her)
431e69959d
Make digest optional (#268)
digest isn't yet stable but we have use it in the public API.

This makes the digest API optional to use in opt-in basis by
feature gating this via an optional digest feature.

API items now feature-gated:

- `pub use ed25519_dalek::Digest`
- `SigningKey::sign_prehashed(D: prehashed_message, ..)`
- `SigningKey::verify_prehashed(D: prehahed_message, ..)`
- `VerifyingKey::verify_prehashed(D: prehashed_message, ..)`
- `VerifyingKey::verify_prehashed_strict(D: prehashed_message, ..)`

Also no longer re-exporting `sha2::Sha512`
2023-01-19 02:59:43 -05:00
Tony Arcieri
6d9bbd323e
Bump ed25519 dependency to v2 (#266)
Release notes: https://github.com/RustCrypto/signatures/pull/622
2023-01-16 21:38:57 -05:00
pinkforest(she/her)
8c455f58ae
Make rand_core optional (#262)
* Make rand_core optional
* Bench requires features rand_core
2023-01-15 19:13:33 -05:00
Michael Rosenberg
b5dc40bedf
Make verify_batch deterministic (#256)
Also removed `batch_deterministic` feature
2023-01-14 21:26:39 -05:00
pinkforest(she/her)
4f6b4b247f
Make zeroize optional (#263)
Defaults to on
2023-01-09 07:57:59 -07:00
Tony Arcieri
6ee4d1de5c
Use curve25519-dalek from git; check in Cargo.lock (#260)
Updates to the latest upstream changes in `curve25519-dalek`, including
using the new `EdwardsPoint::mul_base` API.

To keep the build deterministic, this also checks in Cargo.lock, which
pins `curve25519-dalek` to a particular git commit SHA which can be
updated using `cargo update -p curve25519-dalek`.

We can potentially remove `Cargo.lock` again after a crate release.
2023-01-09 04:44:10 -05:00
Tony Arcieri
461a2d7e05
Bump ed25519 crate to v2.0.0-rc.0 (#257) 2023-01-07 00:50:39 -05:00
Michael Rosenberg
f036eaf482
Validation criteria tests (#253) 2023-01-05 22:58:54 -05:00
Michael Rosenberg
e2ed3133a6
Fix batch build (#220)
* Fixed bench when `batch` feature is not present

* Added bench build regression test to CI

* Fixed batch build more generally

* Simplified batch cfg gates in benches

* Updated criterion

* Made CI batch-nondeterministic test use nostd

* Fix batch_deterministic build

* Removed bad compile error when batch and batch_deterministic are selected
2023-01-02 00:59:19 -05:00
Tony Arcieri
f6a242a5b0
Use namespaced/weak features; MSRV 1.60 (#235)
This enables activating the `alloc` and `std` features without
unnecessarily pulling in optional dependencies like `rand` and `serde`.

It also fixes tests for `--no-default-features` (w\ `--lib` only)
2022-12-20 04:48:55 -05:00
Tony Arcieri
a0384be8fc
Impl Drop/ZeroizeOnDrop for SigningKey (#247)
- Zeros out `SigningKey::secret_key` on drop
- Adds the `ZeroizeOnDrop` marker trait to `SigningKey`
2022-12-20 04:28:20 -05:00
Tony Arcieri
55620dcde5
PKCS#8 support (#224)
Adds optional integration with `ed25519::pkcs8` with support for
decoding/encoding `Keypair` from/to PKCS#8-encoded documents as well as
`PublicKey` from/to SPKI-encoded documents.

Includes test vectors generated for the `ed25519` crate from:
https://github.com/RustCrypto/signatures/tree/master/ed25519/tests/examples
2022-12-13 18:19:31 -05:00
Tony Arcieri
cfcdf536a0
Cargo.toml: compatibility updates for curve25519-dalek and ed25519 (#236)
curve25519-dalek:

- Enables `digest` and `rand_core` features
- Removes transitive `nightly`, `simd_backend`, and `std` features

ed25519:

- `AsRef` impl for `Signature` has been removed; uses `to_bytes`
- Uses `try_from` for `InternalSignature` conversion
2022-12-09 21:14:38 -05:00
Tony Arcieri
01ad6305f2
Edition fixups: remove extern crate, add idioms lint (#231)
Rust editions 2018+ do not require `extern crate` except for linking
`alloc` and `std`.
2022-12-08 02:39:48 -05:00
Tony Arcieri
a03c7a3f0f
Tune up CI configuration (#227)
- Consolidate `test` jobs: this allows reusing intermediate artifacts
  between tests which should improve build times, and also make it
  easier to test additional features in the future
- Switch to `dtolnay/rust-toolchain` for setting up toolchain
- Bump checkout to `actions/checkout@3`
- Switch to `run` directives for invoking Cargo: it's more
  straightforward to just call Cargo than use a DSL from an unmaintained
  action, and eliminates the 3rd party dependency
2022-11-21 17:23:05 -05:00
Tony Arcieri
d4cffc7d05
ed25519 v2.0.0-pre.0 (#222)
Bumps the `ed25519` crate to the v2.0.0-pre.0 prerelease.

This version notably uses the `signature` crate's v2 API:

https://github.com/RustCrypto/traits/pull/1141
2022-11-21 17:21:05 -05:00
Tony Arcieri
ae4bd2c81e
Fix warnings and add -D warnings check in CI (#226) 2022-11-20 22:28:09 -05:00
Tony Arcieri
f7cbeee7f6
Bump curve25519-dalek to v4.0.0-pre (via git) (#223)
Also bumps these corresponding dependencies which are needed for everything to compile with this update:

* `merlin` v3.0
* `rand` v0.8
* `rand_core` v0.6
* `sha2` v0.10
2022-11-20 15:08:05 -05:00
Michael Rosenberg
8319adbff4
Bumped MSRV to 1.56.1 and added some documentation about semver (#218)
Also fixed benchmark build
2022-10-16 18:51:26 -04:00
Isis Lovecruft
ad461f4f0f
Merge branch 'feature/github-actions' into main 2021-09-14 01:08:27 +00:00
Isis Lovecruft
10cef49824
Add CI via Github actions. 2021-09-14 01:04:53 +00:00
isis agora lovecruft
86db7c9853
Merge pull request #168 from huitseeker/thread-fiat-backends
Threads the `fiat_{u64,u32}_backend` features through the feature set
2021-09-13 23:52:49 +00:00
François Garillot
c12cf48623
Threads the fiat_{u64,u32}_backend features in the feature set
This allows the fiat backends introduced in
[curve25519-dalek/#342](https://github.com/dalek-cryptography/curve25519-dalek/pull/342)
to be used from an ed25519 import without cumbersome overrides.
2021-05-03 16:26:11 -07:00
Tyler Neely
9d9a6b0beb Speed up compilation by avoiding zeroize_derive 2020-11-25 12:35:24 +01:00
Isis Lovecruft
bbb8869550
Fix std builds when serde is enabled. 2020-11-02 23:57:09 +00:00
Isis Lovecruft
ce5ff27681
Make serde_bytes/alloc dependent on alloc feature.
Fixup for PR #149.
2020-10-28 00:04:15 +00:00
Cheng XU
6ce6519287
fix serde in no_std 2020-09-21 19:16:01 -07:00
Isis Lovecruft
1042cb60a0
Bump ed25519-dalek version to 1.0.1. 2020-09-22 01:56:35 +00:00
Cheng XU
69eccda444
Fix serde implementation for serde_json
We use the [serde_bytes](https://github.com/serde-rs/bytes) crate for
serialization implementations, which simplifies codes and fixes issues
for serde_json.
2020-09-21 18:26:59 -07:00
Cheng XU
008c9680f6
Update tests for serde
* Upgrade bincode to 1.0
* Add more serde tests including json serialization.
2020-09-21 18:26:59 -07:00
Isis Lovecruft
6609642036
Enable rand crate by default.
See https://github.com/dalek-cryptography/ed25519-dalek/pull/139.
2020-09-21 23:53:29 +00:00
Isis Lovecruft
5d7bc29ba2
Workaround for rand crate "nightly" feature breakage.
Cf. https://github.com/rust-random/rand/issues/1047
2020-09-21 23:25:15 +00:00
Isis Lovecruft
952bdd062f
Release ed25519-dalek version 1.0.0. 2020-08-20 22:46:58 +00:00
Isis Lovecruft
1c97dac4dc
Update to curve25519-dalek version 3. 2020-08-20 21:19:21 +00:00
Isis Lovecruft
5f22d899a0
Bump ed25519-dalek version to 1.0.0-pre.4. 2020-07-16 23:25:09 +00:00