Commit graph

2255 commits

Author SHA1 Message Date
Henry de Valence
a4125eecf7
Merge pull request #298 from dalek-cryptography/update-rand
Update rand_core, rand, rand_os.
2019-10-24 13:17:44 -07:00
Henry de Valence
6739399ec2 Upgrade to current rand_core, rand, rand_os.
Of these only `rand_core` is included in the public API; regardless of `rand`
semver tricks, this is a breaking API change, but the major version is already
bumped to include the Serde serialization fixes.
2019-10-24 12:29:01 -07:00
Henry de Valence
018fccfe8c Avoid over-specific version specifiers.
By default, Cargo treats version specifiers as semver-compatible ranges, so the
version specifiers we include should only have the components that are actually
meaningful, e.g., "1" instead of "1.0.0" (which actually means "1").
2019-10-24 12:25:50 -07:00
Henry de Valence
a79459a1c8
Merge pull request #289 from tarcieri/zeroize
Switch from `clear_on_drop` to `zeroize` (fixes #281)
2019-10-23 20:17:14 -07:00
Henry de Valence
f2e1f43b5c
Merge pull request #297 from dalek-cryptography/fix-serde
Fix serde data modeling.
2019-10-23 16:42:14 -07:00
Tony Arcieri
9480844b8d Switch from clear_on_drop to zeroize (fixes #281)
`zeroize` is WASM-friendly as it has no dependencies on C compilers.

Instead uses Rust's own volatile write semantics and compiler fences to
ensure zeroization is not elided by the compiler.
2019-10-23 16:39:21 -07:00
Henry de Valence
70e46c9826 Fill in missing Serde impl for MontgomeryPoint. 2019-10-23 15:55:03 -07:00
Henry de Valence
0fc534d989 Use "tuples" instead of "bytes" in the Serde datamodel.
This is a breaking change to the serialization format.  It fixes it so that the
Serde encoding can match the conventional encoding of each type of object, and
so that Serde can be used with no overhead -- when using serde-bincode, the
Serde encoding now matches the manual encoding.
2019-10-23 15:40:50 -07:00
Henry de Valence
29ce0d4fe9 Add length checks to serde-bincode tests.
This ensures that the serde Serialize and Deserialize implementations use
fixed-length Serde tuples, rather than variable-length byte arrays.  This flaw
in data modeling was pointed out by Trevor Perrin.
2019-10-23 15:28:48 -07:00
Henry de Valence
620d17ef40
Merge pull request #293 from dalek-cryptography/remove-build-rs
Remove build.rs constants generation.
2019-10-23 14:44:46 -07:00
Henry de Valence
574217694e Remove build.rs.
This was more useful at the time when we were determining, e.g., optimal lookup
table sizes and could regenerate them more easily, but it came at a massive
complexity cost.  It also meant that we were unable to implement backend
autoselection.  This commit removes the `build.rs` entirely.  In the future, a
different `build.rs` could be added that auto-selects a backend, but it seems
like the current default-u64 setup has been working fine.
2019-10-23 14:20:38 -07:00
Isis Lovecruft
019b81aa20
Clarify docs for the choice of sign for MontgomeryPoint.to_edwards(). 2019-10-23 19:49:06 +00:00
Isis Lovecruft
7c5ba69491
Update copyright year. 2019-10-23 19:43:56 +00:00
Isis Lovecruft
028c0b9d4d
Fix typo in 64-bit scalar implementation code comment. 2019-10-23 19:35: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
58fdc9163b
Merge branch 'feature/scalar-succeed-fast' into develop 2019-10-11 23:42:52 +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
Henry de Valence
8602ec0724
Merge pull request #290 from huitseeker/option_operator
Small rust fixes
2019-10-07 13:56:16 -07: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
François Garillot
9785f56c0f
Rust fixes for some clippy warnings
Clippy lints with instances in the project but NOT applied here, since they seem consistently at odds with the projects' style:
- [unreadable literal](https://rust-lang.github.io/rust-clippy/master/#unreadable_literal)
- [cast lossless](https://rust-lang.github.io/rust-clippy/master/#cast_lossless)
- [assign op pattern](https://rust-lang.github.io/rust-clippy/master/#assign_op_pattern)
2019-10-05 12:02:08 -07:00
François Garillot
023fdf2a2c
Rust added support for the ? operator on Option in 1.22
This converts a few instances of an early-returning unwrap to it.
2019-10-05 11:44:36 -07:00
Isis Lovecruft
28c2f2e3d1
Merge branch 'fix/unused-rand_os' into develop 2019-10-04 19:36:19 +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
28eed1cba0
Add PublicKey::verify_strict() and Keypair::verify_strict() methods. 2019-10-04 02:54:13 +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
8a8fe302dd
Merge branch 'master' into develop 2019-10-04 02:40:49 +00:00
Isis Lovecruft
5870607aa7
Merge branch 'release/1.0.0-pre.2' 2019-10-04 02:40:38 +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
91426a2306
Merge branch 'fix/found-argument-alloc' into develop 2019-10-04 02:13:27 +00:00
Isis Lovecruft
1342e2a3a4
Fix no_std+alloc builds. 2019-10-04 02:05:20 +00:00
Isis Lovecruft
52ee801022
Fix Travis CI builds after change in features syntax parsing.
cf. https://travis-ci.org/isislovecruft/ed25519-dalek/jobs/593331585#L194
2019-10-04 01:43:24 +00:00
Isis Lovecruft
aa49b4cd8d
Fix two failing doctests. 2019-10-04 01:19:23 +00:00
Isis Lovecruft
dc4b77b551
Fix bad import and feature specification in benchmarks. 2019-10-03 23:15:50 +00:00
Arnaud Castellanos Galea
1c9f484d97 Drop the static lifetime for context in sign_prehashed 2019-09-30 16:42:52 +08:00
root
2d0c5323cb errata and basepoint_odd_lookup_table test for better understanding 2019-09-04 13:15:09 +08:00
root
8da05f7e90 errata and basepoint_odd_lookup_table test for better understanding 2019-09-04 12:38:02 +08:00
root
f6015c66c2 errata for comment 2019-09-03 10:38:23 +08:00
root
fa849e014c errata for vpmuludq 2019-09-02 11:26:11 +08:00
Henry de Valence
1f7d48fe36
Merge pull request #278 from 3for/comment-fix
README.md parallel_doc link fix
2019-08-09 09:35:26 -07:00
root
801bbff563 parallel_doc link fix 2019-08-09 16:19:18 +08:00
Henry de Valence
dc2df3cb70 Merge branch 'master' into develop 2019-08-07 13:25:57 -07:00
Henry de Valence
cf03d39f0f Merge branch 'release/1.2.3' 2019-08-07 13:25:41 -07:00
Henry de Valence
4dc8073330 Update CHANGELOG and bump version 2019-08-07 13:24:36 -07:00
Henry de Valence
b01888a929
Merge pull request #260 from fabric-and-ink/ed-decompress-simplify
Remove unneeded check for negativity in edwards point decompression
2019-08-07 12:57:24 -07:00
Fabian Drinck
26ae185bc9
Apply suggestion by @hdevalence
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2019-08-07 19:43:10 +02:00