Commit graph

189 commits

Author SHA1 Message Date
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
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
Alex Xiong
9638ab40a5
Made ExpandedSecretKey private to avoid signing key oracle (#205)
This fix eliminates a scenario where a user misuses the `ExpandedSecretKey` API
in a way that leaks the user's secret key. In short, if a user sends
`ExpandedSecretKey::sign(sk, msg, pk1)` followed by
`ExpandedSecretKey::sign(sk, msg, pk2)`, where `pk1 != pk2`, a passive
adversary [can easily][0] derive `sk`. To mitigate this, we remove the API
entirely.

[0]: https://github.com/MystenLabs/ed25519-unsafe-libs
2022-10-15 15:04:03 -04:00
Isis Lovecruft
ad461f4f0f
Merge branch 'feature/github-actions' into main 2021-09-14 01:08:27 +00:00
gbaranski
c5fb932561 fix: stop forbidding unsafe in tests 2021-08-01 19:28:40 +02:00
gbaranski
d94b0f52dc fix: remove rust-analyzer breaking line 2021-08-01 18:29:28 +02:00
Tyler Neely
9d9a6b0beb Speed up compilation by avoiding zeroize_derive 2020-11-25 12:35:24 +01:00
Isis Lovecruft
8c15bce61d
Actually, we use unsafe{} in one test. 2020-09-22 01:54:44 +00:00
isis agora lovecruft
97c22f2d07
Merge pull request #146 from xu-cheng/serde2
Fix serde implementation for serde_json
2020-09-22 01:49:58 +00:00
isis agora lovecruft
a9ebf7f53e
Merge pull request #148 from isislovecruft/feature/forbid-unsafe
Add #![forbid(unsafe_code)].
2020-09-22 01:39:51 +00:00
isis agora lovecruft
1335f3a859
Merge pull request #147 from isislovecruft/fix/deterministic-batch-malleability
batch verification malleability issue when used with fully deterministic nonce generation
2020-09-22 01:38:22 +00:00
Isis Lovecruft
d6ff6de2cf
Add #![forbid(unsafe_code)].
CLOSES https://github.com/dalek-cryptography/ed25519-dalek/issues/144
2020-09-22 01:36:49 +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
b5a15bf451
Feature gate key generation on the "rand" dependency.
See https://github.com/dalek-cryptography/ed25519-dalek/pull/139.
2020-09-21 23:53:56 +00:00
isis agora lovecruft
7155c07afa
Merge pull request #139 from garbageslam/fixup_rand_usage
Make `use rand::...` gated on `cfg(feature = "rand")`
2020-09-21 23:47:26 +00:00
Isis Lovecruft
a02190adf3
Document that we include the message lengths in the transcript. 2020-09-21 22:10:03 +00:00
Isis Lovecruft
57a5473cb0
Fix and document malleability issue in deterministic batch_verify().
Thank you to @real_or_random and @jonasnick for initially pointing it
out and ensuing discussion.
2020-09-21 22:09:27 +00:00
Ivan Temchenko
da959c041d check_scalar bug fix for legacy_compatibility feature 2020-08-24 16:33:04 +02:00
Isis Lovecruft
1c97dac4dc
Update to curve25519-dalek version 3. 2020-08-20 21:19:21 +00:00
Chris Beck
bb82d616de Make use rand::... gated on cfg(feature = "rand")
This is no longer actively breaking our no_std build, but I think
it's still technically a minor bug, and further case of issue #108
2020-08-04 11:58:07 -07:00
Isis Lovecruft
5458ebef88
Fix no_std issue with new error types. 2020-07-16 23:18:00 +00:00
Isis Lovecruft
d3a5b3bd81
Remove unsafe trait impls. 2020-07-16 23:02:27 +00:00
Isis Lovecruft
7243d7151d
Fix handling of external error types. 2020-07-16 22:19:40 +00:00
Isis Lovecruft
69004599c5
Fix misnamed error type. 2020-07-16 21:49:14 +00:00
Isis Lovecruft
b84f1df47b
Merge branch 'fix/ed25519ph-context' into develop 2020-07-15 17:44:54 +00:00
Isis Lovecruft
97787d3716
Remove impl of std::error::Error for SignatureError.
We're now aliasing SignatureError to the error type from the signature
crate.
2020-07-14 00:37:56 +00:00
Isis Lovecruft
989c5e4c18
Fix ed25519ph context length error handling in sign_prehashed().
RFC8032 specifies that the context cannot be greater than 255 octets,
but in the previous implementation in ed25519-dalek, this error would
only be caught by a debug_assert.  This changes the sign_prehashed()
function to return a Result so that the error can be handled at
runtime and the library no longer allows misuse by creating signatures
that other libraries cannot handle.
2020-07-14 00:25:40 +00:00
Isis Lovecruft
f1d8576f12
Impl std::error::Error for SignatureError. 2020-07-13 23:19:55 +00:00
Isis Lovecruft
84047448da
Merge remote-tracking branch 'tarcieri/ed25519-crate' into develop 2020-07-13 23:00:23 +00:00
isis agora lovecruft
005fc35f52
Merge pull request #116 from NikVolf/nv-fix-alloc
Fix alloc feature compilation
2020-06-30 22:51:07 +00:00
Isis Lovecruft
c5386c0df9
Merge branch 'master' into develop 2020-06-30 22:44:29 +00:00
isis agora lovecruft
6dfcc4ba27
Merge pull request #112 from jamesmunns/improve-deserialize
Add additional visitor methods for deserialization
2020-06-30 22:05:16 +00:00
Tony Arcieri
6e0667d429 Use ed25519 + signature interop crates
The `signature` crate provides `Signer` and `Verifier` traits generic
over signature types:

https://github.com/RustCrypto/traits/tree/master/signature

There's presently an open call to stabilize the parts of its API needed
by Ed25519 signatures and release a 1.0 version:

https://github.com/RustCrypto/traits/issues/78

The `ed25519` crate, based on the `signature` crate, provides an
`ed25519::Signature` type which can be shared across multiple Ed25519
crates (e.g. it is also used by the `yubihsm` crate):

https://github.com/RustCrypto/signatures/tree/master/ed25519

This commit integrates the `ed25519::Signature` type, and changes the
existing `sign` and `verify` methods (where applicable) to use the
`Signer` and `Verifier` traits from the `signature` crate. Additionally,
it replaces `SignatureError` with the `signature` crate's error type.

This has the drawback of requiring the `Signer` and/or `Verifier` traits
are in scope in order to create and/or verify signatures, but with the
benefit of supporting interoperability with other Ed25519 crates which
also make use of these traits.
2020-04-20 09:15:10 -07:00
phayes
2dad99a60e
Removing double 2020-02-23 07:32:45 -08:00
NikVolf
dedbb9b96a fix alloc feature 2020-02-22 15:10:21 +03:00
James Munns
3d9d11dcdf Add additional visitor methods for deserialization 2020-01-13 00:59:08 +01:00
Isis Lovecruft
8a2e9af9d6
Fix breakage on builds with the rand crate disabled.
* CLOSES https://github.com/dalek-cryptography/ed25519-dalek/issues/108
 * THANKS TO @tarcieri
2019-12-11 23:02:44 +00:00
Isis Lovecruft
af15a0e553
Merge remote-tracking branch 'dalek/develop' into develop 2019-12-11 22:49:06 +00:00
Isis Lovecruft
9363690191
Fix outdated docstring for verify_batch(). 2019-12-11 22:48:33 +00:00
Isis Lovecruft
8ca3be99e9
Switch to using zeroize rather than clear_on_drop. 2019-12-09 22:39:57 +00:00
Isis Lovecruft
1be2a65777
Maybe I should try compiling my code before showing other cryptographers?
lol
2019-11-26 22:57:24 +00:00
Isis Lovecruft
ec551145e9
Add message lengths into nonce generator protocol transcript. 2019-11-22 23:21:01 +00:00
Isis Lovecruft
bd6a897729
Actually use the transcript PRNG. 2019-11-22 23:40:46 +00:00
Isis Lovecruft
85a218ac40
Implement deterministic batch verification and synthetic nonce generation. 2019-11-22 23:29:14 +00:00
Isis Lovecruft
ee67f36ba9
Move verify_batch() to new batch module. 2019-11-21 00:31:10 +00:00
Isis Lovecruft
8f848793f3
Merge branch 'feature/no-panics' into develop 2019-11-21 00:09:32 +00:00