Commit graph

44 commits

Author SHA1 Message Date
Arthur Gautier
3958e0ebf7
bump rustcrypto dependencies to released versions (#902)
This bumps `pkcs8`, `signature`, `spki`, `sha3`, and `der` to newly released versions.

This also bumps the version of `blake2`, `rustcrypto-ff`,
`rustcrypto-group`, and `ed25519` to their latest pre-released versions.
2026-05-02 15:06:44 -06:00
Tony Arcieri
bad078de58
Bump cpufeatures to v0.3 (#894)
Release PR: RustCrypto/utils#1446
2026-03-29 17:55:42 -04:00
Tony Arcieri
53a86c7c9c
Bump digest and sha2 to v0.11 (#893)
Release PRs:
- `digest`: RustCrypto/traits#2300
- `sha2`: RustCrypto/hashes#806
2026-03-29 17:29:12 -04:00
Michael Rosenberg
61533d75cf
curve,x,ed: Prepare for pre.6 release (#879) 2026-02-04 16:25:03 +01:00
Tony Arcieri
ea475248ae
curve,ed,x: Bump rand_core to v0.10; getrandom to v0.4 (#877)
Also bumps additional RustCrypto dependencies
2026-02-03 12:34:37 -05:00
Michael Rosenberg
59305b4e26
curve,ed: Update digest and sha2 deps (#875)
Co-authored-by: Michael Rosenberg <mrosenberg@cloudflare.com>
2026-02-02 16:39:43 -07:00
Michael Rosenberg
11f5375375
curve,x,ed: Prepare for pre.5 release (#874) 2026-01-25 02:03:25 +01:00
Tony Arcieri
b7531ca318
Bump rand_core to v0.10.0-rc-6 (#873)
This also rips out `rand`: it's just acting as a facade for what we're
using that complicates these sorts of upgrades.
2026-01-25 01:29:05 +01:00
Arthur Gautier
56a6bc07b8
chore(deps): bump rand_core to 0.10.0-rc-5 (#870) 2026-01-21 12:52:56 -07:00
Michael Rosenberg
e5a7986970
curve,ed,x: Bump prerelease version to fix build (#863) 2026-01-03 16:52:34 +01:00
Tony Arcieri
9d6ec949ad
Bump rand_core to v0.10.0-rc-3 (#860)
Most of the changes in this PR are actually from the associated `rand`
crate updates which are happening in rust-random/rand#1697, notably
`OsRng` has been renamed to `SysRng` (and is now provided by the
`getrandom` crate).

We do use some `rand_core` APIs in a few places though, like the STROBE
implementation, where this migrates from `rand_core::le` to
`rand_core::utils`.
2025-12-27 09:53:24 -07:00
Michael Rosenberg
3d76df7c24
Fix docs build and prep prerelease (#855)
* Fix failing docs build

* Remove hiding of docsrs cfg gate in crates where it doesn't appear

* Add docsrs build regression check to CI
2025-12-04 18:06:40 -05:00
Michael Rosenberg
81c642d74f
Prep pre.2 prereleases (#849) 2025-11-22 22:09:59 +01:00
Tony Arcieri
23d0d2cec0
Bump rand_core from v0.9 to v0.10.0-rc-2 (#842)
Prior to a final stable release of the @RustCrypto dependencies used by
the dalek crates, we are going to target `rand_core` v0.10.

This updates the `rand` and `rand_core` dependencies as well as the
aforementioned @RustCrypto dependencies to be compatible with
`rand_core` v0.10, which incurred a few API changes:

- `rand_core` no longer includes `OsRng`, so this replaces the `os_rng`
  features with `getrandom` features (same thing we did for @RustCrypto)
  which uses the `getrandom` crate directly
- For `dev-dependencies` it just migrates straight to `rand`, replacing
  `rand_chacha` with the `chacha` feature of `rand` (which pulls in
  `chacha20`), and sourcing `OsRng` from `rand`, its new home (for now)

This PR also switches to using the `rustcrypto-ff`/`rustcrypto-group` crates
(hopefully temporary) which are forks of `ff` and `group` which have crate
releases that have been updated to use  `rand_core` v0.10.0 prereleases.
2025-11-22 10:37:51 -07:00
Michael Rosenberg
b76b924080
Implement Lizard encoding/decoding (#826)
* Vendor lizard hash to curve from Signal

* Add invalid Lizard encoding test

* Added lizard details to readme and changelog

* Upgrade ristretto.sage to Python3

* Add lizard test vector generation to ristretto.sage

* Added map_to_curve and its inverse

* Use CtOption instead of bitmasks; other cleanup

* Add README to lizard folder

* Split map_to_curve into map_to_curve and map_to_curve_restricted; make its inverse return 16 elements

* Consolidate Ristretto Elligator functions into its own file
2025-10-24 17:20:50 -04:00
Michael Rosenberg
cf1c77de6e
curve: Bump version to 5.0.0-pre.1 (#822) 2025-09-04 00:21:22 -04:00
Tony Arcieri
59ab400f1b
Bump RustCrypto dependencies (#815)
Updates the following dependencies (which now use `hybrid-array` v0.4
instead of v0.3):

- `blake2` v0.11.0-rc.2
- `digest` v0.11.0-rc.1
- `ed25519` v3.0.0-rc.0
- `sha2` v0.11.0-rc.2
- `sha3` v0.11.0-rc.2
- `signature` v3.0.0-rc.3
2025-09-03 17:12:43 -04:00
Tony Arcieri
fc8815721c
Scalar::div_by_2 (#805)
* [WIP] Scalar::div_by_2

* debug_assert that carry is 0

* revise tests

* Test multiply by half scalar, double and compress (#804)

* Test `div_by_2` with `proptest` (#806)

---------

Co-authored-by: daxpedda <daxpedda@gmail.com>
2025-08-22 20:45:51 +02:00
Arthur Gautier
246723eefe
workspace: use a global patch.crates-io to avoid duplicates (#793)
When pulling crates via git (to grab non-released yet fixes or
otherwise), the `path = "../"` in each crate crates duplicates unless
you pull the whole tree in your local `[patch.crates-io]`.

This creates issues in downstream packaging (nix, ...) where a crate
version can only appear once.
Those are somewhat difficult to diagnose.

Using a `[patch.crates-io]` in the workspace serves the same purpose but
does not create the duplication in consumers' tree.
2025-07-18 08:26:13 -06:00
Michael Rosenberg
fc8a8a5276
Cut pre.0 prereleases (#784) 2025-07-09 19:04:17 +02:00
Arthur Gautier
a99efe2304
curve,ed,x: Bump rand_core to 0.9 (#777)
---------

Co-authored-by: pinkforest <36498018+pinkforest@users.noreply.github.com>
2025-07-07 15:36:11 -04:00
Tony Arcieri
a9aa94736b
Bump digest, ed25519, signature, and sha2 (#676)
Bumps the aforementioned dependencies to their latest (pre)releases.
2025-07-07 11:34:26 -06:00
Tony Arcieri
53df025bb3
Bump edition to 2024 and crate versions to prereleases (#775)
This represents the first breaking change in a new release series,
bumping all crates to the 2024 edition of Rust.

As such, the version numbers of all crates have been incremented to
represent a new prerelease series:

- `curve25519-dalek`: v5.0.0-pre
- `ed25519-dalek`: v3.0.0-pre
- `x25519-dalek`: v3.0.0-pre

Note that this commit isn't intended to cut associated crate releases of
these on crates.io, but is merely bumping the version numbers to denote
there are pending breaking changes.

This commit also includes rustfmt changes which were made as part of the
2024 edition.

Also includes clippy fixes.
2025-07-07 11:52:25 -04:00
Iñigo Querejeta Azurmendi
25a9dbb811
curve: Hash to curve and field as defined in the standard (#377)
* Implementation of `hash_to_field` as defined in the standard
* Implementation of `hash_to_curve` as defined in the standard, by changing the mechanism over which we chose the sign.
* For the point above, had to change the `elligator_encode` to return whether `eps` is a square or not (required for `hash_to_curve`).
* Included test vectors of the draft.
* Included `FieldElement::from_bytes_wide(bytes: &u8; 64])` to reduce integers encoded in 64 bytes.
2025-07-05 22:01:26 +02:00
Arthur Gautier
8c0cf3a64f
chore(deps): bump cpufeatures from 0.2.12 to 0.2.17 (#750)
This fixes warnings like:
```
warning: unexpected `cfg` condition value: ``
  --> curve25519-dalek/src/backend/mod.rs:58:9
   |
58 |         cpufeatures::new!(cpuid_avx512, "avx512ifma", "avx512vl");
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
2025-05-08 14:06:28 -06:00
pinkforest(she/her)
b636fb8ee4
Make AVX512IFMA opt-in backend (#695)
* Make AVX512IFMA opt-in backend

* Updated README to have backend info

* Added entry to changelog

---------

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2024-09-08 01:13:36 -04:00
Elichai Turkel
79ab6c29bd
curve: Implement ConditionallySelectable for MontgomeryPoint (#677) 2024-07-30 01:51:44 -04:00
Simon Wülker
35e78b21ef
Enable unexpected cfgs lint (#656)
Previously, the only way to configure this lint was using a build.rs
file, but now it can be done using Cargo.toml as well.
2024-07-25 20:24:39 -06:00
Tony Arcieri
5b7082bbc8
curve: use subtle::BlackBox optimization barrier (#662)
Replaces the security mitigation added in #659 and #661 for
masking-related timing variability which used an inline `black_box`
using the recently added `subtle::BlackBox` newtype (see
dalek-cryptography/subtle#123)

Internally `BlackBox` uses a volatile read by default (i.e. same
strategy which was used before) or when the `core_hint_black_box`
feature of `subtle` is enabled, it uses `core::hint::black_box`
(whose documentation was recently updated to reflect the nuances of
potential cryptographic use, see rust-lang/rust#126703)

This PR goes ahead and uses `BlackBox` for both `mask` and
`underflow_mask` where previously it was only used on `underflow_mask`.
The general pattern of bitwise masking inside a loop seems worrisome for
the optimizer potentially inserting branches in the future.

Below are godbolt inspections of the generated assembly, which are free
of the `jns` instructions originally spotted in #659/#661:

- 32-bit (read_volatile): https://godbolt.org/z/TKo9fqza4
- 32-bit (hint::black_box): https://godbolt.org/z/caoMxYbET
- 64-bit (read_volatile): https://godbolt.org/z/PM6zKjj1f
- 64-bit (hint::black_box): https://godbolt.org/z/nseaPvdWv
2024-06-24 20:13:54 +02:00
Michael Rosenberg
5312a0311e
curve: Bump version to 4.1.3 (#660)
* Bumped to v4.1.3

* Added recent PRs to changelog
2024-06-18 21:18:51 +02:00
pinkforest(she/her)
31ccb67050
Remove platforms in favor using CARGO_CFG_TARGET_POINTER_WIDTH (#636) 2024-03-01 07:35:23 -07:00
Michael Rosenberg
4ac84dd066
curve,ed,x: Bump patch version to reflect fix to nightly SIMD build (#621) 2024-02-06 20:09:18 -05:00
Michael Rosenberg
0cd099a9fb
curve: Bump version to 4.1.1 (#584) 2023-09-20 17:42:22 -05:00
Luke Parker
76a8b2a081
Add PrimeFieldBits support to Scalar (#579)
Co-authored-by: Michael Rosenberg <micro@fastmail.com>
Co-authored-by: pinkforest(she/her) <36498018+pinkforest@users.noreply.github.com>
2023-09-19 23:21:43 -04:00
Luke Parker
c157a1ed6d
Add group to documented features (#578) 2023-09-12 07:41:15 -06:00
pinkforest(she/her)
9db51a6bf7
curve: Release 4.1.0 (#574)
Co-authored-by: Rob Ede <robjtede@icloud.com>
2023-09-06 00:51:15 -04:00
Tony Arcieri
1ec4a36a80
curve: update repository in Cargo.toml (#575)
Point to the subdirectory which contains the crate
2023-09-06 00:08:06 -04:00
David Cook
a3a08b01ab
Adapt to new types introduced in fiat-crypto 0.2 (#566) 2023-09-05 10:07:49 -06:00
pinkforest(she/her)
5c5a32057c
curve: Fix no_std for fiat backend and add test for it (#572) 2023-09-04 13:49:58 -06:00
Rob Ede
c8d1d400f1
curve,ed: chore: update dev deps (#569) 2023-08-28 09:46:38 -04:00
pinkforest(she/her)
4373695c50
curve: implement ff and group traits (#562)
Originally authored by @str4d as #473
2023-08-27 14:41:06 -06:00
Michael Rosenberg
e44d4b5903
curve,ed,x: Bump curve version to 4.0.0 (#550) 2023-07-22 12:52:24 -04:00
pinkforest
6e422d96d7
Re-organize Cargo manifests to workspace 2023-06-28 09:38:06 +00:00
pinkforest
40cf5aff99
Workspace curve25519 under curve25519-dalek 2023-06-27 04:00:12 +00:00
Renamed from Cargo.toml (Browse further)