From 50aee81e3abe57086fb471d5ffce8d34108cd622 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 16 Mar 2020 09:43:43 -0700 Subject: [PATCH] Update signature requirement to v1.0.0-pre.5 Changelog here: https://github.com/RustCrypto/traits/pull/90 --- build_nostd.sh | 2 +- ecdsa/Cargo.toml | 2 +- ecdsa/src/asn1_signature.rs | 4 ++-- ecdsa/src/convert.rs | 2 +- ecdsa/src/fixed_signature.rs | 4 ++-- ed25519/Cargo.toml | 2 +- ed25519/src/lib.rs | 4 ++-- signature-crate/README.md | 5 ----- 8 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 signature-crate/README.md diff --git a/build_nostd.sh b/build_nostd.sh index d0abb27..4483949 100755 --- a/build_nostd.sh +++ b/build_nostd.sh @@ -9,7 +9,7 @@ DIRS=`ls -d */` TARGET="thumbv7em-none-eabi" for dir in $DIRS; do - if [ $dir = "target/" -o $dir = "signature-crate/" ] + if [ $dir = "target/" ] then continue fi diff --git a/ecdsa/Cargo.toml b/ecdsa/Cargo.toml index 2ecd5ed..b1bb146 100644 --- a/ecdsa/Cargo.toml +++ b/ecdsa/Cargo.toml @@ -44,7 +44,7 @@ optional = true default-features = false [dependencies.signature] -version = "= 1.0.0-pre.3" +version = "= 1.0.0-pre.5" default-features = false [features] diff --git a/ecdsa/src/asn1_signature.rs b/ecdsa/src/asn1_signature.rs index ef9ca5d..2fe6556 100644 --- a/ecdsa/src/asn1_signature.rs +++ b/ecdsa/src/asn1_signature.rs @@ -46,8 +46,8 @@ where MaxSize: ArrayLength, ::Output: ArrayLength + Add, { - fn from_bytes(bytes: impl AsRef<[u8]>) -> Result { - bytes.as_ref().try_into() + fn from_bytes(bytes: &[u8]) -> Result { + bytes.try_into() } } diff --git a/ecdsa/src/convert.rs b/ecdsa/src/convert.rs index 3f8b8df..d0185c7 100644 --- a/ecdsa/src/convert.rs +++ b/ecdsa/src/convert.rs @@ -59,7 +59,7 @@ where // support only integers of less than 127 bytes each (signed // encoding) so the resulting raw signature will have length // at most 254 bytes. - let mut bytes = signature.as_slice(); + let mut bytes = signature.as_bytes(); // First byte is SEQUENCE tag. if bytes[0] != Asn1Tag::Sequence as u8 { diff --git a/ecdsa/src/fixed_signature.rs b/ecdsa/src/fixed_signature.rs index 277339d..20462cc 100644 --- a/ecdsa/src/fixed_signature.rs +++ b/ecdsa/src/fixed_signature.rs @@ -28,8 +28,8 @@ impl signature::Signature for FixedSignature where Size: ArrayLength, { - fn from_bytes(bytes: impl AsRef<[u8]>) -> Result { - bytes.as_ref().try_into() + fn from_bytes(bytes: &[u8]) -> Result { + bytes.try_into() } } diff --git a/ed25519/Cargo.toml b/ed25519/Cargo.toml index 8650f26..fb85b8c 100644 --- a/ed25519/Cargo.toml +++ b/ed25519/Cargo.toml @@ -12,7 +12,7 @@ categories = ["cryptography", "no-std"] keywords = ["crypto", "curve25519", "ecc", "signature", "signing"] [dependencies.signature] -version = "= 1.0.0-pre.3" +version = "= 1.0.0-pre.5" default-features = false [dependencies.serde] diff --git a/ed25519/src/lib.rs b/ed25519/src/lib.rs index d4fc552..d52d99e 100644 --- a/ed25519/src/lib.rs +++ b/ed25519/src/lib.rs @@ -52,8 +52,8 @@ impl Signature { } impl signature::Signature for Signature { - fn from_bytes(bytes: impl AsRef<[u8]>) -> Result { - bytes.as_ref().try_into() + fn from_bytes(bytes: &[u8]) -> Result { + bytes.try_into() } } diff --git a/signature-crate/README.md b/signature-crate/README.md deleted file mode 100644 index 3adbd3c..0000000 --- a/signature-crate/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# MOVED - -The `signature` crate has moved to: - -https://github.com/RustCrypto/traits/tree/master/signature