Commit graph

2411 commits

Author SHA1 Message Date
Michael Rosenberg
d6c3cbf97d
Merge branch 'main' into release/2.0 2023-03-20 14:19:38 -04:00
Samuel Moelius
7dc1bbd855
Remove two unnecessary into_iter (#290) 2023-03-18 09:22:15 -06:00
pinkforest(she/her)
99c0520aa7
Fixes cfg with target from env (#516)
* Fixes cfg with target from env

* Derive cleanup

* Default to curve25519_dalek_bits="32" on unknown target

* Give out warning (thanks @jcape)

Co-authored-by: ryan <ryankurte@users.noreply.github.com>
Co-authored-by: James Cape <james@mobilecoin.com>
2023-03-18 04:34:47 -04:00
Jordan Rose
a63e14f4de
Use ok_or_else instead of ok_or in serde decoding (#382)
Serde errors are not simple enums; they format a full error string
from their arguments. It's worth not doing that up front.
2023-03-13 21:42:01 -06:00
Tony Arcieri
987f7d6baf
Merge pull request #115 from pinkforest/fix-docsrs
Fix docsrs
2023-03-12 15:16:09 -06:00
pinkforest
379e506336
Merge remote-tracking branch 'origin/release/2.0' into fix-docsrs 2023-03-13 07:22:56 +11:00
pinkforest
5080b42601
Merge remote-tracking branch 'origin/release/2.0' into fix-no_std 2023-03-13 07:22:03 +11:00
Tony Arcieri
853a3df1a7
Merge pull request #109 from pinkforest/fix-ci
Fix CI
2023-03-12 13:04:05 -06:00
pinkforest
0139af7f9d
Remove rustup in favor of rust-toolchain 2023-03-13 05:15:34 +11:00
pinkforest
4b6c61c111
Correct crate name 2023-03-12 16:49:18 +11:00
pinkforest
a7769a645c
Add assets 2023-03-12 16:48:15 +11:00
pinkforest
281fab6af0
Fix docsrs 2023-03-12 16:45:37 +11:00
pinkforest
f3c46bc3bf
Remove redundant feature 2023-03-12 15:27:53 +11:00
pinkforest
fdc992d6cd
Fix no_std with get_random 2023-03-12 14:18:07 +11:00
pinkforest
cbd3958772
Fix bench features 2023-03-12 13:50:50 +11:00
pinkforest
707675d878
Disable no_std from CI 2023-03-12 13:43:48 +11:00
pinkforest
c779e215f7
Fixed doc nit from update-ci branch
Co-Authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-03-12 13:42:31 +11:00
pinkforest
be8a657ece
Add .lock 2023-03-12 13:27:44 +11:00
pinkforest
8c9c94add9
Add Cargo.lock 2023-03-12 13:22:52 +11:00
pinkforest
5cb2a4953a
Test all features and no_std iterate 2023-03-12 13:19:39 +11:00
pinkforest
62149c4f80
Fix CI 2023-03-12 13:16:01 +11:00
pinkforest(she/her)
67b8c2e40c
Fix error for custom targets (#510) 2023-03-10 13:21:20 -05:00
Dirk Stolle
64b26ad074
Fix a few typos (#281) 2023-03-07 02:54:30 -05:00
Dirk Stolle
c33b49bf5a
Update actions/checkout in GitHub Actions workflow to v3 (#282) 2023-03-07 02:44:55 -05:00
Dirk Stolle
3efde345b6
Remove invalid input fields from CI action for Rust setup (#283)
Neither `override` nor `profile` are valid inputs for the
`dtolnay/rust-toolchain` action. It always uses the minimal
profile anyways.
2023-03-07 02:35:10 -05:00
Tony Arcieri
e0e02cfcf4
Bump ed25519 to v2.2; pkcs8 to v0.10 (#285)
The `ed25519` v2.2.0 crate bumps the `pkcs8` dependency to v0.10.

This updates `ed25519` to the latest version and updates the PKCS#8
support to use the new API.
2023-03-07 02:20:09 -05:00
Tony Arcieri
4686ade1b5
Use named fields for struct VerifyingKey (#284)
Previously it was a 2-tuple containing a `CompressedEdwardsY`
serialization and a decompressed `EdwardsPoint`, however using
`.0` and `.1` for these respectively makes the code hard to read.

This commit changes them to `compressed` and `point`, which as it were
are the names of the local variables used when constructing a
`VerifyingKey`, which improves clarity.
2023-03-07 02:16:19 -05:00
Tony Arcieri
97d6d5544a
Merge pull request #106 from striezel-stash/fix-typos
Fix two typos
2023-02-26 07:37:26 -07:00
Dirk Stolle
327618c7d8 Fix two typos 2023-02-24 22:22:19 +01:00
Tony Arcieri
3194759f6e
Merge pull request #96 from dlblv/fix/add-secret-as-bytes
Add `.as_bytes()` method for `StaticSecret`
2023-02-17 09:52:53 -07:00
Michael Rosenberg
619ef68d73
Merge pull request #279 from rozbb/main
Bump curve25519 dep to rc.1
2023-02-04 10:06:05 -05:00
Michael Rosenberg
0b04124175
Fixed MSRV build 2023-02-04 03:24:09 -05:00
Michael Rosenberg
b77fa51569
Bump curve25519-dalek dep to rc.1 2023-02-04 03:21:36 -05:00
Michael Rosenberg
ce3eed873c
Merge pull request #278 from dalek-cryptography/release/2.0
Merge `release/2.0` into `main`
2023-02-02 18:12:59 -05:00
Michael Rosenberg
b2d0f0ecd7
Bump to rc.1 2023-02-02 17:21:56 -05:00
Michael Rosenberg
57a8add0fd
Removed vestigial nightly feature from docsrs instructions 2023-02-02 17:18:47 -05:00
Michael Rosenberg
783b6e81c4
README changes for 2.0 (#275)
* Added items to changelog for 2.0 release

* Removed unnecessary uses of std in doctests

* Gated `Context` behind `digest`

* Fixed noncompiling doctest when only `digest` is enabled

* README feature flag list mostly done

* Copied changelog to readme

* Redid the malleability section in README

* Added CONTRIBUTING.md

* Bumped version number to 2.0.0-pre.0; small changes to README

* Updated changelog for #277

* Added pem feature description

Co-authored-by: pinkforest(she/her) <36498018+pinkforest@users.noreply.github.com>
2023-02-02 17:07:56 -05:00
Michael Rosenberg
3b71630d9f
Fix docsrs build (#505)
* Add docsrs build to CI

* Put cfg flags in both RUSTFLAGS and RUSTDOCFLAGS
2023-02-02 04:06:14 -05:00
Michael Rosenberg
5190ad6df8
Impl VerifyingKey::is_weak (#277)
* Implemented VerifyingKey::is_weak

* Added unit test for VerifyingKey::is_weak
2023-01-31 16:23:38 -05:00
Tony Arcieri
b375b46d37
Fixed-based Montgomery scalar multiplication (#503)
* Fixed-based Montgomery scalar multiplication

Adds `MontgomeryPoint::mul_base` as an API for fixed-base scalar
multiplication which allows for potential future optimizations.

As a baseline implementation, it uses the variable base scalar
multiplication implementation.

This follows the existing `EdwardsPoint::mul_base` and
`RistrettoPoint::mul_base` APIs.

* Added Montgomery mul_base bench

* Switched MontgomeryPoint::mul_base to use EdwardsPoint::mul_base

---------

Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-01-31 03:37:03 -05:00
Tony Arcieri
79bcbdc89b
Re-export commonly used types from toplevel (#502)
Re-exports the following commonly used types from their respective
modules to the toplevel of the crate, which makes them easier to access:

- `EdwardsPoint`
- `MontgomeryPoint`
- `RistrettoPoint`
- `Scalar`
2023-01-29 13:53:43 -05:00
Michael Rosenberg
e9fe4145fe
Merge pull request #95 from dignifiedquire/update-deps
Updates curve25519-dalek dep to use 4.0.0-rc.0
This includes several feature flag updates and some
minor API changes.
2023-01-29 04:35:12 -05:00
Michael Rosenberg
83300618ad
Attempt to fix CI 2023-01-29 04:29:44 -05:00
Michael Rosenberg
88cc32b687
Updated to curve25519-dalek rc0 2023-01-29 04:29:07 -05:00
Tony Arcieri
1b86ff1d3e
Bump curve25519-dalek to v4.0.0-rc.0 (#276)
Eliminates the `patch.crates-io` directive by using the latest RC
release of `curve25519-dalek` on crates.io
2023-01-28 18:56:35 -05:00
Michael Rosenberg
1a388f7135
Bump version to 4.0-rc.0 (#501) 2023-01-27 14:14:58 -05:00
pinkforest(she/her)
928d6d15f8
Docs.rs + README changes for 2.x (#241) 2023-01-27 01:06:24 -05:00
Tony Arcieri
861784f57e
Add Context type (#273)
* Add `Context` type

Adds a generic type which can be used with `SigningKey` and
`VerifyingKey` for storing a context string value along with the key for
use with `DigestSigner` and `DigestVerifier`.

* Added Context tests, docs, and re-exports

* Added docs about SHA-512 for prehashing; re-re-exported Sha512

Co-authored-by: Tony Arcieri <bascule@gmail.com>
Co-authored-by: Michael Rosenberg <michael@mrosenberg.pub>
2023-01-26 15:41:20 -05:00
Tony Arcieri
27ba9dd614
Bump ed25519 crate dependency to v2.1 (#272)
The original v2.0.0 release has been yanked.

This release includes a different infallible parsing API which can be
used to eliminate some usages of `unwrap()`.
2023-01-21 17:59:11 -05:00
Michael Rosenberg
c2b8978927
Do byte comparison in all verify_* functions (#269)
* Made all signature R comparisons byte-wise

* Use Scalar::from_bits_clamped rather than manually clamping

* Added clippy lints and comments for use of unwrap()

* Clarify use of unused
2023-01-21 01:05:54 -05:00