Commit graph

252 commits

Author SHA1 Message Date
Tony Arcieri
8d1bc31805
Rename basepoint-tables to precomputed-tables (#499)
This is the name we adopted for a similar feature in @RustCrypto.

It's a bit less jargony and also leaves the door open in the future to
other types of precomputed tables.
2023-01-19 14:04:22 -05:00
Tony Arcieri
83f6b149d3
Add basepoint-tables crate feature (#489)
* Add `basepoint-tables` crate feature

Feature-gates the inclusion of basepoint tables under a
`basepoint-tables` feature, with the goal of reducing code size for e.g.
embedded applications.

* Add `mul_base` method to `EdwardsPoint` and `RistrettoPoint`

Provides fixed-base scalar multiplication which optionally uses
precomputed basepoint tables when the `basepoint-tables` feature is
enabled, providing 4X better performance.

Falls back on variable-base scalar multiplication in the event the
feature is disabled.

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-01-08 03:51:51 -05:00
Tony Arcieri
0ffcb84625
Don't set html_root_url (#483)
The recommendation to set this has been removed from the Rust API
guidelines:

https://github.com/rust-lang/api-guidelines/pull/230

It used to be used by docs.rs, but docs.rs now unconditionally sets the
`--extern-html-root-url` parameter of rustdoc which overrides it, making
it no longer needed and superfluous.
2022-12-27 05:14:34 -05:00
Tony Arcieri
7227c6fa9b
Remove Travis CI configuration (#484)
The migration to GitHub Actions occurred quite awhile ago and Travis CI
is no longer used
2022-12-27 05:13:13 -05:00
Tony Arcieri
7d53206366
Weakly activate zeroize?/alloc; MSRV 1.60 (#485)
Previously `alloc` implicitly activated `zeroize` via `zeroize/alloc`.

This commit switches to weak feature activation as added in Rust 1.60,
only activating `zeroize/alloc` if the `zeroize` dependency is
explicitly activated (which it is by default).
2022-12-27 05:12:55 -05:00
Tony Arcieri
39dbaea6f9
Make zeroize an optional dependency (#481)
* Make `zeroize` an optional dependency

The `zeroize` crate provides a defense against memory read oracles which
typically arise from memory unsafety.

Pure Rust programs may not benefit from `zeroize`, and in certain cases
the unsafe code used by `zeroize` may be more concerning.

This commit makes `zeroize` into an optional feature so users may elect
to disable it if they so desire.

* Added zeroize feature flag to README

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2022-12-26 16:19:55 -05:00
pinkforest
39053b1c5d Fix docs release pre.5 2022-12-14 11:28:52 +11:00
Michael Rosenberg
b0b22def50
Bumped prerelease version 2022-12-13 17:17:34 -05:00
Michael Rosenberg
91c2305328
Fixed docsrs flags in Cargo.toml 2022-12-13 08:48:03 -05:00
Michael Rosenberg
dbe599532f
Bumped prerelease version 2022-12-13 02:32:48 -05:00
Michael Rosenberg
d7140146f2
Add rust-version to cargo
Co-authored-by: str4d <thestr4d@gmail.com>
2022-12-12 17:50:58 -05:00
Tony Arcieri
274f4a7bec
Change Scalar::from_canonical_bytes to return CtOption (#472)
This is helpful for implementing `ff::PrimeField::from_repr`.
Also changes `Scalar::is_canonical` to return `Choice`.
2022-12-12 17:38:04 -05:00
Tony Arcieri
fa45d21b76
Use CryptoRngCore trait (#469)
This is a convenience/marker trait for types which impl `CryptoRng` +
`RngCore` which makes the type signatures a little more readable.

It was introduced in `rand_core` v0.6.4 (now pinned as the minimum
version)
2022-12-11 15:11:15 -05:00
pinkforest(she/her)
cb42e87096
Fixes curve25519_dalek_bits defaults for cross and wasm (#465)
build.rs was using cfg(target) but it has to evaluate this from env TARGET
as build.rs cfg(target) in build context is the builder host and not the target.

This change fixes curve25519_dalek_bits lottery to determine the correct
automatic curve25119_dalek_bits with the help of platforms crate.

As discussed in #456 this also prepares for well known defaults for wasm and
arm serial backend via cfg(curve25519_dalek_bits = "64")

If the wasm32 or armv7 are going to be u64 serial by default these will be
followed up on later.
2022-12-09 21:09:24 -05:00
Tony Arcieri
cc304c29ff
Use --cfg curve25519_dalek_backend to select backend (#455)
Crate features are intended to be additive, whereas only 1-of-N possible
backends can be selected.

Features can also be activated by transitive dependencies, which leads
to a problem of different dependences selecting conflicting backends.
Using `--cfg` instead moves all backend selection control to the
toplevel executable.

This commit switches to the following RUSTFLAGS to enable backends:

- `--cfg curve25519_dalek_backend="fiat"`: uses `fiat-crypto`
- `--cfg curve25519_dalek_backend="simd"`: uses nightly-only SIMD
2022-12-09 03:42:52 -05:00
Michael Rosenberg
f5dada3834
Updates to README (#453)
* Restructure README and CHANGELOG
* Explain semver policy
* Specify feature flags and backends more explicitly
* Remove nightly from the CI bc that didn't belong there
* Add @pinkforest to thankyou list

Co-authored-by: pinkforest <36498018+pinkforest@users.noreply.github.com>
2022-12-09 03:30:44 -05:00
Tony Arcieri
1013560fe4
Remove std feature (#459)
All of the existing usages of `std` can be replaced with `alloc`.

They are legacy usages from before when liballoc was stabilized.
2022-12-08 15:05:59 -05:00
pinkforest(she/her)
6b56edf776
Make digest optional (#446)
As proposed in #442 this makes `digest` an
optional feature that is not covered by the
SemVer public API stability guarantees.

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2022-12-08 13:59:28 -05:00
pinkforest(she/her)
47a0c3eacc
Make rand_core optional (#447)
As proposed in #442 this makes `rand_core` an
optional feature that is not covered by the
SemVer public API stability guarantees.

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2022-12-08 13:50:17 -05:00
pinkforest(she/her)
29466f1b45
Minor documentation fixes (#444)
* Docs unlink from dalek.rs

* Link katex assets to jsdelivr

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2022-12-07 05:36:07 -05:00
Michael Rosenberg
3e1643a99d Fixed features to tell docs.rs to use 2022-11-26 05:55:48 -05:00
pinkforest
ad7c755f49 Documentation migrate to docs.rs hosted
This change migrates all the documentation from dalek.rs
to docs.rs hosted and fixed the backend documentation
generation that was broken.
2022-11-26 11:26:25 +11:00
Tony Arcieri
081f632d91
Implement simplified backend selection (#428)
As proposed in #414, this commit changes the backend selection approach,
introspecting `target_pointer_width` to select `u32_backend` vs
`u64_backend` (or `fiat_u32_backend`/`fiat_u64_backend` if the
`fiat_backend` feature is enabled).

This helps eliminate the use of non-additive features, and also the
rather confusing errors that happen if multiple backends are selected
(i.e. thousands of lines of rustc errors).

The selection logic checks if `target_pointer_width = "64"` and uses the
64-bit backend, or falls back to the 32-bit backend otherwise. This
means the crate will always have a valid backend regardless of the
pointer width, although there may be odd edge cases for exotic platforms
which would optimally use the 64-bit backend but have a non-"64" target
pointer width for whatever reason. We can handle those cases as they
come up.
2022-11-13 12:17:42 -05:00
pinkforest(she/her)
977eb0d3b7
Bump criterion to 0.4.0 (#432) 2022-11-13 01:36:46 -05:00
Hugo Tunius
c000957bae
Remove byteorder (#418)
Instead of having a dependency on `byteorder`, use methods from the
standard library(`{to,from}_le_bytes`).
2022-10-22 03:42:23 -04:00
Michael Rosenberg
5758b8cce1
Updated to edition 2021 (#413) 2022-10-18 13:45:59 -04:00
Michael Rosenberg
51572dae8d
Relax zeroize dependency and bump MSRV (#412) 2022-10-17 15:08:34 -04:00
Isis Lovecruft
c3ed99bf93
Bump curve25519-dalek version to 4.0.0-pre.2. 2022-02-16 21:26:01 +00:00
Isis Lovecruft
f78215308a
Merge branch 'develop' into release/4.0 2022-02-16 20:57:44 +00:00
Isis Lovecruft
f7381ac64c
Pin zeroize dependency to >=1, <1.4 to relax bounds for downstreams.
As suggested by @tarcieri in #362. See also commit b6a7406.
2022-02-16 20:52:33 +00:00
Isis Lovecruft
f9f0384aee
Bump sha2 and digest dependencies to 0.10. 2022-02-01 23:48:11 +00:00
Isis Lovecruft
b6a7406c73
Pin zeroize dependency to =1.3.0 to maintain MSRV 1.41. 2022-02-01 23:29:41 +00:00
Isis Lovecruft
b131092c9b
Merge branch 'develop' into release/4.0 2022-02-01 23:28:22 +00:00
Isis Lovecruft
df4e2fa129
Bump alpha curve25519-dalek version to 4.0.0-pre.1. 2021-08-17 00:40:38 +00:00
Isis Lovecruft
62e38cd050
Merge branch 'develop' into release/4.0 2021-08-17 00:31:01 +00:00
Isis Lovecruft
076cf347ba
Fix non-unique benchmark IDs for newer criterion versions. 2021-08-17 00:22:26 +00:00
Isis Lovecruft
396d26e463
Merge branch 'develop' into release/4.0 2021-08-03 23:06:58 +00:00
Isis Lovecruft
a7f4f0ec14
Merge branch 'develop' into release/3.2 2021-08-03 23:04:34 +00:00
Isis Lovecruft
49146274db
Fix a typo in Cargo.toml documentation. 2021-07-20 02:56:28 +00:00
Isis Lovecruft
59a8616e7a Release curve25519-dalek version 3.0.3.
-----BEGIN PGP SIGNATURE-----
 
 iQB1BAAWCAAdFiEEOy1KvpA7Nj5/r96Eq0ExNTPo6BIFAmD2LGkACgkQq0ExNTPo6BJcpQD9HeDu
 PNtHRcAA6/OI1rko+PNScTUa4wRFJ9nIov8lXJwA/i/c2k0MX3Gms55wjWhdaTrFgsC+m+6F/Cmq
 xChOaPUN
 =L+SN
 -----END PGP SIGNATURE-----
 
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQB1BAAWCAAdFiEEOy1KvpA7Nj5/r96Eq0ExNTPo6BIFAmD2OpIACgkQq0ExNTPo6BLEHwEAk4Ax
 pUxJ1axcVriU3CrQANmvfJafSUU1HvUF/15HA70A/3uVJUzT5vDdb0CKNhFtar3as/zZw+pimcXb
 KvnrB54G
 =6fZN
 -----END PGP SIGNATURE-----
 

Merge tag '3.0.3' into release/3.1.1

Release curve25519-dalek version 3.0.3.
2021-07-20 02:53:03 +00:00
Isis Lovecruft
6ea874cb31
Bump curve25519-dalek version to 3.0.3. 2021-07-13 06:44:49 +00:00
Isis Lovecruft
1ee5c4defb
Update CHANGELOG and bump version to 3.2. 2021-07-13 05:32:36 +00:00
Isis Lovecruft
127c9e9060
Bump version to 4.0.0-pre.0. 2021-04-14 02:52:27 +00:00
Isis Lovecruft
c52aeb6bec
Merge remote-tracking branch 'PaulGrandperrin/patch-1' into develop 2021-04-14 02:22:31 +00:00
Isis Lovecruft
2ea17d554a
Update CHANGELOG and README; bump to 3.1.0. 2021-04-14 01:30:57 +00:00
isis agora lovecruft
cecc821f40
Merge pull request #342 from huitseeker/fiat4_with_u32
Serial backends w/formally-verified field arithmetic for 32 & 64 bits
2021-04-13 23:23:41 +00:00
isis agora lovecruft
b79a276806
Merge pull request #336 from huitseeker/elligator2
Elligator2 mapping for curve25519
2021-03-25 03:13:41 +00:00
François Garillot
d1ed427af5
add fiat backends to Travis tests 2021-01-21 08:58:21 -05:00
François Garillot
abd1922456
Add a fiat_u32 backend based on fiat-crypto as well.
Renames fiat backend directory to fiat_u64 and does the additional plumbing required to make fiat_{u32, u64}_backend equal alternatives.
Adds a few comments.
2021-01-11 15:45:24 -08:00
François Garillot
ce2e3f6e69
bump fiat-crypto version 2021-01-11 09:32:54 -08:00