Commit Graph

165 Commits

Author SHA1 Message Date
rvolgers ed5ba6aeed Clarify purpose of FromDigest trait (#244)
Co-authored-by: Ronald Volgers <rvolgers@users.noreply.github.com>
2021-02-15 07:44:28 -08:00
rvolgers 71c94ee0f0 Change HmacDrbg to support variable output size (#243)
This is simply a matter of iterating the hashing of self.v until
sufficient output bytes have been produced.

This is necessary for the upcoming DSA implementation.

Co-authored-by: Ronald Volgers <rvolgers@users.noreply.github.com>
2021-02-12 08:00:06 -08:00
Tony Arcieri e24ccec800 ecdsa v0.11.0-pre.1 (#242) 2021-02-11 08:10:31 -08:00
Tony Arcieri 3f118b57d0 ecdsa: bump elliptic-curve crate to v0.9.2 (#241) 2021-02-11 07:14:53 -08:00
Tony Arcieri eaaf5b8699 ecdsa: bump elliptic-curve dependency to v0.9 (#239) 2021-02-10 11:44:07 -08:00
Tony Arcieri 19558849ad ecdsa: add FromDigest trait (#238)
Adds the `FromDigest` trait, originally from the `elliptic-curve` crate:

https://github.com/RustCrypto/traits/pull/532

Since this trait implements ECDSA-specific concerns, it was removed from
the `elliptic-curve` crate in the above PR to make room for things like
hash-to-curve constructions. See:

https://github.com/RustCrypto/traits/issues/481
2021-02-10 10:16:33 -08:00
Tony Arcieri bbc68d977d Bump der and pkcs8 dependencies (#231) 2021-01-22 12:54:48 -08:00
Tony Arcieri 410c6762e1 Cargo.lock: bump deps to flat-namespaced elliptic-curve crate (#230)
See: https://github.com/RustCrypto/traits/pull/487
2021-01-21 18:45:15 -08:00
Tony Arcieri cc887c7ba6 Cargo.lock: bump deps (#229)
This is mostly to ensure that recent changes to the `elliptic-curve`
crate didn't break anything in the `ecdsa` crate.
2021-01-21 15:58:39 -08:00
Tony Arcieri 41a3646229 ecdsa: remove FieldBytes bounds (#227)
These are no longer needed as of `ff` v0.9:

https://github.com/zkcrypto/ff/pull/43
2021-01-13 06:43:00 -08:00
Tony Arcieri 46e4f3729c ecdsa: use der crate for decoding/encoding signatures (#226)
Renames `ecdsa::asn1::Signature` to `ecdsa::der::Signature`, with the
`ecdsa::der` module now gated under the `der` crate feature.

Uses the newly introduced `BigUInt` type in the `der` crate to handle
parsing the signatures. This consolidates all ASN.1 DER
decoding/encoding logic in the `der` crate.
2021-01-12 14:17:44 -08:00
Tony Arcieri dfd4413482 ecdsa: bump elliptic-curve to v0.9.0-pre (#225)
Sourced via git using a `patch.crates-io` directive.

Also bumps `signature` to 1.3.x
2021-01-12 08:57:27 -08:00
dependabot[bot] 8f8b553fff build(deps): bump elliptic-curve from 0.8.3 to 0.8.4 (#220)
Bumps [elliptic-curve](https://github.com/RustCrypto/traits) from 0.8.3 to 0.8.4.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/elliptic-curve-v0.8.3...elliptic-curve-v0.8.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-24 07:26:31 -08:00
Tony Arcieri b95bb981f2 ecdsa v0.10.2 (#219) 2020-12-22 08:13:37 -08:00
Tony Arcieri fbb16f7b2f ecdsa: use the dev module from the elliptic-curve crate (#218)
The `ExampleCurve` previously defined in this crate for testing has been
extracted into the `elliptic-curve` crate.
2020-12-22 08:01:15 -08:00
Tony Arcieri ec84aa6981 ecdsa v0.10.1 (#217)
This is a release solely to trigger a rebuild on docs.rs.

The previous build failed due to a `nightly` regression in the upstream
`elliptic-curve` crate:

https://github.com/RustCrypto/traits/pull/412

Crate is otherwise unchanged from the previous release.
2020-12-16 21:57:09 -08:00
Tony Arcieri 300e8d4b02 ecdsa v0.10.0 (#216) 2020-12-16 20:41:13 -08:00
Tony Arcieri 03dea3b860 ecdsa: bump elliptic-curve dependency to v0.8 (#215) 2020-12-16 20:35:35 -08:00
Tony Arcieri dfcbaeca40 ecdsa v0.10.0-pre (#214) 2020-12-16 19:16:11 -08:00
Tony Arcieri ffcf74ff03 ecdsa: bump elliptic-curve dependency to v0.8.0-pre (#213) 2020-12-16 19:06:30 -08:00
Tony Arcieri 6692f6f726 ecdsa: add MSRV policy to rustdoc (#208) 2020-12-06 10:03:58 -08:00
Tony Arcieri 63aeb25a38 ecdsa: minor doc improvements (#207) 2020-12-06 08:12:32 -08:00
Tony Arcieri 6357c461d1 ecdsa v0.9.0 (#206) 2020-12-06 07:01:50 -08:00
Tony Arcieri 8663641c2c ecdsa: rename SigningKey::new() to ::from_bytes (#205)
More consistent with the rest of the method names in the
`elliptic-curve` crate and `VerifyingKey`
2020-12-06 06:47:28 -08:00
Tony Arcieri f07d30b238 ecdsa: bump elliptic-curve crate to v0.7; MSRV 1.46+ (#204) 2020-12-06 06:36:51 -08:00
Tony Arcieri 3a0cd5b35b ecdsa: PKCS#8 support (#203)
Impls the `FromPrivateKey` and `FromPublicKey` traits from the `pkcs8`
crate.
2020-12-06 06:11:47 -08:00
Tony Arcieri be52d7c204 Revert "ecdsa: explicit Copy impl for VerifyKey (#201)" (#202)
This reverts commit 91cb79edde.

Fixed the root cause upstream in the `elliptic-curve` crate:

https://github.com/RustCrypto/traits/pull/379
2020-12-02 19:10:11 -08:00
Tony Arcieri 91cb79edde ecdsa: explicit Copy impl for VerifyKey (#201)
The derived impl does not have the correct bounds
2020-12-02 18:53:51 -08:00
Tony Arcieri e6716ab9a8 ecdsa: rename VerifyKey to VerifyingKey (#200)
Per the discussion in #196, renames `VerifyKey` => `VerifyingKey` for
better consistency with `SigningKey`.
2020-12-02 18:39:17 -08:00
Tony Arcieri 00feeed454 ecdsa: simplify VerifyKey trait bounds (#199)
Uses simpler bounds implemented in RustCrypto/traits#378
2020-12-02 18:33:03 -08:00
Tony Arcieri 6c32603bd8 ecdsa: make VerifyKey a newtype of elliptic_curve::PublicKey (#198) 2020-12-02 17:54:00 -08:00
Tony Arcieri 90607f556b ecdsa: make SigningKey a newtype of elliptic_curve::SecretKey (#197)
The latter wraps up many of the concerns of secret key management,
including computing public keys, encoding/decoding, and zeroization.
2020-12-02 16:39:44 -08:00
Tony Arcieri c7f5009df5 ecdsa: PublicKey<C> <-> VerifyKey<C> conversions (#195) 2020-11-11 07:28:33 -08:00
dependabot[bot] a91afc5958 build(deps): bump hmac from 0.9.0 to 0.10.1 (#191)
Bumps [hmac](https://github.com/RustCrypto/MACs) from 0.9.0 to 0.10.1.
- [Release notes](https://github.com/RustCrypto/MACs/releases)
- [Commits](https://github.com/RustCrypto/MACs/compare/hmac-v0.9.0...hmac-v0.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-10 08:09:59 -08:00
Tony Arcieri 3e9e0c2dab ecdsa: bump elliptic-curve dependency to v0.7.0-pre (#194)
Using git-based dependency
2020-11-10 08:03:29 -08:00
David Drysdale 7b37895503 Extra ASN.1 validity checks (#192)
* ecdsa: add test for too-short ASN1 signatures

* ecdsa: check minimum ASN.1-encoded signature length

* ecdsa: add test for non-DER ASN1 signature

This is a minimal test that's equivalent to:
https://github.com/google/wycheproof/blob/2196000605e4/testvectors/ecdsa_secp256k1_sha256_test.json#L57-L66

* ecdsa: reject non-minimal SEQUENCE length as non-DER
2020-10-20 05:34:27 -07:00
Tony Arcieri e1e8fa24d2 ecdsa: add more toplevel rustdoc (#189)
Link to `ring-compat` crate.
2020-10-15 10:17:23 -07:00
Tony Arcieri 2df3cfd16c README.md(s): add Zulip badges (#186) 2020-10-10 06:30:16 -07:00
Tony Arcieri 0160df0cbd ecdsa v0.8.5 (#185) 2020-10-09 08:25:54 -07:00
Tony Arcieri 8a5e64c10e ecdsa: fix default impl of CheckSignatureBytes (#184)
The logic was reversed and it was rejecting valid signatures
2020-10-09 08:18:37 -07:00
Tony Arcieri dd343fb505 ecdsa v0.8.4 (#182) 2020-10-08 13:32:06 -07:00
Tony Arcieri 96ffe73645 ecdsa: work around nightly-2020-10-06 breakage (#180)
The `ecdsa` crate no longer builds on `nightly`, possibly due to:

https://github.com/rust-lang/rust/issues/77638

Unfortunately this means rustdoc builds on https://docs.rs fail!

This commit works around the issue.
2020-10-08 13:20:10 -07:00
Tony Arcieri a383e8025d ecdsa v0.8.3 (#178) 2020-09-28 12:37:42 -07:00
Tony Arcieri a404debf56 ecdsa: fix 32-bit builds for the dev feature (#177)
They weren't tested before. They are now!
2020-09-28 12:23:16 -07:00
Tony Arcieri cc78368e77 ecdsa v0.8.2 (#176) 2020-09-27 09:48:04 -07:00
Tony Arcieri 8332711537 ecdsa: have RecoverableSignPrimitive return a bool flag (#175)
...as opposed to using a separate associated type.

As it were, this is how the method is documented. It was changed at some
point but the comments were never updated.
2020-09-27 09:05:09 -07:00
Tony Arcieri 0993b4b343 Revert "ecdsa: remove RecoverableSignPrimitive" (#174)
This reverts commit a03cda2372 (#146)

Revives `RecoverableSignPrimitive` since there have been some
requests/use cases for it.

First, there was interest in supporting such a primitive for `p256`:

https://github.com/RustCrypto/elliptic-curves/pull/184

Second, it would be helpful for Ethereum, since it seems implementations
often use (HMAC-DRBG-)SHA-256 for RFC6979, but Keccak256 as the message
digest function. Exposing this interface would allow for such
combinations which aren't possible otherwise.
2020-09-27 08:52:20 -07:00
Tony Arcieri 3d14980376 ecdsa v0.8.1 (#172) 2020-09-23 19:56:46 -07:00
Tony Arcieri aada23c66b ecdsa: conditionally make VerifyKey<C> a Copy type (#171)
...in cases where AffinePoint<C> is a `Copy` type
2020-09-23 19:34:13 -07:00
Tony Arcieri 886a9d4f2b ecdsa v0.8.0 (#166) 2020-09-11 13:54:27 -07:00