Commit graph

178 commits

Author SHA1 Message Date
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
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
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
f1d4c4a732
Remove panics from batch verification API in lieu of better error handling. 2019-10-18 20:20:34 +00:00
Isis Lovecruft
deca36d074
Add an optimisation to succeed fast for scalars whose 4th MSB is unset.
This is only done during signature verification.
2019-10-11 21:33:55 +00:00
Isis Lovecruft
de3eb13dcf
Merge branch 'feature/97-verify-strict_1' into develop 2019-10-11 21:24:34 +00:00
Isis Lovecruft
3773f56d15
Merge branch 'feature/rust-2018' into develop 2019-10-10 22:10:28 +00:00
Isis Lovecruft
a065bee381
Enable Rust 2018. 2019-10-07 23:01:10 +00:00
isis agora lovecruft
29622ec10b
Merge pull request #96 from Arnaz87/master
Drop the static lifetime for context in sign_prehashed
2019-10-07 20:06:48 +00:00
Isis Lovecruft
2d5fe86f30
Document anti-malleability features/functionality. 2019-10-07 19:03:15 +00:00