Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ecdsa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
rust:
- 1.61.0 # MSRV
- 1.65.0 # MSRV
- stable
steps:
- uses: actions/checkout@v3
Expand All @@ -44,7 +44,7 @@ jobs:
strategy:
matrix:
rust:
- 1.61.0 # MSRV
- 1.65.0 # MSRV
- stable
steps:
- uses: actions/checkout@v3
Expand Down
132 changes: 101 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ecdsa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ readme = "README.md"
categories = ["cryptography", "no-std"]
keywords = ["crypto", "ecc", "nist", "secp256k1", "signature"]
edition = "2021"
rust-version = "1.61"
rust-version = "1.65"

[dependencies]
elliptic-curve = { version = "=0.13.0-pre.5", default-features = false, features = ["digest", "sec1"] }
elliptic-curve = { version = "=0.13.0-rc.0", default-features = false, features = ["digest", "sec1"] }
signature = { version = "2.0, <2.1", default-features = false, features = ["rand_core"] }

# optional dependencies
der = { version = "0.6", optional = true }
der = { version = "0.7", optional = true }
rfc6979 = { version = "=0.4.0-pre.0", optional = true, path = "../rfc6979" }
serdect = { version = "0.1", optional = true, default-features = false, features = ["alloc"] }

[dev-dependencies]
elliptic-curve = { version = "=0.13.0-pre.5", default-features = false, features = ["dev"] }
elliptic-curve = { version = "=0.13.0-rc.0", default-features = false, features = ["dev"] }
hex-literal = "0.3"
sha2 = { version = "0.10", default-features = false }

Expand Down
4 changes: 2 additions & 2 deletions ecdsa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ USE AT YOUR OWN RISK!

## Minimum Supported Rust Version

This crate requires **Rust 1.61** at a minimum.
This crate requires **Rust 1.65** at a minimum.

We may change the MSRV in the future, but it will be accompanied by a minor
version bump.
Expand Down Expand Up @@ -70,7 +70,7 @@ dual licensed as above, without any additional terms or conditions.
[build-image]: https://github.com/RustCrypto/signatures/actions/workflows/ecdsa.yml/badge.svg
[build-link]: https://github.com/RustCrypto/signatures/actions/workflows/ecdsa.yml
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.61+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.65+-blue.svg
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures

Expand Down
12 changes: 6 additions & 6 deletions ecdsa/src/der.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::{
fmt::{self, Debug},
ops::{Add, Range},
};
use der::{asn1::UIntRef, Decode, Encode, Reader};
use der::{asn1::UintRef, Decode, Encode, Reader};
use elliptic_curve::{
bigint::Integer,
consts::U9,
Expand Down Expand Up @@ -88,8 +88,8 @@ where

/// Create an ASN.1 DER encoded signature from big endian `r` and `s` scalars
pub(crate) fn from_scalar_bytes(r: &[u8], s: &[u8]) -> der::Result<Self> {
let r = UIntRef::new(r)?;
let s = UIntRef::new(s)?;
let r = UintRef::new(r)?;
let s = UintRef::new(s)?;

let mut bytes = SignatureBytes::<C>::default();
let mut writer = der::SliceWriter::new(&mut bytes);
Expand Down Expand Up @@ -280,14 +280,14 @@ where
}

/// Decode the `r` and `s` components of a DER-encoded ECDSA signature.
fn decode_der(der_bytes: &[u8]) -> der::Result<(UIntRef<'_>, UIntRef<'_>)> {
fn decode_der(der_bytes: &[u8]) -> der::Result<(UintRef<'_>, UintRef<'_>)> {
let mut reader = der::SliceReader::new(der_bytes)?;
let header = der::Header::decode(&mut reader)?;
header.tag.assert_eq(der::Tag::Sequence)?;

let ret = reader.read_nested(header.length, |reader| {
let r = UIntRef::decode(reader)?;
let s = UIntRef::decode(reader)?;
let r = UintRef::decode(reader)?;
let s = UintRef::decode(reader)?;
Ok((r, s))
})?;

Expand Down
15 changes: 2 additions & 13 deletions ecdsa/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ use {crate::der, core::ops::Add};

#[cfg(feature = "pem")]
use {
crate::elliptic_curve::pkcs8::{EncodePrivateKey, SecretDocument},
crate::elliptic_curve::pkcs8::{DecodePrivateKey, EncodePrivateKey, SecretDocument},
core::str::FromStr,
};

#[cfg(feature = "pkcs8")]
use crate::elliptic_curve::{
pkcs8::{self, AssociatedOid, DecodePrivateKey},
pkcs8::{self, AssociatedOid},
sec1::{self, FromEncodedPoint, ToEncodedPoint},
AffinePoint,
};
Expand Down Expand Up @@ -527,14 +527,3 @@ where
Self::from_pkcs8_pem(s).map_err(|_| Error::new())
}
}

#[cfg(feature = "pkcs8")]
impl<C> DecodePrivateKey for SigningKey<C>
where
C: PrimeCurve + AssociatedOid + CurveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: sec1::ModulusSize,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
{
}
Loading