Commit graph

117 commits

Author SHA1 Message Date
Isis Lovecruft
3a9435df94
Fixup serde and ed25519 trait errors in tests/benches. 2020-07-13 23:16:30 +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
Isis Lovecruft
3a9101933b
Enable serde/std if std is enabled.
* FIXES part of https://github.com/dalek-cryptography/ed25519-dalek/pull/107
2019-12-11 23:14:29 +00:00
isis agora lovecruft
2ed9fa932d
Merge pull request #107 from cbeck88/serde_no_std
Use `default-features = false` with `serde`
2019-12-11 23:11:24 +00:00
Chris Beck
0a191a86f6 Use default-features = false with serde
It doesn't appear to me that ed25519-dalek crate needs any of the std-related
features of serde. But it turns them on anyways because it doesn't put
`default-features = false`.

This breaks no_std builds. Otherwise I think we could use 1.0.0-pre3 in mobilecoin.
I'm going to test this revision in our build and see if I'm right. I don't think
this is a breaking change from dalek's point of view.
2019-12-10 13:30:56 -08:00
Isis Lovecruft
8ca3be99e9
Switch to using zeroize rather than clear_on_drop. 2019-12-09 22:39:57 +00:00
Isis Lovecruft
29a06e494d
Bump ed25519-dalek version to 1.0.0-pre.3. 2019-12-06 23:42:52 +00:00
Isis Lovecruft
b5ffcdf3ac
Merge branch 'feature/batch_deterministic' into develop 2019-11-26 23:06:14 +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
8938069053
Update curve25519-dalek dependency to 2.0.0. 2019-11-26 22:54:53 +00:00
Isis Lovecruft
85a218ac40
Implement deterministic batch verification and synthetic nonce generation. 2019-11-22 23:29:14 +00:00
Isis Lovecruft
15d0a6596f
Document batch verification on docs.rs and fix false autolinking. 2019-11-14 22:01:34 +00:00
Isis Lovecruft
81f906ca30
Replace failure dependency with impls of std::error::Error. 2019-10-26 04:16:33 +00:00
Isis Lovecruft
ecb6fd8ec4
Cleanup dependencies in Cargo.toml. 2019-10-25 22:18:42 +00:00
Isis Lovecruft
fe782cd896
Merge remote-tracking branch 'mikelodder7/master' into develop 2019-10-25 21:50:57 +00:00
Michael Lodder
c3f4c7a67e Update to latest rand
Signed-off-by: Michael Lodder <redmike7@gmail.com>
2019-10-21 09:03:08 -06:00
Isis Lovecruft
de3eb13dcf
Merge branch 'feature/97-verify-strict_1' into develop 2019-10-11 21:24:34 +00:00
Isis Lovecruft
a065bee381
Enable Rust 2018. 2019-10-07 23:01:10 +00:00
Isis Lovecruft
ce2260afab
Implement stricter scalar malleability checking for signatures.
Previously, we were checking that the highest 3 bits were unset, which still
leaves 2^253 - 2^252 + 27742317777372353535851937790883648493 potential scalars
for the `s` component of a signature which are not strictly mod \ell.

This change fixes that.

Note: This change makes ed25519-dalek incompatible with ed25519-donna in that
some signatures produced by donna will be verifiable by donna but NOT VERIFIABLE
by dalek.  On the other hand, libsodium exports a -DED25519_COMPAT feature,
which when enabled, means it is compatible with dalek with the
`legacy_compatibility` feature disabled.  Otherwise, libsodium's behaviour is
identical to the behaviour enabled by default in this patch.
2019-10-04 19:34:00 +00:00
Isis Lovecruft
7dd99afb67
Remove most of the rand_os crate, which is only used for testing. 2019-10-04 02:46:02 +00:00
Isis Lovecruft
46811866cc
Bump ed25519-dalek version to 1.0.0-pre.2. 2019-10-04 02:16:06 +00:00
Isis Lovecruft
dc4b77b551
Fix bad import and feature specification in benchmarks. 2019-10-03 23:15:50 +00:00
Isis Lovecruft
d31df0aaa8
Remove sha2 dep; limit rand depends; fixes after PR#68 merge.
* ADD new "batch" feature for feature-gating ed25519 batch verification; off by
   default. The "batch" feature is the only thing which depends on all of the
   `rand` crate, since it requires the functionality of `rand::thread_rng()`.
   Without batch verification, the rest of ed25519-dalek only depends on
   `rand_os` and `rand_core`.
2019-04-02 01:46:23 +00:00
Isis Lovecruft
1bec256418
Merge remote-tracking branch 'newpavlov/rand_core' into develop 2019-03-12 22:22:19 +00:00
Nicolas Stalder
1dfe00b79d Fix rand dependency, deal with unusedness warnings 2019-01-27 03:06:18 +01:00
Isis Lovecruft
ae8764fbef
Update copyright year to 2019 and destroy capitalism. 2019-01-18 04:59:12 +00:00
Isis Lovecruft
131fc2b07f
Bump ed25519-dalek version to 1.0.0-pre.1. 2019-01-18 04:59:12 +00:00
Isis Lovecruft
6d1d3ff5ea
Remove outdated comment about Fuchsia dependencies from Cargo.toml. 2019-01-18 04:59:12 +00:00
Артём Павлов [Artyom Pavlov]
762eb0c470 use rand_core 2019-01-05 15:58:59 +03:00
Isis Lovecruft
d81d43e3ae
Hardcode use of sha2::Sha512 in most cases.
This implements https://github.com/dalek-cryptography/ed25519-dalek/issues/64

You can still choose the "prehash" algorithm, as long as it has 64 bytes of
output.  Otherwise, everything is hardcoded to use sha2::Sha512.  To use a
different implementation you'll need a [patch.crates-io] section in cargo
config.
2018-12-30 00:40:01 +00:00
Isis Lovecruft
d052e63da8
Enabling std feature can now enable rand/std.
Previously it pulled in a bunch of fuschia dependencies regardless of
target system.
2018-12-22 12:22:02 +00:00
Isis Lovecruft
80ae5d0683
Cleanup RNG usage after merging #57. 2018-12-22 12:20:59 +00:00
Isis Lovecruft
b9f078af16
Remove default-features=false from rand dependency.
cf. https://github.com/rust-random/rand/issues/645
2018-12-22 12:14:45 +00:00
Isis Lovecruft
0708974aaa
Bump curve25519-dalek dependency to version 1.0. 🎉 2018-12-22 12:10:03 +00:00
Colt Frederickson
1132665ac2 Update to 1.0.0-pre1 curve25519 2018-11-19 10:13:59 -07:00
Colt Frederickson
42b5d6ada9 Rand 0.6 version bump 2018-11-14 17:08:32 -07:00
Isis Lovecruft
99c64cc403
Bump ed25519-dalek version to 1.0.0-pre.0. 2018-11-06 01:56:13 +00:00
Isis Lovecruft
b97fa08900
Update curve25519-dalek dependency to 1.0.0-pre.0. 2018-11-06 01:40:21 +00:00
Isis Lovecruft
93b73783aa
Bump ed25519-dalek version to 0.8.1. 2018-09-26 18:46:58 +00:00
Isis Lovecruft
7f82308799
Bump curve25519-dalek dependency to 0.20. 2018-09-26 18:46:17 +00:00
Isis Lovecruft
591aff7025
Bump ed25519-dalek version to 0.8.0. 2018-07-27 21:35:36 +00:00
Isis Lovecruft
e35323412d
Merge remote-tracking branch 'hdevalence/feature/27-batch' into develop 2018-07-27 17:24:37 +00:00
Henry de Valence
4c838decd8 Use 128-bit scalars 2018-07-26 21:09:52 -07:00
Henry de Valence
f60987dee5 Try optional_multiscalar_mul 2018-07-26 20:58:11 -07:00
Isis Lovecruft
050d2a01e5
Bump curve25519-dalek dependency to 0.19. 2018-07-27 03:38:34 +00:00
Isis Lovecruft
6513d4980a
Implement Drop for secret key material using clear_on_drop. 2018-07-20 23:08:08 +00:00
Isis Lovecruft
ce46a12d92
Implement batch verification.
The API for this isn't the greatest and I apologise for that.  Suggestions for
improvement welcome.  One thing which @hdevalence and I considered was to
change the function signature to:

    pub fn verify_batch<D, C, M, S, K>(messages: M,
                                       signatures: S,
                                       public_keys: K,
                                       csprng: &mut C) -> Result<(), SignatureError>
        where D: Digest<OutputSize = U64> + Default,
              C: Rng + CryptoRng,
              M: IntoIterator<Item = &[u8]>,
              S: IntoIterator,
              S::Item: Borrow<Signature>,
              K: IntoIterator,
              K::Item: Borrow<Signature>,

The other improvement which could be made is to implement 128-bit scalars for
the randomnesses.

 * CLOSES #27
2018-07-17 19:03:46 +00:00
Isis Lovecruft
6c8ae573d9
Bump ed25519-dalek version to 0.7.0. 2018-07-15 22:15:54 +00:00
Henry de Valence
030eff547f Make verify return a Result.
This also simplifies the verification logic.  Because the verification check
happens in variable time, we don't need to do a constant-time eq check at the
end, so we can drop the `subtle` dependency entirely.

The `DecodingError` type becomes `SignatureError` and is also used to
signal failing verifications.
2018-07-15 13:07:58 -07:00
Isis Lovecruft
164303eeac
Switch to using criterion for benchmarks. 2018-07-11 22:46:32 +00:00