2293 Commits

Author SHA1 Message Date
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
pinkforest(she/her)
533b53a0ec
Deprecate BASEPOINT_ORDER from pub API consts (#581)
* Mark constants::BASEPOINT_ORDER_PRIVATE deprecated from pub API

* Move all BASEPOINT_ORDER use private internally

Co-authored-by: Tony Arcieri <bascule@gmail.com>

* Fix CHANGELOG for 4.1.1

---------

Co-authored-by: Tony Arcieri <bascule@gmail.com>
2023-09-17 23:59:05 -04:00
Luke Parker
c157a1ed6d
Add group to documented features (#578) 2023-09-12 07:41:15 -06:00
Michael Rosenberg
e94a5fe5ab
curve: README typos 2023-09-06 00:53:30 -04: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
Michael Rosenberg
8ed1666b97
ed,x: updated repo links 2023-09-06 00:49:26 -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
Wiktor Kwapisiewicz
135476c9f5
Fix variable names in the invariant description (#573)
Previously the variable names referred to `public` and `secret` which do
not exist. Update them to `verifying_key` and `secret_key`.
2023-09-05 08:50:10 -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
Tony Arcieri
60dd3100c0
curve: add doc(hidden) to serial backend modules (#568)
We have a lot of backend types leaking via the public API, including
e.g. `FieldElement51`:

https://docs.rs/curve25519-dalek/latest/curve25519_dalek/backend/serial/u64/field/struct.FieldElement51.html

At the very least, these types shouldn't be visible in the rustdoc.

This PR hides them from the docs, but ideally we would hide them
completely from the public API (which might technically be considered a
breaking change, but IMO leaking them at all is a bug).
2023-08-28 02:38:11 -04:00
Michael Rosenberg
594b1f9ffe
Updated Cargo.toml repo and homepage links to the Github monorepo 2023-08-28 02:36:14 -04:00
Tony Arcieri
c058cd9057
curve: Expand lints (#530)
Adds a lints section to the top of lib.rs with the following:

    #![warn(
        clippy::unwrap_used,
        missing_docs,
        rust_2018_idioms,
        unused_lifetimes,
        unused_qualifications
    )]

`warn` is used instead of `deny` to prevent the lints from firing during
local development, however we already configure `-D warnings` in CI so
if any lint fails on checked-in code, it will cause a CI failure.

This commit also fixes or explicitly allows any current violations of
these lints. The main ones were:

- `clippy::unwrap_used`: replaces usages of `unwrap` with `expect`
- `rust_2018_idioms`: no implicit lifetimes, which were present on
  usages of `core::fmt::Formatter`
2023-08-28 02:32:31 -04:00
Michael Rosenberg
8e0cef5b72
curve: Add arbitrary integer multiplication with MontgomeryPoint::mul_bits_be (#555)
There is occasionally [a need](https://github.com/dalek-cryptography/curve25519-dalek/pull/519#issuecomment-1637770888) to multiply a non-prime-order Montgomery point by an integer. There's currently no way to do this, since our only methods are multiplication by `Scalar` (doesn't make sense in the non-prime-order case), and `MontgomeryPoint::mul_base_clamped` clamps the integer before multiplying.

This defines `MontgomeryPoint::mul_bits_be`, which takes a big-endian representation of an integer and multiplies the point by that integer. Its usage is not recommended by default, but it is also not so unsafe as to be gated behind a `hazmat` feature.
2023-08-28 01:58:41 -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
Sören Meier
098658dc8b
ed: Add SigningKey::as_bytes (#561)
Allows to get a reference to the secret bytes without making a copy.
2023-08-27 14:28:06 -06:00
Rob Ede
b93ace8c7f
Address Clippy lints (#543) 2023-08-27 12:47:12 -06:00
Matt Johnston
c66973c823
ed: ConstantTimeEq and PartialEq for SigningKey (#557) 2023-08-12 01:49:16 -04:00
moiseev-signal
bf2c4eea23
curve: Mark scalar::clamp_integer as must_use (#558) 2023-08-12 01:44:09 -04:00
Elichai Turkel
6dd17b2836
x: Mark x25519-dalek version 2 as stable (#554) 2023-08-11 18:18:15 -04:00
Michael Rosenberg
42b55fd117
ed: Bump ed25519-dalek to 2.0.0 (#559)
* Made clippy happy
2023-08-11 11:38:43 -04:00
Tony Arcieri
345364d4ec
Update README.md
Use non-breaking hyphens in crate names in table
2023-07-27 18:17:00 -06:00
Michael Rosenberg
e44d4b5903
curve,ed,x: Bump curve version to 4.0.0 (#550) 2023-07-22 12:52:24 -04:00
Tony Arcieri
1ac254fb1c
Remove old Cargo.lock files (#549)
These are from before the members were merged into a workspace
2023-07-22 12:30:10 -04:00
Michael Rosenberg
0d1bc975d5
Fixed CI badges in workspaces 2023-07-22 12:22:31 -04:00
Tony Arcieri
20d1346841
Fix CI failures (#548)
There are various small CI failures that are addressed in this PR.
2023-07-22 12:13:10 -04:00
Tony Arcieri
d671fc2720
README.md: fix crate table 2023-07-20 11:37:03 -06:00
Tony Arcieri
5f0d41fcec
ed25519-dalek: remove ExpandedSecretKey::to_bytes (#545)
* ed25519-dalek: remove `ExpandedSecretKey::to_bytes`

The reason `ExpandedSecretKey` needs a private `scalar_bytes` field is
to retain the canonical scalar bytes as output by SHA-512 during key
expansion so they can be serialized by the `to_bytes` method.

However, `ExpandedSecretKey`s should not be serialized to the wire.

Removing this method allows the private field to be removed, which
allows `ExpandedSecretKey` to be constructed entirely from public
fields. This provides an alternative to #544 for use cases like
Ed25519-BIP32 where the private scalar is derived rather than clamped
from bytes.

One other change is needed: `to_scalar_bytes` was changed to `to_scalar`
as the canonical scalar bytes are no longer retained, however this has
no impact on its main use case, X25519 Diffie-Hellman exchanges, where
the `Scalar` should NOT be written to the wire anyway.

* Added scalar byte comparison back to ed25519-dalek x25519 test

---------

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-07-10 22:09:40 -04:00
Michael Rosenberg
76e193415b
Merge pull request #540 from pinkforest/bump-quote
Bump `quote` and `syn`
2023-06-30 00:17:19 -04:00
pinkforest
e17a0e771a
Bump quote and syn 2023-06-30 04:07:19 +00:00
Michael Rosenberg
f789810e33
Merge pull request #536 from pinkforest/monorepo-t1
Pulls ed25519-dalek and x25519-dalek in. We're now one happy monorepo.
2023-06-29 23:48:46 -04:00
Michael Rosenberg
98a0a6f2ef
Moved code of conduct 2023-06-29 23:35:29 -04:00
pinkforest
bf8b21c439
Add new workspace README and CONTRIBUTING
Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-28 09:40:52 +00:00
pinkforest
7db9981a7f
Re-work CI around workspace
Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-28 09:38:56 +00:00
pinkforest
6e422d96d7
Re-organize Cargo manifests to workspace 2023-06-28 09:38:06 +00:00
pinkforest
2cc52c216e
Move CI & assets into workspace
Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-28 08:59:51 +00:00
pinkforest
bf0e37d3ed
Workspace x25519 under x25519-dalek 2023-06-27 04:09:32 +00:00
pinkforest
e7ecb74ed0
Merge remote-tracking branch 'x/main' into monorepo-t1 2023-06-27 04:06:50 +00:00
pinkforest
d62def9c22
Workspace ed25519 under ed25519-dalek 2023-06-27 04:04:09 +00:00
pinkforest
52742e7864
Merge remote-tracking branch 'ed/main' into monorepo-t1 2023-06-27 04:01:16 +00:00
pinkforest
40cf5aff99
Workspace curve25519 under curve25519-dalek 2023-06-27 04:00:12 +00:00
pinkforest(she/her)
8613b5a809
chore: Release 2.0.0-rc.3 (#128)
* chore: Release 2.0.0-rc.3

* cargo update -p curve25519-dalek

* Added note about backends

* Fixed docs broken link

---------

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-23 23:54:38 -04:00
pinkforest(she/her)
58a967f6fb
chore: Release 2.0.0-rc.3 (#307)
* chore: Release 2.0.0-rc.3

* cargo update -p curve25519-dalek

* Removed some old backend selection prose and env vars

---------

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-23 23:53:10 -04:00
pinkforest(she/her)
2e3212b8cc
chore: Release 4.0.0-rc.3 (#535) 2023-06-23 17:13:20 -04:00
pinkforest(she/her)
e429bde88d
Clean up backend features and vendor curve25519_dalek_derive (#531)
* Vendor import unsafe_target_features as curve25519-dalek-derive

Co-authored-by: Jan Bujak <jan@parity.io>

* Remove feature gates from avx2/ifma

* Add buildtime compile diagnostics about backend selection

* Add build script tests

* Documentation changes

* Disable simd related features unless simd was determined via build

* Add note and test about the override warning when unsuccesful

* Reduce complexity in build gating via compile_error

---------

Co-authored-by: Jan Bujak <jan@parity.io>
Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-06-22 01:46:27 -04:00
Michael Rosenberg
9b166b75e0
Update to new Scalar API (#293)
* Updated to new curve25519 scalar API

* Made ExpandedSecretKey.scalar_bytes unclamped; clamping occurs in all scalar-point multiplication

* Added legacy compat deprecation notice

* Removed deprecation notice on check_scalar

* Removed unnecessary unwraps
2023-06-12 00:06:00 -04:00
Michael Rosenberg
e111b5d913
Merge pull request #523 from koute/main_runtime_simd
Runtime backend autodetection
2023-06-10 22:01:03 -04:00
Jan Bujak
50aa63532b
Fix the doc comment in packed_simd.rs 2023-06-05 16:42:45 +09:00