From 69f33530dff009d7cbfd968817003e5b338c1626 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 18 Jul 2023 11:15:59 -0500 Subject: [PATCH 01/37] added p256 dep --- Cargo.lock | 184 ++++++++++- Cargo.toml | 1 + crates/aptos-crypto/Cargo.toml | 1 + crates/aptos-crypto/src/p256/ed25519_keys.rs | 308 +++++++++++++++++++ crates/aptos-crypto/src/p256/ed25519_sigs.rs | 188 +++++++++++ crates/aptos-crypto/src/p256/mod.rs | 55 ++++ types/src/transaction/authenticator.rs | 5 + 7 files changed, 739 insertions(+), 3 deletions(-) create mode 100644 crates/aptos-crypto/src/p256/ed25519_keys.rs create mode 100644 crates/aptos-crypto/src/p256/ed25519_sigs.rs create mode 100644 crates/aptos-crypto/src/p256/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 9a1819cc81f5a..bdeb5203cf757 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -791,6 +791,7 @@ dependencies = [ "libsecp256k1", "more-asserts", "once_cell", + "p256", "proptest", "proptest-derive", "rand 0.7.3", @@ -4254,6 +4255,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base64" version = "0.12.3" @@ -4266,6 +4273,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "basic-cookies" version = "0.1.4" @@ -5018,6 +5031,12 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "const_fn" version = "0.4.9" @@ -5286,6 +5305,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.6", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -5316,6 +5347,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + [[package]] name = "csv" version = "1.2.1" @@ -5498,6 +5539,15 @@ dependencies = [ "serde 1.0.149", ] +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + [[package]] name = "derivation-path" version = "0.2.0" @@ -5776,6 +5826,18 @@ dependencies = [ "tempfile", ] +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature 1.4.0", +] + [[package]] name = "ed25519" version = "1.5.2" @@ -5783,7 +5845,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" dependencies = [ "serde 1.0.149", - "signature", + "signature 2.1.0", ] [[package]] @@ -5819,6 +5881,24 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array 0.14.6", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "ena" version = "0.14.0" @@ -6120,6 +6200,16 @@ dependencies = [ "instant", ] +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "field_count" version = "0.1.1" @@ -6583,6 +6673,17 @@ dependencies = [ "tempfile", ] +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "h2" version = "0.3.14" @@ -6786,6 +6887,16 @@ dependencies = [ "digest 0.9.0", ] +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + [[package]] name = "hmac" version = "0.12.1" @@ -9489,6 +9600,18 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "p256" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19736d80675fbe9fe33426268150b951a3fb8f5cfca2a23a17c85ef3adb24e3b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sec1", + "sha2 0.9.9", +] + [[package]] name = "parity-scale-codec" version = "2.3.1" @@ -9811,6 +9934,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "pkg-config" version = "0.3.25" @@ -10772,6 +10906,17 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + [[package]] name = "rfc7239" version = "0.1.0" @@ -11087,6 +11232,19 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array 0.14.6", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "security-framework" version = "2.7.0" @@ -11503,9 +11661,19 @@ dependencies = [ [[package]] name = "signature" -version = "1.6.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ea32af43239f0d353a7dd75a22d94c329c8cdaafdcb4c1c1335aa10c298a4a" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" [[package]] name = "similar" @@ -11717,6 +11885,16 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" diff --git a/Cargo.toml b/Cargo.toml index 39ec40a446bda..d62f692755fa0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -510,6 +510,7 @@ num-traits = "0.2.15" once_cell = "1.10.0" ouroboros = "0.15.6" owo-colors = "3.5.0" +p256 = "0.10.1" parking_lot = "0.12.0" paste = "1.0.7" percent-encoding = "2.1.0" diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index 3d1d76356181b..3b2ae177f5f8b 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -43,6 +43,7 @@ static_assertions = { workspace = true } thiserror = { workspace = true } tiny-keccak = { workspace = true } x25519-dalek = { workspace = true } +p256 = { workspace = true } [dev-dependencies] ark-bls12-381 = { workspace = true } diff --git a/crates/aptos-crypto/src/p256/ed25519_keys.rs b/crates/aptos-crypto/src/p256/ed25519_keys.rs new file mode 100644 index 0000000000000..fa1b2d40036a4 --- /dev/null +++ b/crates/aptos-crypto/src/p256/ed25519_keys.rs @@ -0,0 +1,308 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +//! This file implements traits for Ed25519 private keys and public keys. + +#[cfg(any(test, feature = "fuzzing"))] +use crate::test_utils::{self, KeyPair}; +use crate::{ + ed25519::{Ed25519Signature, ED25519_PRIVATE_KEY_LENGTH, ED25519_PUBLIC_KEY_LENGTH}, + hash::CryptoHash, + traits::*, +}; +use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; +use core::convert::TryFrom; +#[cfg(any(test, feature = "fuzzing"))] +use proptest::prelude::*; +use serde::Serialize; +use std::fmt; + +/// An P256 private key +#[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] +pub struct P256PrivateKey(pub(crate) p256::SecretKey); + +#[cfg(feature = "assert-private-keys-not-cloneable")] +static_assertions::assert_not_impl_any!(Ed25519PrivateKey: Clone); + +#[cfg(any(test, feature = "cloneable-private-keys"))] +impl Clone for P256PrivateKey { + fn clone(&self) -> Self { + let serialized: &[u8] = &(self.to_bytes()); + Ed25519PrivateKey::try_from(serialized).unwrap() + } +} + +/// An Ed25519 public key +#[derive(DeserializeKey, Clone, SerializeKey)] +pub struct Ed25519PublicKey(pub(crate) ed25519_dalek::PublicKey); + +impl Ed25519PrivateKey { + /// The length of the Ed25519PrivateKey + pub const LENGTH: usize = ed25519_dalek::SECRET_KEY_LENGTH; + + /// Serialize an Ed25519PrivateKey. + pub fn to_bytes(&self) -> [u8; ED25519_PRIVATE_KEY_LENGTH] { + self.0.to_bytes() + } + + /// Deserialize an Ed25519PrivateKey without any validation checks apart from expected key size. + fn from_bytes_unchecked( + bytes: &[u8], + ) -> std::result::Result { + match ed25519_dalek::SecretKey::from_bytes(bytes) { + Ok(dalek_secret_key) => Ok(Ed25519PrivateKey(dalek_secret_key)), + Err(_) => Err(CryptoMaterialError::DeserializationError), + } + } + + /// Private function aimed at minimizing code duplication between sign + /// methods of the SigningKey implementation. This should remain private. + fn sign_arbitrary_message(&self, message: &[u8]) -> Ed25519Signature { + let secret_key: &ed25519_dalek::SecretKey = &self.0; + let public_key: Ed25519PublicKey = self.into(); + let expanded_secret_key: ed25519_dalek::ExpandedSecretKey = + ed25519_dalek::ExpandedSecretKey::from(secret_key); + let sig = expanded_secret_key.sign(message.as_ref(), &public_key.0); + Ed25519Signature(sig) + } +} + +impl Ed25519PublicKey { + /// Serialize an Ed25519PublicKey. + pub fn to_bytes(&self) -> [u8; ED25519_PUBLIC_KEY_LENGTH] { + self.0.to_bytes() + } + + /// Deserialize an Ed25519PublicKey without any validation checks apart from expected key size + /// and valid curve point, although not necessarily in the prime-order subgroup. + /// + /// This function does NOT check the public key for membership in a small subgroup. + pub(crate) fn from_bytes_unchecked( + bytes: &[u8], + ) -> std::result::Result { + match ed25519_dalek::PublicKey::from_bytes(bytes) { + Ok(dalek_public_key) => Ok(Ed25519PublicKey(dalek_public_key)), + Err(_) => Err(CryptoMaterialError::DeserializationError), + } + } + + /// Deserialize an Ed25519PublicKey from its representation as an x25519 + /// public key, along with an indication of sign. This is meant to + /// compensate for the poor key storage capabilities of key management + /// solutions, and NOT to promote double usage of keys under several + /// schemes, which would lead to BAD vulnerabilities. + /// + /// This function does NOT check if the public key lies in a small subgroup. + /// + /// Arguments: + /// - `x25519_bytes`: bit representation of a public key in clamped + /// Montgomery form, a.k.a. the x25519 public key format. + /// - `negative`: whether to interpret the given point as a negative point, + /// as the Montgomery form erases the sign byte. By XEdDSA + /// convention, if you expect to ever convert this back to an + /// x25519 public key, you should pass `false` for this + /// argument. + #[cfg(test)] + pub(crate) fn from_x25519_public_bytes( + x25519_bytes: &[u8], + negative: bool, + ) -> Result { + if x25519_bytes.len() != 32 { + return Err(CryptoMaterialError::DeserializationError); + } + let key_bits = { + let mut bits = [0u8; 32]; + bits.copy_from_slice(x25519_bytes); + bits + }; + let mtg_point = curve25519_dalek::montgomery::MontgomeryPoint(key_bits); + let sign = u8::from(negative); + let ed_point = mtg_point + .to_edwards(sign) + .ok_or(CryptoMaterialError::DeserializationError)?; + Ed25519PublicKey::try_from(&ed_point.compress().as_bytes()[..]) + } +} + +/////////////////////// +// PrivateKey Traits // +/////////////////////// + +impl PrivateKey for Ed25519PrivateKey { + type PublicKeyMaterial = Ed25519PublicKey; +} + +impl SigningKey for Ed25519PrivateKey { + type SignatureMaterial = Ed25519Signature; + type VerifyingKeyMaterial = Ed25519PublicKey; + + fn sign( + &self, + message: &T, + ) -> Result { + Ok(Ed25519PrivateKey::sign_arbitrary_message( + self, + signing_message(message)?.as_ref(), + )) + } + + #[cfg(any(test, feature = "fuzzing"))] + fn sign_arbitrary_message(&self, message: &[u8]) -> Ed25519Signature { + Ed25519PrivateKey::sign_arbitrary_message(self, message) + } +} + +impl Uniform for Ed25519PrivateKey { + fn generate(rng: &mut R) -> Self + where + R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, + { + Ed25519PrivateKey(ed25519_dalek::SecretKey::generate(rng)) + } +} + +impl PartialEq for Ed25519PrivateKey { + fn eq(&self, other: &Self) -> bool { + self.to_bytes() == other.to_bytes() + } +} + +impl Eq for Ed25519PrivateKey {} + +// We could have a distinct kind of validation for the PrivateKey: e.g., checking the derived +// PublicKey is valid? +impl TryFrom<&[u8]> for Ed25519PrivateKey { + type Error = CryptoMaterialError; + + /// Deserialize an Ed25519PrivateKey. This method will check for private key validity: i.e., + /// correct key length. + fn try_from(bytes: &[u8]) -> std::result::Result { + // Note that the only requirement is that the size of the key is 32 bytes, something that + // is already checked during deserialization of ed25519_dalek::SecretKey + // + // Also, the underlying ed25519_dalek implementation ensures that the derived public key + // is safe and it will not lie in a small-order group, thus no extra check for PublicKey + // validation is required. + Ed25519PrivateKey::from_bytes_unchecked(bytes) + } +} + +impl Length for Ed25519PrivateKey { + fn length(&self) -> usize { + Self::LENGTH + } +} + +impl ValidCryptoMaterial for Ed25519PrivateKey { + fn to_bytes(&self) -> Vec { + self.to_bytes().to_vec() + } +} + +impl Genesis for Ed25519PrivateKey { + fn genesis() -> Self { + let mut buf = [0u8; ED25519_PRIVATE_KEY_LENGTH]; + buf[ED25519_PRIVATE_KEY_LENGTH - 1] = 1; + Self::try_from(buf.as_ref()).unwrap() + } +} + +////////////////////// +// PublicKey Traits // +////////////////////// + +// Implementing From<&PrivateKey<...>> allows to derive a public key in a more elegant fashion +impl From<&Ed25519PrivateKey> for Ed25519PublicKey { + fn from(private_key: &Ed25519PrivateKey) -> Self { + let secret: &ed25519_dalek::SecretKey = &private_key.0; + let public: ed25519_dalek::PublicKey = secret.into(); + Ed25519PublicKey(public) + } +} + +// We deduce PublicKey from this +impl PublicKey for Ed25519PublicKey { + type PrivateKeyMaterial = Ed25519PrivateKey; +} + +impl std::hash::Hash for Ed25519PublicKey { + fn hash(&self, state: &mut H) { + let encoded_pubkey = self.to_bytes(); + state.write(&encoded_pubkey); + } +} + +// Those are required by the implementation of hash above +impl PartialEq for Ed25519PublicKey { + fn eq(&self, other: &Ed25519PublicKey) -> bool { + self.to_bytes() == other.to_bytes() + } +} + +impl Eq for Ed25519PublicKey {} + +// We deduce VerifyingKey from pointing to the signature material +// we get the ability to do `pubkey.validate(msg, signature)` +impl VerifyingKey for Ed25519PublicKey { + type SignatureMaterial = Ed25519Signature; + type SigningKeyMaterial = Ed25519PrivateKey; +} + +impl fmt::Display for Ed25519PublicKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", hex::encode(self.0.as_bytes())) + } +} + +impl fmt::Debug for Ed25519PublicKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "Ed25519PublicKey({})", self) + } +} + +impl TryFrom<&[u8]> for Ed25519PublicKey { + type Error = CryptoMaterialError; + + /// Deserialize an Ed25519PublicKey. This method will NOT check for key validity, which means + /// the returned public key could be in a small subgroup. Nonetheless, our signature + /// verification implicitly checks if the public key lies in a small subgroup, so canonical + /// uses of this library will not be susceptible to small subgroup attacks. + fn try_from(bytes: &[u8]) -> std::result::Result { + Ed25519PublicKey::from_bytes_unchecked(bytes) + } +} + +impl Length for Ed25519PublicKey { + fn length(&self) -> usize { + ED25519_PUBLIC_KEY_LENGTH + } +} + +impl ValidCryptoMaterial for Ed25519PublicKey { + fn to_bytes(&self) -> Vec { + self.0.to_bytes().to_vec() + } +} + +///////////// +// Fuzzing // +///////////// + +/// Produces a uniformly random Ed25519 keypair from a seed +#[cfg(any(test, feature = "fuzzing"))] +pub fn keypair_strategy() -> impl Strategy> { + test_utils::uniform_keypair_strategy::() +} + +/// Produces a uniformly random Ed25519 public key +#[cfg(any(test, feature = "fuzzing"))] +impl proptest::arbitrary::Arbitrary for Ed25519PublicKey { + type Parameters = (); + type Strategy = BoxedStrategy; + + fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { + crate::test_utils::uniform_keypair_strategy::() + .prop_map(|v| v.public_key) + .boxed() + } +} diff --git a/crates/aptos-crypto/src/p256/ed25519_sigs.rs b/crates/aptos-crypto/src/p256/ed25519_sigs.rs new file mode 100644 index 0000000000000..8330102896480 --- /dev/null +++ b/crates/aptos-crypto/src/p256/ed25519_sigs.rs @@ -0,0 +1,188 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +//! This file implements traits for Ed25519 signatures. + +use crate::{ + ed25519::{Ed25519PrivateKey, Ed25519PublicKey, ED25519_SIGNATURE_LENGTH, L}, + hash::CryptoHash, + traits::*, +}; +use anyhow::{anyhow, Result}; +use aptos_crypto_derive::{DeserializeKey, SerializeKey}; +use core::convert::TryFrom; +use serde::Serialize; +use std::{cmp::Ordering, fmt}; + +/// An Ed25519 signature +#[derive(DeserializeKey, Clone, SerializeKey)] +pub struct Ed25519Signature(pub(crate) ed25519_dalek::Signature); + +impl Ed25519Signature { + /// The length of the Ed25519Signature + pub const LENGTH: usize = ed25519_dalek::SIGNATURE_LENGTH; + + /// Serialize an Ed25519Signature. + pub fn to_bytes(&self) -> [u8; ED25519_SIGNATURE_LENGTH] { + self.0.to_bytes() + } + + /// Deserialize an Ed25519Signature without any validation checks (malleability) + /// apart from expected signature size. + pub(crate) fn from_bytes_unchecked( + bytes: &[u8], + ) -> std::result::Result { + match ed25519_dalek::Signature::try_from(bytes) { + Ok(dalek_signature) => Ok(Ed25519Signature(dalek_signature)), + Err(_) => Err(CryptoMaterialError::DeserializationError), + } + } + + /// return an all-zero signature (for test only) + #[cfg(any(test, feature = "fuzzing"))] + pub fn dummy_signature() -> Self { + Self::from_bytes_unchecked(&[0u8; Self::LENGTH]).unwrap() + } + + /// Check for correct size and third-party based signature malleability issues. + /// This method is required to ensure that given a valid signature for some message under some + /// key, an attacker cannot produce another valid signature for the same message and key. + /// + /// According to [RFC8032](https://tools.ietf.org/html/rfc8032), signatures comprise elements + /// {R, S} and we should enforce that S is of canonical form (smaller than L, where L is the + /// order of edwards25519 curve group) to prevent signature malleability. Without this check, + /// one could add a multiple of L into S and still pass signature verification, resulting in + /// a distinct yet valid signature. + /// + /// This method does not check the R component of the signature, because R is hashed during + /// signing and verification to compute h = H(ENC(R) || ENC(A) || M), which means that a + /// third-party cannot modify R without being detected. + /// + /// Note: It's true that malicious signers can already produce varying signatures by + /// choosing a different nonce, so this method protects against malleability attacks performed + /// by a non-signer. + pub fn check_s_malleability(bytes: &[u8]) -> std::result::Result<(), CryptoMaterialError> { + if bytes.len() != ED25519_SIGNATURE_LENGTH { + return Err(CryptoMaterialError::WrongLengthError); + } + if !Ed25519Signature::check_s_lt_l(&bytes[32..]) { + return Err(CryptoMaterialError::CanonicalRepresentationError); + } + Ok(()) + } + + /// Check if S < L to capture invalid signatures. + fn check_s_lt_l(s: &[u8]) -> bool { + for i in (0..32).rev() { + match s[i].cmp(&L[i]) { + Ordering::Less => return true, + Ordering::Greater => return false, + _ => {}, + } + } + // As this stage S == L which implies a non canonical S. + false + } +} + +////////////////////// +// Signature Traits // +////////////////////// + +impl Signature for Ed25519Signature { + type SigningKeyMaterial = Ed25519PrivateKey; + type VerifyingKeyMaterial = Ed25519PublicKey; + + /// Verifies that the provided signature is valid for the provided message, going beyond the + /// [RFC8032](https://tools.ietf.org/html/rfc8032) specification, checking both scalar + /// malleability and point malleability (see documentation [here](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.PublicKey.html#on-the-multiple-sources-of-malleability-in-ed25519-signatures)). + /// + /// This _strict_ verification performs steps 1,2 and 3 from Section 5.1.7 in RFC8032, and an + /// additional scalar malleability check (via [Ed25519Signature::check_s_malleability][Ed25519Signature::check_s_malleability]). + /// + /// This function will ensure both the signature and the `public_key` are not in a small subgroup. + fn verify( + &self, + message: &T, + public_key: &Ed25519PublicKey, + ) -> Result<()> { + Self::verify_arbitrary_msg(self, &signing_message(message)?, public_key) + } + + /// Checks that `self` is valid for an arbitrary &[u8] `message` using `public_key`. + /// Outside of this crate, this particular function should only be used for native signature + /// verification in Move. + /// + /// This function will check both the signature and `public_key` for small subgroup attacks. + fn verify_arbitrary_msg(&self, message: &[u8], public_key: &Ed25519PublicKey) -> Result<()> { + // NOTE: ed25519::PublicKey::verify_strict already checks that the s-component of the signature + // is not mauled, but does so via an optimistic path which fails into a slower path. By doing + // our own (much faster) checking here, we can ensure dalek's optimistic path always succeeds + // and the slow path is never triggered. + Ed25519Signature::check_s_malleability(&self.to_bytes())?; + + // NOTE: ed25519::PublicKey::verify_strict checks that the signature's R-component and + // the public key are *not* in a small subgroup. + public_key + .0 + .verify_strict(message, &self.0) + .map_err(|e| anyhow!("{}", e)) + .and(Ok(())) + } + + fn to_bytes(&self) -> Vec { + self.0.to_bytes().to_vec() + } +} + +impl Length for Ed25519Signature { + fn length(&self) -> usize { + ED25519_SIGNATURE_LENGTH + } +} + +impl ValidCryptoMaterial for Ed25519Signature { + fn to_bytes(&self) -> Vec { + self.to_bytes().to_vec() + } +} + +impl std::hash::Hash for Ed25519Signature { + fn hash(&self, state: &mut H) { + let encoded_signature = self.to_bytes(); + state.write(&encoded_signature); + } +} + +impl TryFrom<&[u8]> for Ed25519Signature { + type Error = CryptoMaterialError; + + fn try_from(bytes: &[u8]) -> std::result::Result { + // We leave this check here to detect mauled signatures earlier, since it does not hurt + // performance much. (This check is performed again in Ed25519Signature::verify_arbitrary_msg + // and in ed25519-dalek's verify_strict API.) + Ed25519Signature::check_s_malleability(bytes)?; + Ed25519Signature::from_bytes_unchecked(bytes) + } +} + +// Those are required by the implementation of hash above +impl PartialEq for Ed25519Signature { + fn eq(&self, other: &Ed25519Signature) -> bool { + self.to_bytes()[..] == other.to_bytes()[..] + } +} + +impl Eq for Ed25519Signature {} + +impl fmt::Display for Ed25519Signature { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", hex::encode(&self.0.to_bytes()[..])) + } +} + +impl fmt::Debug for Ed25519Signature { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "Ed25519Signature({})", self) + } +} diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs new file mode 100644 index 0000000000000..0be25c25a8cc7 --- /dev/null +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -0,0 +1,55 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +//! This module provides an API for the PureEdDSA signature scheme over the Ed25519 twisted +//! Edwards curve as defined in [RFC8032](https://tools.ietf.org/html/rfc8032). +//! +//! Signature verification also checks and rejects non-canonical signatures. +//! +//! # Examples +//! +//! ``` +//! use aptos_crypto_derive::{CryptoHasher, BCSCryptoHash}; +//! use aptos_crypto::{ +//! ed25519::*, +//! traits::{Signature, SigningKey, Uniform}, +//! test_utils::KeyPair +//! }; +//! use rand::{rngs::StdRng, SeedableRng}; +//! use rand_core::OsRng; +//! use serde::{Serialize, Deserialize}; +//! +//! #[derive(Serialize, Deserialize, CryptoHasher, BCSCryptoHash)] +//! pub struct TestCryptoDocTest(String); +//! let message = TestCryptoDocTest("Test message".to_string()); +//! +//! let mut rng = OsRng; +//! let kp = KeyPair::::generate(&mut rng); +//! +//! let signature = kp.private_key.sign(&message).unwrap(); +//! assert!(signature.verify(&message, &kp.public_key).is_ok()); +//! ``` + +/// The length of the Ed25519PrivateKey +pub const ED25519_PRIVATE_KEY_LENGTH: usize = ed25519_dalek::SECRET_KEY_LENGTH; +/// The length of the Ed25519PublicKey +pub const ED25519_PUBLIC_KEY_LENGTH: usize = ed25519_dalek::PUBLIC_KEY_LENGTH; +/// The length of the Ed25519Signature +pub const ED25519_SIGNATURE_LENGTH: usize = ed25519_dalek::SIGNATURE_LENGTH; + +/// The order of ed25519 as defined in [RFC8032](https://tools.ietf.org/html/rfc8032). +const L: [u8; 32] = [ + 0xED, 0xD3, 0xF5, 0x5C, 0x1A, 0x63, 0x12, 0x58, 0xD6, 0x9C, 0xF7, 0xA2, 0xDE, 0xF9, 0xDE, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, +]; + +pub mod ed25519_keys; +pub mod ed25519_sigs; + +#[cfg(any(test, feature = "fuzzing"))] +pub use ed25519_keys::keypair_strategy; +pub use ed25519_keys::{ + Ed25519PrivateKey, Ed25519PrivateKey as PrivateKey, Ed25519PublicKey, + Ed25519PublicKey as PublicKey, +}; +pub use ed25519_sigs::{Ed25519Signature, Ed25519Signature as Signature}; diff --git a/types/src/transaction/authenticator.rs b/types/src/transaction/authenticator.rs index 400ca8a90360e..46ee11073b4a1 100644 --- a/types/src/transaction/authenticator.rs +++ b/types/src/transaction/authenticator.rs @@ -46,6 +46,11 @@ pub enum TransactionAuthenticator { public_key: Ed25519PublicKey, signature: Ed25519Signature, }, + /// Single signature + P256 { + public_key: P256PublicKey, + signature: P256PublicKey, + }, /// K-of-N multisignature MultiEd25519 { public_key: MultiEd25519PublicKey, From e3ad02137aa659d16a9a6eb9772164cb98503737 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 18 Jul 2023 15:17:50 -0500 Subject: [PATCH 02/37] cargo check passes --- Cargo.lock | 10 +- crates/aptos-crypto/src/p256/ed25519_keys.rs | 308 ------------------- crates/aptos-crypto/src/p256/ed25519_sigs.rs | 188 ----------- crates/aptos-crypto/src/p256/mod.rs | 55 ---- types/src/transaction/authenticator.rs | 4 +- 5 files changed, 4 insertions(+), 561 deletions(-) delete mode 100644 crates/aptos-crypto/src/p256/ed25519_keys.rs delete mode 100644 crates/aptos-crypto/src/p256/ed25519_sigs.rs delete mode 100644 crates/aptos-crypto/src/p256/mod.rs diff --git a/Cargo.lock b/Cargo.lock index bdeb5203cf757..b6a5db2b859d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5835,7 +5835,7 @@ dependencies = [ "der", "elliptic-curve", "rfc6979", - "signature 1.4.0", + "signature", ] [[package]] @@ -5845,7 +5845,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" dependencies = [ "serde 1.0.149", - "signature 2.1.0", + "signature", ] [[package]] @@ -11669,12 +11669,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "signature" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" - [[package]] name = "similar" version = "2.2.0" diff --git a/crates/aptos-crypto/src/p256/ed25519_keys.rs b/crates/aptos-crypto/src/p256/ed25519_keys.rs deleted file mode 100644 index fa1b2d40036a4..0000000000000 --- a/crates/aptos-crypto/src/p256/ed25519_keys.rs +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright © Aptos Foundation -// SPDX-License-Identifier: Apache-2.0 - -//! This file implements traits for Ed25519 private keys and public keys. - -#[cfg(any(test, feature = "fuzzing"))] -use crate::test_utils::{self, KeyPair}; -use crate::{ - ed25519::{Ed25519Signature, ED25519_PRIVATE_KEY_LENGTH, ED25519_PUBLIC_KEY_LENGTH}, - hash::CryptoHash, - traits::*, -}; -use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; -use core::convert::TryFrom; -#[cfg(any(test, feature = "fuzzing"))] -use proptest::prelude::*; -use serde::Serialize; -use std::fmt; - -/// An P256 private key -#[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] -pub struct P256PrivateKey(pub(crate) p256::SecretKey); - -#[cfg(feature = "assert-private-keys-not-cloneable")] -static_assertions::assert_not_impl_any!(Ed25519PrivateKey: Clone); - -#[cfg(any(test, feature = "cloneable-private-keys"))] -impl Clone for P256PrivateKey { - fn clone(&self) -> Self { - let serialized: &[u8] = &(self.to_bytes()); - Ed25519PrivateKey::try_from(serialized).unwrap() - } -} - -/// An Ed25519 public key -#[derive(DeserializeKey, Clone, SerializeKey)] -pub struct Ed25519PublicKey(pub(crate) ed25519_dalek::PublicKey); - -impl Ed25519PrivateKey { - /// The length of the Ed25519PrivateKey - pub const LENGTH: usize = ed25519_dalek::SECRET_KEY_LENGTH; - - /// Serialize an Ed25519PrivateKey. - pub fn to_bytes(&self) -> [u8; ED25519_PRIVATE_KEY_LENGTH] { - self.0.to_bytes() - } - - /// Deserialize an Ed25519PrivateKey without any validation checks apart from expected key size. - fn from_bytes_unchecked( - bytes: &[u8], - ) -> std::result::Result { - match ed25519_dalek::SecretKey::from_bytes(bytes) { - Ok(dalek_secret_key) => Ok(Ed25519PrivateKey(dalek_secret_key)), - Err(_) => Err(CryptoMaterialError::DeserializationError), - } - } - - /// Private function aimed at minimizing code duplication between sign - /// methods of the SigningKey implementation. This should remain private. - fn sign_arbitrary_message(&self, message: &[u8]) -> Ed25519Signature { - let secret_key: &ed25519_dalek::SecretKey = &self.0; - let public_key: Ed25519PublicKey = self.into(); - let expanded_secret_key: ed25519_dalek::ExpandedSecretKey = - ed25519_dalek::ExpandedSecretKey::from(secret_key); - let sig = expanded_secret_key.sign(message.as_ref(), &public_key.0); - Ed25519Signature(sig) - } -} - -impl Ed25519PublicKey { - /// Serialize an Ed25519PublicKey. - pub fn to_bytes(&self) -> [u8; ED25519_PUBLIC_KEY_LENGTH] { - self.0.to_bytes() - } - - /// Deserialize an Ed25519PublicKey without any validation checks apart from expected key size - /// and valid curve point, although not necessarily in the prime-order subgroup. - /// - /// This function does NOT check the public key for membership in a small subgroup. - pub(crate) fn from_bytes_unchecked( - bytes: &[u8], - ) -> std::result::Result { - match ed25519_dalek::PublicKey::from_bytes(bytes) { - Ok(dalek_public_key) => Ok(Ed25519PublicKey(dalek_public_key)), - Err(_) => Err(CryptoMaterialError::DeserializationError), - } - } - - /// Deserialize an Ed25519PublicKey from its representation as an x25519 - /// public key, along with an indication of sign. This is meant to - /// compensate for the poor key storage capabilities of key management - /// solutions, and NOT to promote double usage of keys under several - /// schemes, which would lead to BAD vulnerabilities. - /// - /// This function does NOT check if the public key lies in a small subgroup. - /// - /// Arguments: - /// - `x25519_bytes`: bit representation of a public key in clamped - /// Montgomery form, a.k.a. the x25519 public key format. - /// - `negative`: whether to interpret the given point as a negative point, - /// as the Montgomery form erases the sign byte. By XEdDSA - /// convention, if you expect to ever convert this back to an - /// x25519 public key, you should pass `false` for this - /// argument. - #[cfg(test)] - pub(crate) fn from_x25519_public_bytes( - x25519_bytes: &[u8], - negative: bool, - ) -> Result { - if x25519_bytes.len() != 32 { - return Err(CryptoMaterialError::DeserializationError); - } - let key_bits = { - let mut bits = [0u8; 32]; - bits.copy_from_slice(x25519_bytes); - bits - }; - let mtg_point = curve25519_dalek::montgomery::MontgomeryPoint(key_bits); - let sign = u8::from(negative); - let ed_point = mtg_point - .to_edwards(sign) - .ok_or(CryptoMaterialError::DeserializationError)?; - Ed25519PublicKey::try_from(&ed_point.compress().as_bytes()[..]) - } -} - -/////////////////////// -// PrivateKey Traits // -/////////////////////// - -impl PrivateKey for Ed25519PrivateKey { - type PublicKeyMaterial = Ed25519PublicKey; -} - -impl SigningKey for Ed25519PrivateKey { - type SignatureMaterial = Ed25519Signature; - type VerifyingKeyMaterial = Ed25519PublicKey; - - fn sign( - &self, - message: &T, - ) -> Result { - Ok(Ed25519PrivateKey::sign_arbitrary_message( - self, - signing_message(message)?.as_ref(), - )) - } - - #[cfg(any(test, feature = "fuzzing"))] - fn sign_arbitrary_message(&self, message: &[u8]) -> Ed25519Signature { - Ed25519PrivateKey::sign_arbitrary_message(self, message) - } -} - -impl Uniform for Ed25519PrivateKey { - fn generate(rng: &mut R) -> Self - where - R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, - { - Ed25519PrivateKey(ed25519_dalek::SecretKey::generate(rng)) - } -} - -impl PartialEq for Ed25519PrivateKey { - fn eq(&self, other: &Self) -> bool { - self.to_bytes() == other.to_bytes() - } -} - -impl Eq for Ed25519PrivateKey {} - -// We could have a distinct kind of validation for the PrivateKey: e.g., checking the derived -// PublicKey is valid? -impl TryFrom<&[u8]> for Ed25519PrivateKey { - type Error = CryptoMaterialError; - - /// Deserialize an Ed25519PrivateKey. This method will check for private key validity: i.e., - /// correct key length. - fn try_from(bytes: &[u8]) -> std::result::Result { - // Note that the only requirement is that the size of the key is 32 bytes, something that - // is already checked during deserialization of ed25519_dalek::SecretKey - // - // Also, the underlying ed25519_dalek implementation ensures that the derived public key - // is safe and it will not lie in a small-order group, thus no extra check for PublicKey - // validation is required. - Ed25519PrivateKey::from_bytes_unchecked(bytes) - } -} - -impl Length for Ed25519PrivateKey { - fn length(&self) -> usize { - Self::LENGTH - } -} - -impl ValidCryptoMaterial for Ed25519PrivateKey { - fn to_bytes(&self) -> Vec { - self.to_bytes().to_vec() - } -} - -impl Genesis for Ed25519PrivateKey { - fn genesis() -> Self { - let mut buf = [0u8; ED25519_PRIVATE_KEY_LENGTH]; - buf[ED25519_PRIVATE_KEY_LENGTH - 1] = 1; - Self::try_from(buf.as_ref()).unwrap() - } -} - -////////////////////// -// PublicKey Traits // -////////////////////// - -// Implementing From<&PrivateKey<...>> allows to derive a public key in a more elegant fashion -impl From<&Ed25519PrivateKey> for Ed25519PublicKey { - fn from(private_key: &Ed25519PrivateKey) -> Self { - let secret: &ed25519_dalek::SecretKey = &private_key.0; - let public: ed25519_dalek::PublicKey = secret.into(); - Ed25519PublicKey(public) - } -} - -// We deduce PublicKey from this -impl PublicKey for Ed25519PublicKey { - type PrivateKeyMaterial = Ed25519PrivateKey; -} - -impl std::hash::Hash for Ed25519PublicKey { - fn hash(&self, state: &mut H) { - let encoded_pubkey = self.to_bytes(); - state.write(&encoded_pubkey); - } -} - -// Those are required by the implementation of hash above -impl PartialEq for Ed25519PublicKey { - fn eq(&self, other: &Ed25519PublicKey) -> bool { - self.to_bytes() == other.to_bytes() - } -} - -impl Eq for Ed25519PublicKey {} - -// We deduce VerifyingKey from pointing to the signature material -// we get the ability to do `pubkey.validate(msg, signature)` -impl VerifyingKey for Ed25519PublicKey { - type SignatureMaterial = Ed25519Signature; - type SigningKeyMaterial = Ed25519PrivateKey; -} - -impl fmt::Display for Ed25519PublicKey { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", hex::encode(self.0.as_bytes())) - } -} - -impl fmt::Debug for Ed25519PublicKey { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "Ed25519PublicKey({})", self) - } -} - -impl TryFrom<&[u8]> for Ed25519PublicKey { - type Error = CryptoMaterialError; - - /// Deserialize an Ed25519PublicKey. This method will NOT check for key validity, which means - /// the returned public key could be in a small subgroup. Nonetheless, our signature - /// verification implicitly checks if the public key lies in a small subgroup, so canonical - /// uses of this library will not be susceptible to small subgroup attacks. - fn try_from(bytes: &[u8]) -> std::result::Result { - Ed25519PublicKey::from_bytes_unchecked(bytes) - } -} - -impl Length for Ed25519PublicKey { - fn length(&self) -> usize { - ED25519_PUBLIC_KEY_LENGTH - } -} - -impl ValidCryptoMaterial for Ed25519PublicKey { - fn to_bytes(&self) -> Vec { - self.0.to_bytes().to_vec() - } -} - -///////////// -// Fuzzing // -///////////// - -/// Produces a uniformly random Ed25519 keypair from a seed -#[cfg(any(test, feature = "fuzzing"))] -pub fn keypair_strategy() -> impl Strategy> { - test_utils::uniform_keypair_strategy::() -} - -/// Produces a uniformly random Ed25519 public key -#[cfg(any(test, feature = "fuzzing"))] -impl proptest::arbitrary::Arbitrary for Ed25519PublicKey { - type Parameters = (); - type Strategy = BoxedStrategy; - - fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { - crate::test_utils::uniform_keypair_strategy::() - .prop_map(|v| v.public_key) - .boxed() - } -} diff --git a/crates/aptos-crypto/src/p256/ed25519_sigs.rs b/crates/aptos-crypto/src/p256/ed25519_sigs.rs deleted file mode 100644 index 8330102896480..0000000000000 --- a/crates/aptos-crypto/src/p256/ed25519_sigs.rs +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright © Aptos Foundation -// SPDX-License-Identifier: Apache-2.0 - -//! This file implements traits for Ed25519 signatures. - -use crate::{ - ed25519::{Ed25519PrivateKey, Ed25519PublicKey, ED25519_SIGNATURE_LENGTH, L}, - hash::CryptoHash, - traits::*, -}; -use anyhow::{anyhow, Result}; -use aptos_crypto_derive::{DeserializeKey, SerializeKey}; -use core::convert::TryFrom; -use serde::Serialize; -use std::{cmp::Ordering, fmt}; - -/// An Ed25519 signature -#[derive(DeserializeKey, Clone, SerializeKey)] -pub struct Ed25519Signature(pub(crate) ed25519_dalek::Signature); - -impl Ed25519Signature { - /// The length of the Ed25519Signature - pub const LENGTH: usize = ed25519_dalek::SIGNATURE_LENGTH; - - /// Serialize an Ed25519Signature. - pub fn to_bytes(&self) -> [u8; ED25519_SIGNATURE_LENGTH] { - self.0.to_bytes() - } - - /// Deserialize an Ed25519Signature without any validation checks (malleability) - /// apart from expected signature size. - pub(crate) fn from_bytes_unchecked( - bytes: &[u8], - ) -> std::result::Result { - match ed25519_dalek::Signature::try_from(bytes) { - Ok(dalek_signature) => Ok(Ed25519Signature(dalek_signature)), - Err(_) => Err(CryptoMaterialError::DeserializationError), - } - } - - /// return an all-zero signature (for test only) - #[cfg(any(test, feature = "fuzzing"))] - pub fn dummy_signature() -> Self { - Self::from_bytes_unchecked(&[0u8; Self::LENGTH]).unwrap() - } - - /// Check for correct size and third-party based signature malleability issues. - /// This method is required to ensure that given a valid signature for some message under some - /// key, an attacker cannot produce another valid signature for the same message and key. - /// - /// According to [RFC8032](https://tools.ietf.org/html/rfc8032), signatures comprise elements - /// {R, S} and we should enforce that S is of canonical form (smaller than L, where L is the - /// order of edwards25519 curve group) to prevent signature malleability. Without this check, - /// one could add a multiple of L into S and still pass signature verification, resulting in - /// a distinct yet valid signature. - /// - /// This method does not check the R component of the signature, because R is hashed during - /// signing and verification to compute h = H(ENC(R) || ENC(A) || M), which means that a - /// third-party cannot modify R without being detected. - /// - /// Note: It's true that malicious signers can already produce varying signatures by - /// choosing a different nonce, so this method protects against malleability attacks performed - /// by a non-signer. - pub fn check_s_malleability(bytes: &[u8]) -> std::result::Result<(), CryptoMaterialError> { - if bytes.len() != ED25519_SIGNATURE_LENGTH { - return Err(CryptoMaterialError::WrongLengthError); - } - if !Ed25519Signature::check_s_lt_l(&bytes[32..]) { - return Err(CryptoMaterialError::CanonicalRepresentationError); - } - Ok(()) - } - - /// Check if S < L to capture invalid signatures. - fn check_s_lt_l(s: &[u8]) -> bool { - for i in (0..32).rev() { - match s[i].cmp(&L[i]) { - Ordering::Less => return true, - Ordering::Greater => return false, - _ => {}, - } - } - // As this stage S == L which implies a non canonical S. - false - } -} - -////////////////////// -// Signature Traits // -////////////////////// - -impl Signature for Ed25519Signature { - type SigningKeyMaterial = Ed25519PrivateKey; - type VerifyingKeyMaterial = Ed25519PublicKey; - - /// Verifies that the provided signature is valid for the provided message, going beyond the - /// [RFC8032](https://tools.ietf.org/html/rfc8032) specification, checking both scalar - /// malleability and point malleability (see documentation [here](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.PublicKey.html#on-the-multiple-sources-of-malleability-in-ed25519-signatures)). - /// - /// This _strict_ verification performs steps 1,2 and 3 from Section 5.1.7 in RFC8032, and an - /// additional scalar malleability check (via [Ed25519Signature::check_s_malleability][Ed25519Signature::check_s_malleability]). - /// - /// This function will ensure both the signature and the `public_key` are not in a small subgroup. - fn verify( - &self, - message: &T, - public_key: &Ed25519PublicKey, - ) -> Result<()> { - Self::verify_arbitrary_msg(self, &signing_message(message)?, public_key) - } - - /// Checks that `self` is valid for an arbitrary &[u8] `message` using `public_key`. - /// Outside of this crate, this particular function should only be used for native signature - /// verification in Move. - /// - /// This function will check both the signature and `public_key` for small subgroup attacks. - fn verify_arbitrary_msg(&self, message: &[u8], public_key: &Ed25519PublicKey) -> Result<()> { - // NOTE: ed25519::PublicKey::verify_strict already checks that the s-component of the signature - // is not mauled, but does so via an optimistic path which fails into a slower path. By doing - // our own (much faster) checking here, we can ensure dalek's optimistic path always succeeds - // and the slow path is never triggered. - Ed25519Signature::check_s_malleability(&self.to_bytes())?; - - // NOTE: ed25519::PublicKey::verify_strict checks that the signature's R-component and - // the public key are *not* in a small subgroup. - public_key - .0 - .verify_strict(message, &self.0) - .map_err(|e| anyhow!("{}", e)) - .and(Ok(())) - } - - fn to_bytes(&self) -> Vec { - self.0.to_bytes().to_vec() - } -} - -impl Length for Ed25519Signature { - fn length(&self) -> usize { - ED25519_SIGNATURE_LENGTH - } -} - -impl ValidCryptoMaterial for Ed25519Signature { - fn to_bytes(&self) -> Vec { - self.to_bytes().to_vec() - } -} - -impl std::hash::Hash for Ed25519Signature { - fn hash(&self, state: &mut H) { - let encoded_signature = self.to_bytes(); - state.write(&encoded_signature); - } -} - -impl TryFrom<&[u8]> for Ed25519Signature { - type Error = CryptoMaterialError; - - fn try_from(bytes: &[u8]) -> std::result::Result { - // We leave this check here to detect mauled signatures earlier, since it does not hurt - // performance much. (This check is performed again in Ed25519Signature::verify_arbitrary_msg - // and in ed25519-dalek's verify_strict API.) - Ed25519Signature::check_s_malleability(bytes)?; - Ed25519Signature::from_bytes_unchecked(bytes) - } -} - -// Those are required by the implementation of hash above -impl PartialEq for Ed25519Signature { - fn eq(&self, other: &Ed25519Signature) -> bool { - self.to_bytes()[..] == other.to_bytes()[..] - } -} - -impl Eq for Ed25519Signature {} - -impl fmt::Display for Ed25519Signature { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", hex::encode(&self.0.to_bytes()[..])) - } -} - -impl fmt::Debug for Ed25519Signature { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "Ed25519Signature({})", self) - } -} diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs deleted file mode 100644 index 0be25c25a8cc7..0000000000000 --- a/crates/aptos-crypto/src/p256/mod.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright © Aptos Foundation -// SPDX-License-Identifier: Apache-2.0 - -//! This module provides an API for the PureEdDSA signature scheme over the Ed25519 twisted -//! Edwards curve as defined in [RFC8032](https://tools.ietf.org/html/rfc8032). -//! -//! Signature verification also checks and rejects non-canonical signatures. -//! -//! # Examples -//! -//! ``` -//! use aptos_crypto_derive::{CryptoHasher, BCSCryptoHash}; -//! use aptos_crypto::{ -//! ed25519::*, -//! traits::{Signature, SigningKey, Uniform}, -//! test_utils::KeyPair -//! }; -//! use rand::{rngs::StdRng, SeedableRng}; -//! use rand_core::OsRng; -//! use serde::{Serialize, Deserialize}; -//! -//! #[derive(Serialize, Deserialize, CryptoHasher, BCSCryptoHash)] -//! pub struct TestCryptoDocTest(String); -//! let message = TestCryptoDocTest("Test message".to_string()); -//! -//! let mut rng = OsRng; -//! let kp = KeyPair::::generate(&mut rng); -//! -//! let signature = kp.private_key.sign(&message).unwrap(); -//! assert!(signature.verify(&message, &kp.public_key).is_ok()); -//! ``` - -/// The length of the Ed25519PrivateKey -pub const ED25519_PRIVATE_KEY_LENGTH: usize = ed25519_dalek::SECRET_KEY_LENGTH; -/// The length of the Ed25519PublicKey -pub const ED25519_PUBLIC_KEY_LENGTH: usize = ed25519_dalek::PUBLIC_KEY_LENGTH; -/// The length of the Ed25519Signature -pub const ED25519_SIGNATURE_LENGTH: usize = ed25519_dalek::SIGNATURE_LENGTH; - -/// The order of ed25519 as defined in [RFC8032](https://tools.ietf.org/html/rfc8032). -const L: [u8; 32] = [ - 0xED, 0xD3, 0xF5, 0x5C, 0x1A, 0x63, 0x12, 0x58, 0xD6, 0x9C, 0xF7, 0xA2, 0xDE, 0xF9, 0xDE, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, -]; - -pub mod ed25519_keys; -pub mod ed25519_sigs; - -#[cfg(any(test, feature = "fuzzing"))] -pub use ed25519_keys::keypair_strategy; -pub use ed25519_keys::{ - Ed25519PrivateKey, Ed25519PrivateKey as PrivateKey, Ed25519PublicKey, - Ed25519PublicKey as PublicKey, -}; -pub use ed25519_sigs::{Ed25519Signature, Ed25519Signature as Signature}; diff --git a/types/src/transaction/authenticator.rs b/types/src/transaction/authenticator.rs index 46ee11073b4a1..5fd8ec6db5ac6 100644 --- a/types/src/transaction/authenticator.rs +++ b/types/src/transaction/authenticator.rs @@ -47,10 +47,10 @@ pub enum TransactionAuthenticator { signature: Ed25519Signature, }, /// Single signature - P256 { + /*P256 { public_key: P256PublicKey, signature: P256PublicKey, - }, + },*/ /// K-of-N multisignature MultiEd25519 { public_key: MultiEd25519PublicKey, From f85cecf74ca2d43de1c2884baab80740ba09b286 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 19 Jul 2023 16:23:52 -0500 Subject: [PATCH 03/37] progress --- crates/aptos-crypto/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/aptos-crypto/src/lib.rs b/crates/aptos-crypto/src/lib.rs index 2c062c67b2203..a7f0bb0ba6904 100644 --- a/crates/aptos-crypto/src/lib.rs +++ b/crates/aptos-crypto/src/lib.rs @@ -18,6 +18,7 @@ pub mod test_utils; pub mod traits; pub mod validatable; pub mod x25519; +pub mod p256; #[cfg(test)] mod unit_tests; From 69257dafe7df95d50864fc6e0eca65451c5f21eb Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 19 Jul 2023 16:24:31 -0500 Subject: [PATCH 04/37] progress --- crates/aptos-crypto/src/p256/mod.rs | 56 +++++ crates/aptos-crypto/src/p256/p256_keys.rs | 270 ++++++++++++++++++++++ crates/aptos-crypto/src/p256/p256_sigs.rs | 192 +++++++++++++++ 3 files changed, 518 insertions(+) create mode 100644 crates/aptos-crypto/src/p256/mod.rs create mode 100644 crates/aptos-crypto/src/p256/p256_keys.rs create mode 100644 crates/aptos-crypto/src/p256/p256_sigs.rs diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs new file mode 100644 index 0000000000000..8484b9b1f424f --- /dev/null +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -0,0 +1,56 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 +// TODO: Fix docs +//! This module provides an API for the PureEdDSA signature scheme over the Ed25519 twisted +//! Edwards curve as defined in [RFC8032](https://tools.ietf.org/html/rfc8032). +//! +//! Signature verification also checks and rejects non-canonical signatures. +//! +//! # Examples +//! +//! ``` +//! use aptos_crypto_derive::{CryptoHasher, BCSCryptoHash}; +//! use aptos_crypto::{ +//! ed25519::*, +//! traits::{Signature, SigningKey, Uniform}, +//! test_utils::KeyPair +//! }; +//! use rand::{rngs::StdRng, SeedableRng}; +//! use rand_core::OsRng; +//! use serde::{Serialize, Deserialize}; +//! +//! #[derive(Serialize, Deserialize, CryptoHasher, BCSCryptoHash)] +//! pub struct TestCryptoDocTest(String); +//! let message = TestCryptoDocTest("Test message".to_string()); +//! +//! let mut rng = OsRng; +//! let kp = KeyPair::::generate(&mut rng); +//! +//! let signature = kp.private_key.sign(&message).unwrap(); +//! assert!(signature.verify(&message, &kp.public_key).is_ok()); +//! ``` + +/// The length of the P256PrivateKey +pub const P256_PRIVATE_KEY_LENGTH: usize = 32; +/// The length of the P256PublicKey +pub const P256_PUBLIC_KEY_LENGTH: usize = 64; +/// The length of the P256Signature +pub const P256_SIGNATURE_LENGTH: usize = 64; + +/// The order of p256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). +// TODO: Make sure this has the correct endianness +const L: [u8; 32] = [ + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9e, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51, +]; + +pub mod p256_keys; +pub mod p256_sigs; + +#[cfg(any(test, feature = "fuzzing"))] +pub use p256_keys::keypair_strategy; +pub use p256_keys::{ + P256PrivateKey, P256PrivateKey as PrivateKey, P256PublicKey, + P256PublicKey as PublicKey, +}; +pub use p256_sigs::{P256Signature, P256Signature as Signature}; diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs new file mode 100644 index 0000000000000..8c1e6adb09182 --- /dev/null +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -0,0 +1,270 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +//! This file implements traits for Ed25519 private keys and public keys. + +#[cfg(any(test, feature = "fuzzing"))] +use crate::test_utils::{self, KeyPair}; +use crate::{ + p256::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, + hash::CryptoHash, + traits::*, +}; +use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; +use core::convert::TryFrom; +#[cfg(any(test, feature = "fuzzing"))] +use proptest::prelude::*; +use serde::Serialize; +use std::fmt; + +/// A P256 private key +#[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] +pub struct P256PrivateKey(pub(crate) p256::ecdsa::SigningKey); + +#[cfg(feature = "assert-private-keys-not-cloneable")] +static_assertions::assert_not_impl_any!(P256PrivateKey: Clone); + +#[cfg(any(test, feature = "cloneable-private-keys"))] +impl Clone for P256PrivateKey { + fn clone(&self) -> Self { + let serialized: &[u8] = &(self.to_bytes()); + P256PrivateKey::try_from(serialized).unwrap() + } +} + +/// A P256 public key +#[derive(DeserializeKey, Clone, SerializeKey)] +pub struct P256PublicKey(pub(crate) p256::ecdsa::VerifyingKey); + +impl P256PrivateKey { + /// The length of the P256PrivateKey + pub const LENGTH: usize = P256_PRIVATE_KEY_LENGTH; + + /// Serialize a P256PrivateKey. + pub fn to_bytes(&self) -> [u8; P256_PRIVATE_KEY_LENGTH] { + self.0.to_bytes() + } + + /// Deserialize an P256PrivateKey without any validation checks apart from expected key size. + fn from_bytes_unchecked( + bytes: &[u8], + ) -> std::result::Result { + match p256::ecdsa::SigningKey::from_bytes(bytes) { + Ok(p256_secret_key) => Ok(P256PrivateKey(p256_secret_key)), + Err(_) => Err(CryptoMaterialError::DeserializationError), + } + } + + /// Private function aimed at minimizing code duplication between sign + /// methods of the SigningKey implementation. This should remain private. + fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { + let secret_key: &p256::SecretKey = &self.0; + let public_key: P256PublicKey = self.into(); + let sig = secret_key.sign(message.as_ref()); + P256Signature(sig) + } +} + +impl P256PublicKey { + /// Serialize a P256PublicKey. + pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { + self.0.to_bytes() + } + + /// Deserialize a P256PublicKey without any validation checks apart from expected key size + /// and valid curve point, although not necessarily in the prime-order subgroup. + /// + /// This function does NOT check the public key for membership in a small subgroup. + pub(crate) fn from_bytes_unchecked( + bytes: &[u8], + ) -> std::result::Result { + match ed25519_dalek::PublicKey::from_bytes(bytes) { + Ok(p256_public_key) => Ok(P256PublicKey(p256_public_key)), + Err(_) => Err(CryptoMaterialError::DeserializationError), + } + } +} + +/////////////////////// +// PrivateKey Traits // +/////////////////////// + +impl PrivateKey for P256PrivateKey { + type PublicKeyMaterial = P256PublicKey; +} + +impl SigningKey for P256PrivateKey { + type SignatureMaterial = P256Signature; + type VerifyingKeyMaterial = P256PublicKey; + + fn sign( + &self, + message: &T, + ) -> Result { + Ok(P256PrivateKey::sign_arbitrary_message( + self, + signing_message(message)?.as_ref(), + )) + } + + #[cfg(any(test, feature = "fuzzing"))] + fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { + P256PrivateKey::sign_arbitrary_message(self, message) + } +} + +impl Uniform for P256PrivateKey { + fn generate(rng: &mut R) -> Self + where + R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, + { + P256PrivateKey(p256::ecdsa::SigningKey::random(rng)) + } +} + +impl PartialEq for P256PrivateKey { + fn eq(&self, other: &Self) -> bool { + self.to_bytes() == other.to_bytes() + } +} + +impl Eq for P256PrivateKey {} + +// We could have a distinct kind of validation for the PrivateKey: e.g., checking the derived +// PublicKey is valid? +impl TryFrom<&[u8]> for P256PrivateKey { + type Error = CryptoMaterialError; + + /// Deserialize a P256PrivateKey. This method will check for private key validity: i.e., + /// correct key length. + fn try_from(bytes: &[u8]) -> std::result::Result { + // TODO: Check this comment for p256 + // Note that the only requirement is that the size of the key is 32 bytes, something that + // is already checked during deserialization of ed25519_dalek::SecretKey + // + // Also, the underlying ed25519_dalek implementation ensures that the derived public key + // is safe and it will not lie in a small-order group, thus no extra check for PublicKey + // validation is required. + P256PrivateKey::from_bytes_unchecked(bytes) + } +} + +impl Length for P256PrivateKey { + fn length(&self) -> usize { + Self::LENGTH + } +} + +impl ValidCryptoMaterial for P256PrivateKey { + fn to_bytes(&self) -> Vec { + self.to_bytes().to_vec() + } +} + +impl Genesis for P256PrivateKey { + fn genesis() -> Self { + let mut buf = [0u8; P256_PRIVATE_KEY_LENGTH]; + buf[P256_PRIVATE_KEY_LENGTH - 1] = 1; + Self::try_from(buf.as_ref()).unwrap() + } +} + +////////////////////// +// PublicKey Traits // +////////////////////// + +// Implementing From<&PrivateKey<...>> allows to derive a public key in a more elegant fashion +impl From<&P256PrivateKey> for P256PublicKey { + fn from(private_key: &P256PrivateKey) -> Self { + let secret: &p256::SecretKey = &private_key.0; + let public: p256::PublicKey = secret.into(); + P256PublicKey(public) + } +} + +// We deduce PublicKey from this +impl PublicKey for P256PublicKey { + type PrivateKeyMaterial = P256PrivateKey; +} + +impl std::hash::Hash for P256PublicKey { + fn hash(&self, state: &mut H) { + let encoded_pubkey = self.to_bytes(); + state.write(&encoded_pubkey); + } +} + +// Those are required by the implementation of hash above +impl PartialEq for P256PublicKey { + fn eq(&self, other: &P256PublicKey) -> bool { + self.to_bytes() == other.to_bytes() + } +} + +impl Eq for P256PublicKey {} + +// We deduce VerifyingKey from pointing to the signature material +// we get the ability to do `pubkey.validate(msg, signature)` +impl VerifyingKey for P256PublicKey { + type SignatureMaterial = P256Signature; + type SigningKeyMaterial = P256PrivateKey; +} + +impl fmt::Display for P256PublicKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", hex::encode(self.0.as_bytes())) + } +} + +impl fmt::Debug for P256PublicKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "P256PublicKey({})", self) + } +} + +impl TryFrom<&[u8]> for P256PublicKey { + type Error = CryptoMaterialError; + + /// Deserialize a P256PublicKey. This method will NOT check for key validity, which means + /// the returned public key could be in a small subgroup. Nonetheless, our signature + /// verification implicitly checks if the public key lies in a small subgroup, so canonical + /// uses of this library will not be susceptible to small subgroup attacks. + fn try_from(bytes: &[u8]) -> std::result::Result { + P256PublicKey::from_bytes_unchecked(bytes) + } +} + +impl Length for P256PublicKey { + fn length(&self) -> usize { + P256_PUBLIC_KEY_LENGTH + } +} + +impl ValidCryptoMaterial for P256PublicKey { + fn to_bytes(&self) -> Vec { + self.0.to_bytes().to_vec() + } +} + +///////////// +// Fuzzing // +///////////// + +/// Produces a uniformly random P256 keypair from a seed +#[cfg(any(test, feature = "fuzzing"))] +pub fn keypair_strategy() -> impl Strategy> { + test_utils::uniform_keypair_strategy::() +} + +/// Produces a uniformly random P256 public key +#[cfg(any(test, feature = "fuzzing"))] +impl proptest::arbitrary::Arbitrary for P256PublicKey { + type Parameters = (); + type Strategy = BoxedStrategy; + + fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { + crate::test_utils::uniform_keypair_strategy::() + .prop_map(|v| v.public_key) + .boxed() + } +} diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs new file mode 100644 index 0000000000000..c1eefecf7c6f8 --- /dev/null +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -0,0 +1,192 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +//! This file implements traits for Ed25519 signatures. + +use crate::{ + p256::{P256PrivateKey, P256PublicKey,L}, + hash::CryptoHash, + traits::*, +}; +use anyhow::{anyhow, Result}; +use aptos_crypto_derive::{DeserializeKey, SerializeKey}; +use core::convert::TryFrom; +use serde::Serialize; +use std::{cmp::Ordering, fmt}; + +use super::P256_SIGNATURE_LENGTH; + +/// A P256 signature +#[derive(DeserializeKey, Clone, SerializeKey)] +pub struct P256Signature(pub(crate) p256::ecdsa::Signature); + +impl P256Signature { + /// The length of the P256Signature + pub const LENGTH: usize = P256_SIGNATURE_LENGTH; + + /// Serialize an P256Signature. + pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { + self.0.to_bytes() + } + + /// Deserialize an P256Signature without any validation checks (malleability) + /// apart from expected signature size. + pub(crate) fn from_bytes_unchecked( + bytes: &[u8], + ) -> std::result::Result { + match p256::ecdsa::Signature::try_from(bytes) { + Ok(p256_signature) => Ok(P256Signature(p256_signature)), + Err(_) => Err(CryptoMaterialError::DeserializationError), + } + } + + /// return an all-zero signature (for test only) + #[cfg(any(test, feature = "fuzzing"))] + pub fn dummy_signature() -> Self { + Self::from_bytes_unchecked(&[0u8; Self::LENGTH]).unwrap() + } + + /*/// Check for correct size and third-party based signature malleability issues. + /// This method is required to ensure that given a valid signature for some message under some + /// key, an attacker cannot produce another valid signature for the same message and key. + /// + /// According to [RFC8032](https://tools.ietf.org/html/rfc8032), signatures comprise elements + /// {R, S} and we should enforce that S is of canonical form (smaller than L, where L is the + /// order of edwards25519 curve group) to prevent signature malleability. Without this check, + /// one could add a multiple of L into S and still pass signature verification, resulting in + /// a distinct yet valid signature. + /// + /// This method does not check the R component of the signature, because R is hashed during + /// signing and verification to compute h = H(ENC(R) || ENC(A) || M), which means that a + /// third-party cannot modify R without being detected. + /// + /// Note: It's true that malicious signers can already produce varying signatures by + /// choosing a different nonce, so this method protects against malleability attacks performed + /// by a non-signer. + // TODO: Check if this is needed for p256 + /*pub fn check_s_malleability(bytes: &[u8]) -> std::result::Result<(), CryptoMaterialError> { + if bytes.len() != ED25519_SIGNATURE_LENGTH { + return Err(CryptoMaterialError::WrongLengthError); + } + if !Ed25519Signature::check_s_lt_l(&bytes[32..]) { + return Err(CryptoMaterialError::CanonicalRepresentationError); + } + Ok(()) + }*/ + + /// Check if S < L to capture invalid signatures. + /*fn check_s_lt_l(s: &[u8]) -> bool { + for i in (0..32).rev() { + match s[i].cmp(&L[i]) { + Ordering::Less => return true, + Ordering::Greater => return false, + _ => {}, + } + } + // As this stage S == L which implies a non canonical S. + false + }*/*/ +} + +////////////////////// +// Signature Traits // +////////////////////// + +impl Signature for P256Signature { + type SigningKeyMaterial = P256PrivateKey; + type VerifyingKeyMaterial = P256PublicKey; + + /// Verifies that the provided signature is valid for the provided message, going beyond the + /// [RFC8032](https://tools.ietf.org/html/rfc8032) specification, checking both scalar + /// malleability and point malleability (see documentation [here](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.PublicKey.html#on-the-multiple-sources-of-malleability-in-ed25519-signatures)). + /// + /// This _strict_ verification performs steps 1,2 and 3 from Section 5.1.7 in RFC8032, and an + /// additional scalar malleability check (via [Ed25519Signature::check_s_malleability][Ed25519Signature::check_s_malleability]). + /// + /// This function will ensure both the signature and the `public_key` are not in a small subgroup. + fn verify( + &self, + message: &T, + public_key: &P256PublicKey, + ) -> Result<()> { + Self::verify_arbitrary_msg(self, &signing_message(message)?, public_key) + } + + /// Checks that `self` is valid for an arbitrary &[u8] `message` using `public_key`. + /// Outside of this crate, this particular function should only be used for native signature + /// verification in Move. + /// + /// This function will check both the signature and `public_key` for small subgroup attacks. + fn verify_arbitrary_msg(&self, message: &[u8], public_key: &P256PublicKey) -> Result<()> { + // NOTE: ed25519::PublicKey::verify_strict already checks that the s-component of the signature + // is not mauled, but does so via an optimistic path which fails into a slower path. By doing + // our own (much faster) checking here, we can ensure dalek's optimistic path always succeeds + // and the slow path is never triggered. + //Ed25519Signature::check_s_malleability(&self.to_bytes())?; + + // NOTE: ed25519::PublicKey::verify_strict checks that the signature's R-component and + // the public key are *not* in a small subgroup. + /*public_key + .0 + .verify_strict(message, &self.0) + .map_err(|e| anyhow!("{}", e)) + .and(Ok(()))*/ + public_key.0.verify(message, &self.0).map_err(|e| anyhow!("{}", e)).and(Ok()) + } + + fn to_bytes(&self) -> Vec { + self.0.to_bytes().to_vec() + } +} + +impl Length for P256Signature { + fn length(&self) -> usize { + P256_SIGNATURE_LENGTH + } +} + +impl ValidCryptoMaterial for P256Signature { + fn to_bytes(&self) -> Vec { + self.to_bytes().to_vec() + } +} + +impl std::hash::Hash for P256Signature { + fn hash(&self, state: &mut H) { + let encoded_signature = self.to_bytes(); + state.write(&encoded_signature); + } +} + +impl TryFrom<&[u8]> for P256Signature { + type Error = CryptoMaterialError; + + fn try_from(bytes: &[u8]) -> std::result::Result { + // We leave this check here to detect mauled signatures earlier, since it does not hurt + // performance much. (This check is performed again in Ed25519Signature::verify_arbitrary_msg + // and in ed25519-dalek's verify_strict API.) + //Ed25519Signature::check_s_malleability(bytes)?; + P256Signature::from_bytes_unchecked(bytes) + } +} + +// Those are required by the implementation of hash above +impl PartialEq for P256Signature { + fn eq(&self, other: &P256Signature) -> bool { + self.to_bytes()[..] == other.to_bytes()[..] + } +} + +impl Eq for P256Signature {} + +impl fmt::Display for P256Signature { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", hex::encode(&self.0.to_bytes()[..])) + } +} + +impl fmt::Debug for P256Signature { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "P256Signature({})", self) + } +} From e836fb138d5ad1ce17e9a45426e03a7240dad08e Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 20 Jul 2023 13:56:48 -0500 Subject: [PATCH 05/37] fewer errors --- crates/aptos-crypto/src/p256/p256_keys.rs | 17 +++++++++++++---- crates/aptos-crypto/src/p256/p256_sigs.rs | 2 ++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index 8c1e6adb09182..6449a04e71606 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -10,6 +10,8 @@ use crate::{ hash::CryptoHash, traits::*, }; +use p256::{ecdsa::signature::Signer, elliptic_curve::sec1}; +use p256; use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; use core::convert::TryFrom; #[cfg(any(test, feature = "fuzzing"))] @@ -21,6 +23,8 @@ use std::fmt; #[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] pub struct P256PrivateKey(pub(crate) p256::ecdsa::SigningKey); +impl private::Sealed for P256PrivateKey {} + #[cfg(feature = "assert-private-keys-not-cloneable")] static_assertions::assert_not_impl_any!(P256PrivateKey: Clone); @@ -36,13 +40,15 @@ impl Clone for P256PrivateKey { #[derive(DeserializeKey, Clone, SerializeKey)] pub struct P256PublicKey(pub(crate) p256::ecdsa::VerifyingKey); +impl private::Sealed for P256PublicKey {} + impl P256PrivateKey { /// The length of the P256PrivateKey pub const LENGTH: usize = P256_PRIVATE_KEY_LENGTH; /// Serialize a P256PrivateKey. pub fn to_bytes(&self) -> [u8; P256_PRIVATE_KEY_LENGTH] { - self.0.to_bytes() + self.0.to_bytes().into() } /// Deserialize an P256PrivateKey without any validation checks apart from expected key size. @@ -58,7 +64,7 @@ impl P256PrivateKey { /// Private function aimed at minimizing code duplication between sign /// methods of the SigningKey implementation. This should remain private. fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { - let secret_key: &p256::SecretKey = &self.0; + let secret_key: &p256::ecdsa::SigningKey = &self.0; let public_key: P256PublicKey = self.into(); let sig = secret_key.sign(message.as_ref()); P256Signature(sig) @@ -67,8 +73,10 @@ impl P256PrivateKey { impl P256PublicKey { /// Serialize a P256PublicKey. + // TODO: Better error handling here. Also should we compress? pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { - self.0.to_bytes() + let bytes = &*self.0.to_encoded_point(false).to_bytes(); + bytes.try_into().unwrap() } /// Deserialize a P256PublicKey without any validation checks apart from expected key size @@ -78,7 +86,8 @@ impl P256PublicKey { pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { - match ed25519_dalek::PublicKey::from_bytes(bytes) { + let enc_point = sec1::EncodedPoint::from_bytes(bytes); + match p256::ecdsa::VerifyingKey::from_bytes(bytes) { Ok(p256_public_key) => Ok(P256PublicKey(p256_public_key)), Err(_) => Err(CryptoMaterialError::DeserializationError), } diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index c1eefecf7c6f8..65bd1c0138e70 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -20,6 +20,8 @@ use super::P256_SIGNATURE_LENGTH; #[derive(DeserializeKey, Clone, SerializeKey)] pub struct P256Signature(pub(crate) p256::ecdsa::Signature); +impl private::Sealed for P256Signature {} + impl P256Signature { /// The length of the P256Signature pub const LENGTH: usize = P256_SIGNATURE_LENGTH; From c3bc8febf140b1601d78cff723506dcbd2017e80 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 20 Jul 2023 14:52:02 -0500 Subject: [PATCH 06/37] update zeroize subdependency --- Cargo.lock | 102 ++++++++++++++++++++++----------- Cargo.toml | 6 +- crates/aptos-crypto/Cargo.toml | 1 + 3 files changed, 74 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6a5db2b859d7..a12a82b6cbaa1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -797,6 +797,7 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "ring", + "sec1 0.7.3", "serde 1.0.149", "serde-name", "serde_bytes", @@ -4261,6 +4262,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.12.3" @@ -4478,7 +4485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -4487,7 +4494,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -4747,7 +4754,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -5037,6 +5044,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" +[[package]] +name = "const-oid" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" + [[package]] name = "const_fn" version = "0.4.9" @@ -5127,9 +5140,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.4" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -5311,7 +5324,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -5323,7 +5336,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "typenum", ] @@ -5333,7 +5346,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -5343,7 +5356,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -5353,7 +5366,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -5430,9 +5443,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder", "digest 0.9.0", @@ -5545,7 +5558,17 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" dependencies = [ - "const-oid", + "const-oid 0.7.1", +] + +[[package]] +name = "der" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +dependencies = [ + "const-oid 0.9.4", + "zeroize", ] [[package]] @@ -5680,7 +5703,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -5832,7 +5855,7 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" dependencies = [ - "der", + "der 0.5.1", "elliptic-curve", "rfc6979", "signature", @@ -5887,14 +5910,15 @@ version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" dependencies = [ - "base16ct", + "base16ct 0.1.1", "crypto-bigint", - "der", + "der 0.5.1", "ff", - "generic-array 0.14.6", + "generic-array 0.14.7", "group", "rand_core 0.6.4", - "sec1", + "sec1 0.2.1", + "serde 1.0.149", "subtle", "zeroize", ] @@ -6523,9 +6547,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -6913,7 +6937,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.6", + "generic-array 0.14.7", "hmac 0.8.1", ] @@ -9608,7 +9632,7 @@ checksum = "19736d80675fbe9fe33426268150b951a3fb8f5cfca2a23a17c85ef3adb24e3b" dependencies = [ "ecdsa", "elliptic-curve", - "sec1", + "sec1 0.2.1", "sha2 0.9.9", ] @@ -9940,7 +9964,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" dependencies = [ - "der", + "der 0.5.1", "spki", "zeroize", ] @@ -11238,13 +11262,26 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ - "der", - "generic-array 0.14.6", + "der 0.5.1", + "generic-array 0.14.7", "pkcs8", + "serde 1.0.149", "subtle", "zeroize", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.7", + "generic-array 0.14.7", + "zeroize", +] + [[package]] name = "security-framework" version = "2.7.0" @@ -11886,7 +11923,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" dependencies = [ "base64ct", - "der", + "der 0.5.1", ] [[package]] @@ -13016,7 +13053,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -13636,8 +13673,7 @@ dependencies = [ [[package]] name = "x25519-dalek" version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077" +source = "git+https://github.com/aptos-labs/x25519-dalek#b9cdbaf36bf2a83438d9f660e5a708c82ed60d8e" dependencies = [ "curve25519-dalek", "rand_core 0.5.1", @@ -13682,9 +13718,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index d62f692755fa0..4b46f07aafa9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -510,7 +510,9 @@ num-traits = "0.2.15" once_cell = "1.10.0" ouroboros = "0.15.6" owo-colors = "3.5.0" -p256 = "0.10.1" +# TODO: Do we actually use serde? +p256 = { version = "0.10.1", features = ["serde"] } +sec1 = "0.7.0" parking_lot = "0.12.0" paste = "1.0.7" percent-encoding = "2.1.0" @@ -608,7 +610,7 @@ walkdir = "2.3.3" warp = { version = "0.3.5", features = ["tls"] } warp-reverse-proxy = "1.0.0" which = "4.2.5" -x25519-dalek = "1.2.0" +x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek" } # MOVE DEPENDENCIES move-abigen = { path = "third_party/move/move-prover/move-abigen" } diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index 3b2ae177f5f8b..966f2a52d21ef 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -44,6 +44,7 @@ thiserror = { workspace = true } tiny-keccak = { workspace = true } x25519-dalek = { workspace = true } p256 = { workspace = true } +sec1 = {workspace = true } [dev-dependencies] ark-bls12-381 = { workspace = true } From 2db972ebc465ce668fe2491d5559e5f404365910 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Fri, 21 Jul 2023 10:31:48 -0500 Subject: [PATCH 07/37] edit --- crates/aptos-crypto/src/p256/p256_keys.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index 6449a04e71606..a99093fdd1395 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -10,7 +10,7 @@ use crate::{ hash::CryptoHash, traits::*, }; -use p256::{ecdsa::signature::Signer, elliptic_curve::sec1}; +use p256::{ecdsa::signature::Signer, elliptic_curve::sec1, NistP256}; use p256; use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; use core::convert::TryFrom; @@ -75,6 +75,7 @@ impl P256PublicKey { /// Serialize a P256PublicKey. // TODO: Better error handling here. Also should we compress? pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { + let enc = self.0.to_encoded_point(false); let bytes = &*self.0.to_encoded_point(false).to_bytes(); bytes.try_into().unwrap() } @@ -86,8 +87,9 @@ impl P256PublicKey { pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { - let enc_point = sec1::EncodedPoint::from_bytes(bytes); - match p256::ecdsa::VerifyingKey::from_bytes(bytes) { + // TODO: Better error handling + let enc_point: sec1::EncodedPoint = sec1::EncodedPoint::from_bytes(bytes).unwrap(); + match p256::ecdsa::VerifyingKey::from_encoded_point(&enc_point) { Ok(p256_public_key) => Ok(P256PublicKey(p256_public_key)), Err(_) => Err(CryptoMaterialError::DeserializationError), } @@ -125,7 +127,8 @@ impl SigningKey for P256PrivateKey { impl Uniform for P256PrivateKey { fn generate(rng: &mut R) -> Self where - R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, + // R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, + R: p256::elliptic_curve::rand_core::RngCore + p256::elliptic_curve::rand_core::CryptoRng, { P256PrivateKey(p256::ecdsa::SigningKey::random(rng)) } From 3de0714a2f2bae52e8dcaf8118464caea4063cb9 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 3 Aug 2023 13:38:27 -0500 Subject: [PATCH 08/37] compiles --- Cargo.lock | 199 +++++++++++----------- Cargo.toml | 3 +- crates/aptos-crypto/Cargo.toml | 2 + crates/aptos-crypto/src/p256/mod.rs | 13 +- crates/aptos-crypto/src/p256/p256_keys.rs | 28 ++- crates/aptos-crypto/src/p256/p256_sigs.rs | 29 ++-- 6 files changed, 135 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a12a82b6cbaa1..14be7ab1eb88f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -797,7 +797,7 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "ring", - "sec1 0.7.3", + "sec1", "serde 1.0.149", "serde-name", "serde_bytes", @@ -805,6 +805,7 @@ dependencies = [ "sha2 0.10.6", "sha2 0.9.9", "sha3 0.9.1", + "signature 2.1.0", "static_assertions", "thiserror", "tiny-keccak", @@ -3769,7 +3770,7 @@ dependencies = [ "ark-serialize", "ark-std", "derivative", - "digest 0.10.5", + "digest 0.10.7", "itertools", "num-bigint 0.4.3", "num-traits 0.2.15", @@ -3822,7 +3823,7 @@ checksum = "e7e735959bc173ea4baf13327b19c22d452b8e9e8e8f7b7fc34e6bf0e316c33e" dependencies = [ "ark-serialize-derive", "ark-std", - "digest 0.10.5", + "digest 0.10.7", "num-bigint 0.4.3", ] @@ -4256,12 +4257,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -4453,7 +4448,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -5038,12 +5033,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - [[package]] name = "const-oid" version = "0.9.4" @@ -5320,9 +5309,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.3.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -5360,16 +5349,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - [[package]] name = "csv" version = "1.2.1" @@ -5552,22 +5531,14 @@ dependencies = [ "serde 1.0.149", ] -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid 0.7.1", -] - [[package]] name = "der" version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" dependencies = [ - "const-oid 0.9.4", + "const-oid", + "pem-rfc7468", "zeroize", ] @@ -5708,11 +5679,12 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.2", + "const-oid", "crypto-common", "subtle", ] @@ -5851,14 +5823,17 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.13.4" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.5.1", + "der", + "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature", + "serdect", + "signature 2.1.0", + "spki", ] [[package]] @@ -5868,7 +5843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" dependencies = [ "serde 1.0.149", - "signature", + "signature 1.4.0", ] [[package]] @@ -5906,19 +5881,21 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" -version = "0.11.12" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct 0.1.1", + "base16ct", "crypto-bigint", - "der 0.5.1", + "digest 0.10.7", "ff", "generic-array 0.14.7", "group", + "pem-rfc7468", + "pkcs8", "rand_core 0.6.4", - "sec1 0.2.1", - "serde 1.0.149", + "sec1", + "serdect", "subtle", "zeroize", ] @@ -6226,9 +6203,9 @@ dependencies = [ [[package]] name = "ff" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "subtle", @@ -6553,6 +6530,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -6699,9 +6677,9 @@ dependencies = [ [[package]] name = "group" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", @@ -6911,23 +6889,13 @@ dependencies = [ "digest 0.9.0", ] -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.1", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -9626,14 +9594,15 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "p256" -version = "0.10.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19736d80675fbe9fe33426268150b951a3fb8f5cfca2a23a17c85ef3adb24e3b" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ "ecdsa", "elliptic-curve", - "sec1 0.2.1", - "sha2 0.9.9", + "primeorder", + "serdect", + "sha2 0.10.6", ] [[package]] @@ -9802,6 +9771,15 @@ dependencies = [ "base64 0.13.0", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -9960,13 +9938,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.8.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.5.1", + "der", "spki", - "zeroize", ] [[package]] @@ -10233,6 +10210,16 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "primeorder" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" +dependencies = [ + "elliptic-curve", + "serdect", +] + [[package]] name = "primitive-types" version = "0.10.1" @@ -10932,13 +10919,12 @@ dependencies = [ [[package]] name = "rfc6979" -version = "0.1.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", - "hmac 0.11.0", - "zeroize", + "hmac 0.12.1", + "subtle", ] [[package]] @@ -10980,7 +10966,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -11256,29 +11242,18 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "sec1" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" -dependencies = [ - "der 0.5.1", - "generic-array 0.14.7", - "pkcs8", - "serde 1.0.149", - "subtle", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.7", + "base16ct", + "der", "generic-array 0.14.7", + "pkcs8", + "serdect", + "subtle", "zeroize", ] @@ -11535,6 +11510,16 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde 1.0.149", +] + [[package]] name = "serializer-tests" version = "0.1.0" @@ -11553,7 +11538,7 @@ checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -11564,7 +11549,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -11594,7 +11579,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -11628,7 +11613,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", "keccak", ] @@ -11701,8 +11686,14 @@ name = "signature" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.9.0", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -11918,12 +11909,12 @@ checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" [[package]] name = "spki" -version = "0.5.4" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.5.1", + "der", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4b46f07aafa9f..27e42834bb57c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -511,7 +511,8 @@ once_cell = "1.10.0" ouroboros = "0.15.6" owo-colors = "3.5.0" # TODO: Do we actually use serde? -p256 = { version = "0.10.1", features = ["serde"] } +p256 = { version = "0.13.2", features = ["serde"] } +signature = "2.1.0" sec1 = "0.7.0" parking_lot = "0.12.0" paste = "1.0.7" diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index 966f2a52d21ef..351f48df8d8f9 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -44,7 +44,9 @@ thiserror = { workspace = true } tiny-keccak = { workspace = true } x25519-dalek = { workspace = true } p256 = { workspace = true } +# TODO: Remove this? sec1 = {workspace = true } +signature = { workspace = true } [dev-dependencies] ark-bls12-381 = { workspace = true } diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs index 8484b9b1f424f..b41dc1a6791af 100644 --- a/crates/aptos-crypto/src/p256/mod.rs +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -37,11 +37,16 @@ pub const P256_PUBLIC_KEY_LENGTH: usize = 64; /// The length of the P256Signature pub const P256_SIGNATURE_LENGTH: usize = 64; -/// The order of p256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). +/// The value (q-1)/2, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). +/// Computed with the following SageMath code: +/// +/// # Curve order +/// qq = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 +/// q_half = (qq-1)/2 // TODO: Make sure this has the correct endianness -const L: [u8; 32] = [ - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9e, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51, +// TODO: Make sure qq-1 is the correct thing to do +const ORDER_HALF: [u8; 32] = [ + 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x73, 0x7D, 0x56, 0xD3, 0x8B, 0xCF, 0x42, 0x79, 0xDC, 0xE5, 0x61, 0x7E, 0x31, 0x92, 0xA8, ]; pub mod p256_keys; diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index a99093fdd1395..0db111356c94e 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -10,7 +10,7 @@ use crate::{ hash::CryptoHash, traits::*, }; -use p256::{ecdsa::signature::Signer, elliptic_curve::sec1, NistP256}; +use p256::ecdsa::signature::Signer; use p256; use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; use core::convert::TryFrom; @@ -55,7 +55,7 @@ impl P256PrivateKey { fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { - match p256::ecdsa::SigningKey::from_bytes(bytes) { + match p256::ecdsa::SigningKey::from_slice(bytes) { Ok(p256_secret_key) => Ok(P256PrivateKey(p256_secret_key)), Err(_) => Err(CryptoMaterialError::DeserializationError), } @@ -65,7 +65,6 @@ impl P256PrivateKey { /// methods of the SigningKey implementation. This should remain private. fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { let secret_key: &p256::ecdsa::SigningKey = &self.0; - let public_key: P256PublicKey = self.into(); let sig = secret_key.sign(message.as_ref()); P256Signature(sig) } @@ -75,9 +74,7 @@ impl P256PublicKey { /// Serialize a P256PublicKey. // TODO: Better error handling here. Also should we compress? pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { - let enc = self.0.to_encoded_point(false); - let bytes = &*self.0.to_encoded_point(false).to_bytes(); - bytes.try_into().unwrap() + (*self.0.to_sec1_bytes()).try_into().unwrap() } /// Deserialize a P256PublicKey without any validation checks apart from expected key size @@ -87,9 +84,7 @@ impl P256PublicKey { pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { - // TODO: Better error handling - let enc_point: sec1::EncodedPoint = sec1::EncodedPoint::from_bytes(bytes).unwrap(); - match p256::ecdsa::VerifyingKey::from_encoded_point(&enc_point) { + match p256::ecdsa::VerifyingKey::from_sec1_bytes(bytes) { Ok(p256_public_key) => Ok(P256PublicKey(p256_public_key)), Err(_) => Err(CryptoMaterialError::DeserializationError), } @@ -127,10 +122,11 @@ impl SigningKey for P256PrivateKey { impl Uniform for P256PrivateKey { fn generate(rng: &mut R) -> Self where - // R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, - R: p256::elliptic_curve::rand_core::RngCore + p256::elliptic_curve::rand_core::CryptoRng, + R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, { - P256PrivateKey(p256::ecdsa::SigningKey::random(rng)) + let mut bytes: [u8; P256_PRIVATE_KEY_LENGTH] = Default::default(); + rng.fill_bytes(&mut bytes); + P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&bytes[..]).unwrap()) } } @@ -188,8 +184,8 @@ impl Genesis for P256PrivateKey { // Implementing From<&PrivateKey<...>> allows to derive a public key in a more elegant fashion impl From<&P256PrivateKey> for P256PublicKey { fn from(private_key: &P256PrivateKey) -> Self { - let secret: &p256::SecretKey = &private_key.0; - let public: p256::PublicKey = secret.into(); + let secret = &private_key.0; + let public: p256::ecdsa::VerifyingKey = secret.into(); P256PublicKey(public) } } @@ -224,7 +220,7 @@ impl VerifyingKey for P256PublicKey { impl fmt::Display for P256PublicKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", hex::encode(self.0.as_bytes())) + write!(f, "{}", hex::encode(self.0.to_sec1_bytes())) } } @@ -254,7 +250,7 @@ impl Length for P256PublicKey { impl ValidCryptoMaterial for P256PublicKey { fn to_bytes(&self) -> Vec { - self.0.to_bytes().to_vec() + self.0.to_sec1_bytes().to_vec() } } diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index 65bd1c0138e70..b6f5e85a41738 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -4,7 +4,7 @@ //! This file implements traits for Ed25519 signatures. use crate::{ - p256::{P256PrivateKey, P256PublicKey,L}, + p256::{P256PrivateKey, P256PublicKey, ORDER_HALF}, hash::CryptoHash, traits::*, }; @@ -13,6 +13,7 @@ use aptos_crypto_derive::{DeserializeKey, SerializeKey}; use core::convert::TryFrom; use serde::Serialize; use std::{cmp::Ordering, fmt}; +use signature::Verifier; use super::P256_SIGNATURE_LENGTH; @@ -28,7 +29,8 @@ impl P256Signature { /// Serialize an P256Signature. pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { - self.0.to_bytes() + // TODO: Better error handling + self.0.to_bytes().try_into().unwrap() } /// Deserialize an P256Signature without any validation checks (malleability) @@ -48,7 +50,7 @@ impl P256Signature { Self::from_bytes_unchecked(&[0u8; Self::LENGTH]).unwrap() } - /*/// Check for correct size and third-party based signature malleability issues. + /// Check for correct size and third-party based signature malleability issues. /// This method is required to ensure that given a valid signature for some message under some /// key, an attacker cannot produce another valid signature for the same message and key. /// @@ -65,21 +67,20 @@ impl P256Signature { /// Note: It's true that malicious signers can already produce varying signatures by /// choosing a different nonce, so this method protects against malleability attacks performed /// by a non-signer. - // TODO: Check if this is needed for p256 - /*pub fn check_s_malleability(bytes: &[u8]) -> std::result::Result<(), CryptoMaterialError> { - if bytes.len() != ED25519_SIGNATURE_LENGTH { + pub fn check_s_malleability(bytes: &[u8]) -> std::result::Result<(), CryptoMaterialError> { + if bytes.len() != P256_SIGNATURE_LENGTH { return Err(CryptoMaterialError::WrongLengthError); } - if !Ed25519Signature::check_s_lt_l(&bytes[32..]) { + if !P256Signature::check_s_lt_order_half(&bytes[32..]) { return Err(CryptoMaterialError::CanonicalRepresentationError); } Ok(()) - }*/ + } - /// Check if S < L to capture invalid signatures. - /*fn check_s_lt_l(s: &[u8]) -> bool { + /// Check if S < ORDER_HALF to capture invalid signatures. + fn check_s_lt_order_half(s: &[u8]) -> bool { for i in (0..32).rev() { - match s[i].cmp(&L[i]) { + match s[i].cmp(&ORDER_HALF[i]) { Ordering::Less => return true, Ordering::Greater => return false, _ => {}, @@ -87,7 +88,7 @@ impl P256Signature { } // As this stage S == L which implies a non canonical S. false - }*/*/ + } } ////////////////////// @@ -124,7 +125,7 @@ impl Signature for P256Signature { // is not mauled, but does so via an optimistic path which fails into a slower path. By doing // our own (much faster) checking here, we can ensure dalek's optimistic path always succeeds // and the slow path is never triggered. - //Ed25519Signature::check_s_malleability(&self.to_bytes())?; + P256Signature::check_s_malleability(&self.to_bytes())?; // NOTE: ed25519::PublicKey::verify_strict checks that the signature's R-component and // the public key are *not* in a small subgroup. @@ -133,7 +134,7 @@ impl Signature for P256Signature { .verify_strict(message, &self.0) .map_err(|e| anyhow!("{}", e)) .and(Ok(()))*/ - public_key.0.verify(message, &self.0).map_err(|e| anyhow!("{}", e)).and(Ok()) + public_key.0.verify(message, &self.0).map_err(|e| anyhow!("{}", e)).and(Ok(())) } fn to_bytes(&self) -> Vec { From 3b94993773eead48b7917eb4c5b22ba06a4da6e6 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 3 Aug 2023 14:09:34 -0500 Subject: [PATCH 09/37] edits --- crates/aptos-crypto/src/p256/mod.rs | 14 +++--- crates/aptos-crypto/src/p256/p256_keys.rs | 9 +--- crates/aptos-crypto/src/p256/p256_sigs.rs | 57 ++++++----------------- 3 files changed, 23 insertions(+), 57 deletions(-) diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs index b41dc1a6791af..2d042c15b62a3 100644 --- a/crates/aptos-crypto/src/p256/mod.rs +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -1,8 +1,6 @@ // Copyright © Aptos Foundation // SPDX-License-Identifier: Apache-2.0 -// TODO: Fix docs -//! This module provides an API for the PureEdDSA signature scheme over the Ed25519 twisted -//! Edwards curve as defined in [RFC8032](https://tools.ietf.org/html/rfc8032). +//! This module provides an API for the ECDSA signature scheme over the NIST-P256 curve as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). //! //! Signature verification also checks and rejects non-canonical signatures. //! @@ -11,7 +9,7 @@ //! ``` //! use aptos_crypto_derive::{CryptoHasher, BCSCryptoHash}; //! use aptos_crypto::{ -//! ed25519::*, +//! p256::*, //! traits::{Signature, SigningKey, Uniform}, //! test_utils::KeyPair //! }; @@ -24,17 +22,17 @@ //! let message = TestCryptoDocTest("Test message".to_string()); //! //! let mut rng = OsRng; -//! let kp = KeyPair::::generate(&mut rng); +//! let kp = KeyPair::::generate(&mut rng); //! //! let signature = kp.private_key.sign(&message).unwrap(); //! assert!(signature.verify(&message, &kp.public_key).is_ok()); //! ``` -/// The length of the P256PrivateKey +/// The length in bytes of the P256PrivateKey pub const P256_PRIVATE_KEY_LENGTH: usize = 32; -/// The length of the P256PublicKey +/// The length in bytes of the P256PublicKey pub const P256_PUBLIC_KEY_LENGTH: usize = 64; -/// The length of the P256Signature +/// The length in bytes of the P256Signature pub const P256_SIGNATURE_LENGTH: usize = 64; /// The value (q-1)/2, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index 0db111356c94e..c469a8aa5589b 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -72,8 +72,8 @@ impl P256PrivateKey { impl P256PublicKey { /// Serialize a P256PublicKey. - // TODO: Better error handling here. Also should we compress? pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { + // This should never return an array of the wrong length (*self.0.to_sec1_bytes()).try_into().unwrap() } @@ -146,13 +146,8 @@ impl TryFrom<&[u8]> for P256PrivateKey { /// Deserialize a P256PrivateKey. This method will check for private key validity: i.e., /// correct key length. fn try_from(bytes: &[u8]) -> std::result::Result { - // TODO: Check this comment for p256 // Note that the only requirement is that the size of the key is 32 bytes, something that - // is already checked during deserialization of ed25519_dalek::SecretKey - // - // Also, the underlying ed25519_dalek implementation ensures that the derived public key - // is safe and it will not lie in a small-order group, thus no extra check for PublicKey - // validation is required. + // is already checked during deserialization of p256::ecdsa::SigningKey P256PrivateKey::from_bytes_unchecked(bytes) } } diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index b6f5e85a41738..52bb2481c21ec 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -29,15 +29,15 @@ impl P256Signature { /// Serialize an P256Signature. pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { - // TODO: Better error handling + // The RustCrypto P256 `to_bytes` call here should never return a byte array of the wrong length self.0.to_bytes().try_into().unwrap() } - /// Deserialize an P256Signature without any validation checks (malleability) - /// apart from expected signature size. - pub(crate) fn from_bytes_unchecked( + /// Deserialize an P256Signature, checking for malleability + pub(crate) fn from_bytes( bytes: &[u8], ) -> std::result::Result { + P256Signature::check_s_malleability(bytes)?; match p256::ecdsa::Signature::try_from(bytes) { Ok(p256_signature) => Ok(P256Signature(p256_signature)), Err(_) => Err(CryptoMaterialError::DeserializationError), @@ -47,26 +47,20 @@ impl P256Signature { /// return an all-zero signature (for test only) #[cfg(any(test, feature = "fuzzing"))] pub fn dummy_signature() -> Self { - Self::from_bytes_unchecked(&[0u8; Self::LENGTH]).unwrap() + Self::from_bytes(&[0u8; Self::LENGTH]).unwrap() } /// Check for correct size and third-party based signature malleability issues. /// This method is required to ensure that given a valid signature for some message under some /// key, an attacker cannot produce another valid signature for the same message and key. /// - /// According to [RFC8032](https://tools.ietf.org/html/rfc8032), signatures comprise elements - /// {R, S} and we should enforce that S is of canonical form (smaller than L, where L is the - /// order of edwards25519 curve group) to prevent signature malleability. Without this check, - /// one could add a multiple of L into S and still pass signature verification, resulting in - /// a distinct yet valid signature. - /// - /// This method does not check the R component of the signature, because R is hashed during - /// signing and verification to compute h = H(ENC(R) || ENC(A) || M), which means that a - /// third-party cannot modify R without being detected. - /// - /// Note: It's true that malicious signers can already produce varying signatures by - /// choosing a different nonce, so this method protects against malleability attacks performed - /// by a non-signer. + /// We use the technique described in + /// [BIP146](https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki) to prevent + /// malleability of ECDSA signatures. Signatures comprise elements {R, S}, and S can be + /// enforced to be of canonical form by ensuring it is less than the order of the P256 curve + /// divided by 2. If this is not done, a value S > n/2 can be replaced by S' = n - S to form another distinct valid + /// signature, where n is the curve order. This check is not performed by the RustCrypto P256 library + /// we use pub fn check_s_malleability(bytes: &[u8]) -> std::result::Result<(), CryptoMaterialError> { if bytes.len() != P256_SIGNATURE_LENGTH { return Err(CryptoMaterialError::WrongLengthError); @@ -86,7 +80,7 @@ impl P256Signature { _ => {}, } } - // As this stage S == L which implies a non canonical S. + // As this stage S == ORDER_HALF which implies a non canonical S. false } } @@ -100,13 +94,7 @@ impl Signature for P256Signature { type VerifyingKeyMaterial = P256PublicKey; /// Verifies that the provided signature is valid for the provided message, going beyond the - /// [RFC8032](https://tools.ietf.org/html/rfc8032) specification, checking both scalar - /// malleability and point malleability (see documentation [here](https://docs.rs/ed25519-dalek/latest/ed25519_dalek/struct.PublicKey.html#on-the-multiple-sources-of-malleability-in-ed25519-signatures)). - /// - /// This _strict_ verification performs steps 1,2 and 3 from Section 5.1.7 in RFC8032, and an - /// additional scalar malleability check (via [Ed25519Signature::check_s_malleability][Ed25519Signature::check_s_malleability]). - /// - /// This function will ensure both the signature and the `public_key` are not in a small subgroup. + /// [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final) specification, to prevent scalar malleability as done in [BIP146](https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki). fn verify( &self, message: &T, @@ -121,19 +109,8 @@ impl Signature for P256Signature { /// /// This function will check both the signature and `public_key` for small subgroup attacks. fn verify_arbitrary_msg(&self, message: &[u8], public_key: &P256PublicKey) -> Result<()> { - // NOTE: ed25519::PublicKey::verify_strict already checks that the s-component of the signature - // is not mauled, but does so via an optimistic path which fails into a slower path. By doing - // our own (much faster) checking here, we can ensure dalek's optimistic path always succeeds - // and the slow path is never triggered. P256Signature::check_s_malleability(&self.to_bytes())?; - // NOTE: ed25519::PublicKey::verify_strict checks that the signature's R-component and - // the public key are *not* in a small subgroup. - /*public_key - .0 - .verify_strict(message, &self.0) - .map_err(|e| anyhow!("{}", e)) - .and(Ok(()))*/ public_key.0.verify(message, &self.0).map_err(|e| anyhow!("{}", e)).and(Ok(())) } @@ -165,11 +142,7 @@ impl TryFrom<&[u8]> for P256Signature { type Error = CryptoMaterialError; fn try_from(bytes: &[u8]) -> std::result::Result { - // We leave this check here to detect mauled signatures earlier, since it does not hurt - // performance much. (This check is performed again in Ed25519Signature::verify_arbitrary_msg - // and in ed25519-dalek's verify_strict API.) - //Ed25519Signature::check_s_malleability(bytes)?; - P256Signature::from_bytes_unchecked(bytes) + P256Signature::from_bytes(bytes) } } From 76141ac4f3932e773595dac70b5ec1f95c4ffab8 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 8 Aug 2023 09:22:22 -0500 Subject: [PATCH 10/37] started unit tests --- crates/aptos-crypto/src/p256/mod.rs | 8 +- crates/aptos-crypto/src/p256/p256_keys.rs | 8 +- crates/aptos-crypto/src/p256/p256_sigs.rs | 32 +- crates/aptos-crypto/src/unit_tests/mod.rs | 1 + .../aptos-crypto/src/unit_tests/p256_test.rs | 381 ++++++++++++++++++ 5 files changed, 423 insertions(+), 7 deletions(-) create mode 100644 crates/aptos-crypto/src/unit_tests/p256_test.rs diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs index 2d042c15b62a3..0ca40f033fbfe 100644 --- a/crates/aptos-crypto/src/p256/mod.rs +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -31,17 +31,21 @@ /// The length in bytes of the P256PrivateKey pub const P256_PRIVATE_KEY_LENGTH: usize = 32; /// The length in bytes of the P256PublicKey -pub const P256_PUBLIC_KEY_LENGTH: usize = 64; +pub const P256_PUBLIC_KEY_LENGTH: usize = 65; /// The length in bytes of the P256Signature pub const P256_SIGNATURE_LENGTH: usize = 64; +/// The order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final), minus one. +const ORDER_MINUS_ONE: [u8; 32] = [ + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x50, +]; + /// The value (q-1)/2, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). /// Computed with the following SageMath code: /// /// # Curve order /// qq = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 /// q_half = (qq-1)/2 -// TODO: Make sure this has the correct endianness // TODO: Make sure qq-1 is the correct thing to do const ORDER_HALF: [u8; 32] = [ 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x73, 0x7D, 0x56, 0xD3, 0x8B, 0xCF, 0x42, 0x79, 0xDC, 0xE5, 0x61, 0x7E, 0x31, 0x92, 0xA8, diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index c469a8aa5589b..65629b86f0a88 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -65,15 +65,17 @@ impl P256PrivateKey { /// methods of the SigningKey implementation. This should remain private. fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { let secret_key: &p256::ecdsa::SigningKey = &self.0; - let sig = secret_key.sign(message.as_ref()); - P256Signature(sig) + let sig = P256Signature(secret_key.sign(message.as_ref())); + let canonical_sig = P256Signature::make_canonical(&sig); + + canonical_sig } } impl P256PublicKey { /// Serialize a P256PublicKey. pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { - // This should never return an array of the wrong length + // The RustCrypto P256 `to_sec1_bytes` call here should never return an array of the wrong length and cause a panic (*self.0.to_sec1_bytes()).try_into().unwrap() } diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index 52bb2481c21ec..9921d648693a9 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -1,10 +1,10 @@ // Copyright © Aptos Foundation // SPDX-License-Identifier: Apache-2.0 -//! This file implements traits for Ed25519 signatures. +//! This file implements traits for ECDSA signatures over NIST-P256. use crate::{ - p256::{P256PrivateKey, P256PublicKey, ORDER_HALF}, + p256::{P256PrivateKey, P256PublicKey, ORDER_HALF, ORDER_MINUS_ONE}, hash::CryptoHash, traits::*, }; @@ -14,6 +14,9 @@ use core::convert::TryFrom; use serde::Serialize; use std::{cmp::Ordering, fmt}; use signature::Verifier; +use p256::NonZeroScalar; +use p256::NistP256; +use p256::elliptic_curve::Curve; use super::P256_SIGNATURE_LENGTH; @@ -30,6 +33,9 @@ impl P256Signature { /// Serialize an P256Signature. pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { // The RustCrypto P256 `to_bytes` call here should never return a byte array of the wrong length + let bytes = self.0.to_bytes(); + println!("len is {}", bytes.len()); + println!("bytes are {:?}", bytes); self.0.to_bytes().try_into().unwrap() } @@ -83,6 +89,28 @@ impl P256Signature { // As this stage S == ORDER_HALF which implies a non canonical S. false } + + /// If the signature {R,S} does not have S < n/2 where n is the Ristretto255 order, return + /// {R,n-S} as the canonical encoding of this signature to prevent malleability attacks. See + /// `check_s_malleability` for more detail + pub fn make_canonical(&self) -> P256Signature { + if P256Signature::check_s_malleability(&self.to_bytes()[..]).is_ok() { + return self.clone() + }; + let s = self.0.s(); + let r = self.0.r(); + // NonZeroScalar::try_from throws an error on being passed the curve order, so we use the + // order minus one, then add one later to compute (n-1) - s + 1 = n-s + let order_minus_one = NonZeroScalar::try_from(&ORDER_MINUS_ONE[..]).unwrap(); + let one = NonZeroScalar::from_uint(::Uint::ONE).unwrap(); + // Dereferencing a NonZeroScalar makes it a Scalar, which implements subtraction + let new_s = *order_minus_one - *s + *one; + // TODO: Make sure this never panics + let new_s_nonzero = NonZeroScalar::new(new_s).unwrap(); + // TODO: Make sure this never panics + let new_sig = p256::ecdsa::Signature::from_scalars(&r, &new_s_nonzero).unwrap(); + P256Signature(new_sig) + } } ////////////////////// diff --git a/crates/aptos-crypto/src/unit_tests/mod.rs b/crates/aptos-crypto/src/unit_tests/mod.rs index a7668773f1d8c..45de0c186c65d 100644 --- a/crates/aptos-crypto/src/unit_tests/mod.rs +++ b/crates/aptos-crypto/src/unit_tests/mod.rs @@ -7,6 +7,7 @@ mod compat_test; mod cross_test; mod cryptohasher; mod ed25519_test; +mod p256_test; mod hash_test; mod hkdf_test; mod multi_ed25519_test; diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs new file mode 100644 index 0000000000000..f06319e4f243a --- /dev/null +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -0,0 +1,381 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +#![allow(clippy::redundant_clone)] // Required to work around prop_assert_eq! limitations + +use crate as aptos_crypto; +use crate::{ + ed25519::{ + Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, ED25519_PRIVATE_KEY_LENGTH, + ED25519_PUBLIC_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, + }, + p256::{ + P256PrivateKey, P256PublicKey, P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH, P256_SIGNATURE_LENGTH, + }, + test_utils::{ + random_serializable_struct, small_order_pk_with_adversarial_message, + uniform_keypair_strategy, + }, + traits::*, + x25519, +}; +use p256::EncodedPoint; +use aptos_crypto_derive::{BCSCryptoHash, CryptoHasher}; +use core::{ + convert::TryFrom, + ops::{Add, Index, IndexMut, Mul, Neg}, +}; +use curve25519_dalek::{ + constants::ED25519_BASEPOINT_POINT, + edwards::{CompressedEdwardsY, EdwardsPoint}, + scalar::Scalar, +}; +use digest::Digest; +use ed25519_dalek::ed25519::signature::Verifier as _; +use proptest::{collection::vec, prelude::*}; +use serde::{Deserialize, Serialize}; +use sha2::Sha512; + +#[derive(CryptoHasher, BCSCryptoHash, Serialize, Deserialize)] +struct CryptoHashable(pub usize); +proptest! { + #[test] + fn test_pub_key_deserialization(bits in any::<[u8; 32]>()){ + let pt_deser = EncodedPoint::from_bytes(&bits[..]); + let pub_key = P256PublicKey::try_from(&bits[..]); + let check = matches!((pt_deser, pub_key), + (Ok(_), Ok(_)) // we agree with RustCrypto's sec1 implementation, + | (Err(_), Err(_)) // we agree on point decompression failures, + ); + prop_assert!(check); + } + + #[test] + fn test_keys_encode(keypair in uniform_keypair_strategy::()) { + { + let encoded = keypair.private_key.to_encoded_string().unwrap(); + // Hex encoding of a 64-bytes key is 128 (2 x 64) characters. + prop_assert_eq!(2 + 2 * P256_PRIVATE_KEY_LENGTH, encoded.len()); + let decoded = P256PrivateKey::from_encoded_string(&encoded); + prop_assert_eq!(Some(keypair.private_key), decoded.ok()); + } + { + let encoded = keypair.public_key.to_encoded_string().unwrap(); + // Hex encoding of a 65-bytes key is 130 (2 x 65) characters. + prop_assert_eq!(2 + 2 * P256_PUBLIC_KEY_LENGTH, encoded.len()); + let decoded = P256PublicKey::from_encoded_string(&encoded); + prop_assert_eq!(Some(keypair.public_key), decoded.ok()); + } + } + + #[test] + fn test_batch_verify( + message in random_serializable_struct(), + keypairs in proptest::array::uniform10(uniform_keypair_strategy::()) + ) { + let mut signatures: Vec<(P256PublicKey, P256Signature)> = keypairs.iter().map(|keypair| { + (keypair.public_key.clone(), keypair.private_key.sign(&message).unwrap()) + }).collect(); + prop_assert!(P256Signature::batch_verify(&message, signatures.clone()).is_ok()); + // We swap message and signature for the last element, + // resulting in an incorrect signature + let (key, _sig) = signatures.pop().unwrap(); + let other_sig = signatures.last().unwrap().clone().1; + signatures.push((key, other_sig)); + prop_assert!(P256Signature::batch_verify(&message, signatures).is_err()); + } + + #[test] + fn test_keys_custom_serialisation( + keypair in uniform_keypair_strategy::() + ) { + { + let serialized: &[u8] = &(keypair.private_key.to_bytes()); + prop_assert_eq!(P256_PRIVATE_KEY_LENGTH, serialized.len()); + let deserialized = P256PrivateKey::try_from(serialized); + prop_assert_eq!(Some(keypair.private_key), deserialized.ok()); + } + { + let serialized: &[u8] = &(keypair.public_key.to_bytes()); + prop_assert_eq!(P256_PUBLIC_KEY_LENGTH, serialized.len()); + let deserialized = P256PublicKey::try_from(serialized); + prop_assert_eq!(Some(keypair.public_key), deserialized.ok()); + } + } + + #[test] + fn test_signature_verification_custom_serialisation( + message in random_serializable_struct(), + keypair in uniform_keypair_strategy::() + ) { + let signature = keypair.private_key.sign(&message).unwrap(); + let serialized: &[u8] = &(signature.to_bytes()); + println!("serialized is {:?}", serialized); + prop_assert_eq!(P256_SIGNATURE_LENGTH, serialized.len()); + let deserialized = P256Signature::try_from(serialized).unwrap(); + prop_assert!(deserialized.verify(&message, &keypair.public_key).is_ok()); + } + + #[test] + fn test_signature_verification_from_arbitrary( + // this should be > 64 bits to go over the length of a default hash + msg in vec(proptest::num::u8::ANY, 1..128), + keypair in uniform_keypair_strategy::() + ) { + let signature = keypair.private_key.sign_arbitrary_message(&msg); + let serialized: &[u8] = &(signature.to_bytes()); + prop_assert_eq!(P256_SIGNATURE_LENGTH, serialized.len()); + let deserialized = P256Signature::try_from(serialized).unwrap(); + prop_assert!(deserialized.verify_arbitrary_msg(&msg, &keypair.public_key).is_ok()); + } + + #[test] + fn test_signature_verification_from_struct( + x in any::(), + keypair in uniform_keypair_strategy::() + ) { + let hashable = CryptoHashable(x); + let signature = keypair.private_key.sign(&hashable).unwrap(); + let serialized: &[u8] = &(signature.to_bytes()); + prop_assert_eq!(P256_SIGNATURE_LENGTH, serialized.len()); + let deserialized = P256Signature::try_from(serialized).unwrap(); + prop_assert!(deserialized.verify(&hashable, &keypair.public_key).is_ok()); + } + + + /*// Check for canonical S. + #[test] + fn test_signature_malleability( + message in random_serializable_struct(), + keypair in uniform_keypair_strategy::() + ) { + let signature = keypair.private_key.sign(&message).unwrap(); + let mut serialized = signature.to_bytes(); + let serialized_old = serialized; // implements Copy trait + prop_assert_eq!(serialized_old, serialized); + + let mut r_bytes: [u8; 32] = [0u8; 32]; + r_bytes.copy_from_slice(&serialized[..32]); + + let mut s_bytes: [u8; 32] = [0u8; 32]; + s_bytes.copy_from_slice(&serialized[32..]); + + // ed25519-dalek signing ensures a canonical S value. + let s = Scalar52::from_bytes(&s_bytes); + + // adding L (order of the base point) so that S + L > L + let malleable_s = Scalar52::add(&s, &ORDER_HALF); + let malleable_s_bytes = malleable_s.to_bytes(); + // Update the signature (the S part). + serialized[32..].copy_from_slice(&malleable_s_bytes); + + prop_assert_ne!(serialized_old, serialized); + + // Check that malleable signatures will pass verification and deserialization in dalek. + // Construct the corresponding dalek public key. + let _dalek_public_key = ed25519_dalek::PublicKey::from_bytes( + &keypair.public_key.to_bytes() + ).unwrap(); + + // Construct the corresponding dalek Signature. This signature is malleable. + let dalek_sig = ed25519_dalek::Signature::from_bytes(&serialized); + + // ed25519_dalek will (post 2.0) deserialize the malleable + // signature. It does not detect it. + prop_assert!(dalek_sig.is_ok()); + + let msg_bytes = bcs::to_bytes(&message); + prop_assert!(msg_bytes.is_ok()); + + // ed25519_dalek verify will NOT accept the mauled signature + prop_assert!(_dalek_public_key.verify(msg_bytes.as_ref().unwrap(), dalek_sig.as_ref().unwrap()).is_err()); + // ...and ed25519_dalek verify_strict will NOT accept it either + prop_assert!(_dalek_public_key.verify_strict(msg_bytes.as_ref().unwrap(), dalek_sig.as_ref().unwrap()).is_err()); + // ...therefore, neither will our own Ed25519Signature::verify_arbitrary_msg + let sig = Ed25519Signature::from_bytes_unchecked(&serialized).unwrap(); + prop_assert!(sig.verify(&message, &keypair.public_key).is_err()); + + let serialized_malleable: &[u8] = &serialized; + // try_from will fail on malleable signatures. We detect malleable signatures + // early during deserialization. + prop_assert_eq!( + Ed25519Signature::try_from(serialized_malleable), + Err(CryptoMaterialError::CanonicalRepresentationError) + ); + + // We expect from_bytes_unchecked deserialization to succeed, as dalek + // does not check for signature malleability. This method is pub(crate) + // and only used for test purposes. + let sig_unchecked = Ed25519Signature::from_bytes_unchecked(&serialized); + prop_assert!(sig_unchecked.is_ok()); + + // Update the signature by setting S = L to make it invalid. + serialized[32..].copy_from_slice(&L.to_bytes()); + let serialized_malleable_l: &[u8] = &serialized; + // try_from will fail with CanonicalRepresentationError. + prop_assert_eq!( + Ed25519Signature::try_from(serialized_malleable_l), + Err(CryptoMaterialError::CanonicalRepresentationError) + ); + }*/ + + +} + +// The 8-torsion subgroup E[8]. +// +// In the case of Curve25519, it is cyclic; the i-th element of +// the array is [i]P, where P is a point of order 8 +// generating E[8]. +// +// Thus E[8] is the points indexed by `0,2,4,6`, and +// E[2] is the points indexed by `0,4`. +// +// The following byte arrays have been ported from curve25519-dalek /backend/serial/u64/constants.rs +// and they represent the serialised version of the CompressedEdwardsY points. + +pub const EIGHT_TORSION: [[u8; 32]; 8] = [ + [ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + [ + 199, 23, 106, 112, 61, 77, 216, 79, 186, 60, 11, 118, 13, 16, 103, 15, 42, 32, 83, 250, 44, + 57, 204, 198, 78, 199, 253, 119, 146, 172, 3, 122, + ], + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, + ], + [ + 38, 232, 149, 143, 194, 178, 39, 176, 69, 195, 244, 137, 242, 239, 152, 240, 213, 223, 172, + 5, 211, 198, 51, 57, 177, 56, 2, 136, 109, 83, 252, 5, + ], + [ + 236, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, + ], + [ + 38, 232, 149, 143, 194, 178, 39, 176, 69, 195, 244, 137, 242, 239, 152, 240, 213, 223, 172, + 5, 211, 198, 51, 57, 177, 56, 2, 136, 109, 83, 252, 133, + ], + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, + ], + [ + 199, 23, 106, 112, 61, 77, 216, 79, 186, 60, 11, 118, 13, 16, 103, 15, 42, 32, 83, 250, 44, + 57, 204, 198, 78, 199, 253, 119, 146, 172, 3, 250, + ], +]; + +/// The `Scalar52` struct represents an element in +/// ℤ/ℓℤ as 5 52-bit limbs. +pub struct Scalar52(pub [u64; 5]); + +/// `L` is the order of base point, i.e. 2^252 + 27742317777372353535851937790883648493 +pub const L: Scalar52 = Scalar52([ + 0x0002_631A_5CF5_D3ED, + 0x000D_EA2F_79CD_6581, + 0x0000_0000_0014_DEF9, + 0x0000_0000_0000_0000, + 0x0000_1000_0000_0000, +]); + +impl Scalar52 { + /// Return the zero scalar + fn zero() -> Scalar52 { + Scalar52([0, 0, 0, 0, 0]) + } + + /// Unpack a 32 byte / 256 bit scalar into 5 52-bit limbs. + pub fn from_bytes(bytes: &[u8; 32]) -> Scalar52 { + let mut words = [0u64; 4]; + for i in 0..4 { + for j in 0..8 { + words[i] |= u64::from(bytes[(i * 8) + j]) << (j * 8) as u64; + } + } + + let mask = (1u64 << 52) - 1; + let top_mask = (1u64 << 48) - 1; + let mut s = Scalar52::zero(); + + s[0] = words[0] & mask; + s[1] = ((words[0] >> 52) | (words[1] << 12)) & mask; + s[2] = ((words[1] >> 40) | (words[2] << 24)) & mask; + s[3] = ((words[2] >> 28) | (words[3] << 36)) & mask; + s[4] = (words[3] >> 16) & top_mask; + + s + } + + /// Pack the limbs of this `Scalar52` into 32 bytes + pub fn to_bytes(&self) -> [u8; 32] { + let mut s = [0u8; 32]; + + s[0] = self.0[0] as u8; + s[1] = (self.0[0] >> 8) as u8; + s[2] = (self.0[0] >> 16) as u8; + s[3] = (self.0[0] >> 24) as u8; + s[4] = (self.0[0] >> 32) as u8; + s[5] = (self.0[0] >> 40) as u8; + s[6] = ((self.0[0] >> 48) | (self.0[1] << 4)) as u8; + s[7] = (self.0[1] >> 4) as u8; + s[8] = (self.0[1] >> 12) as u8; + s[9] = (self.0[1] >> 20) as u8; + s[10] = (self.0[1] >> 28) as u8; + s[11] = (self.0[1] >> 36) as u8; + s[12] = (self.0[1] >> 44) as u8; + s[13] = self.0[2] as u8; + s[14] = (self.0[2] >> 8) as u8; + s[15] = (self.0[2] >> 16) as u8; + s[16] = (self.0[2] >> 24) as u8; + s[17] = (self.0[2] >> 32) as u8; + s[18] = (self.0[2] >> 40) as u8; + s[19] = ((self.0[2] >> 48) | (self.0[3] << 4)) as u8; + s[20] = (self.0[3] >> 4) as u8; + s[21] = (self.0[3] >> 12) as u8; + s[22] = (self.0[3] >> 20) as u8; + s[23] = (self.0[3] >> 28) as u8; + s[24] = (self.0[3] >> 36) as u8; + s[25] = (self.0[3] >> 44) as u8; + s[26] = self.0[4] as u8; + s[27] = (self.0[4] >> 8) as u8; + s[28] = (self.0[4] >> 16) as u8; + s[29] = (self.0[4] >> 24) as u8; + s[30] = (self.0[4] >> 32) as u8; + s[31] = (self.0[4] >> 40) as u8; + + s + } + + /// Compute `a + b` (without mod ℓ) + pub fn add(a: &Scalar52, b: &Scalar52) -> Scalar52 { + let mut sum = Scalar52::zero(); + let mask = (1u64 << 52) - 1; + + // a + b + let mut carry: u64 = 0; + for i in 0..5 { + carry = a[i] + b[i] + (carry >> 52); + sum[i] = carry & mask; + } + + sum + } +} + +impl Index for Scalar52 { + type Output = u64; + + fn index(&self, _index: usize) -> &u64 { + &(self.0[_index]) + } +} + +impl IndexMut for Scalar52 { + fn index_mut(&mut self, _index: usize) -> &mut u64 { + &mut (self.0[_index]) + } +} From a6c0216984e9da2044963aad63ae02111d0eee2c Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 8 Aug 2023 14:44:29 -0500 Subject: [PATCH 11/37] tests pass --- crates/aptos-crypto/src/p256/p256_sigs.rs | 8 +++----- crates/aptos-crypto/src/unit_tests/p256_test.rs | 8 -------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index 9921d648693a9..99838df4328ec 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -33,9 +33,6 @@ impl P256Signature { /// Serialize an P256Signature. pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { // The RustCrypto P256 `to_bytes` call here should never return a byte array of the wrong length - let bytes = self.0.to_bytes(); - println!("len is {}", bytes.len()); - println!("bytes are {:?}", bytes); self.0.to_bytes().try_into().unwrap() } @@ -43,7 +40,7 @@ impl P256Signature { pub(crate) fn from_bytes( bytes: &[u8], ) -> std::result::Result { - P256Signature::check_s_malleability(bytes)?; + //P256Signature::check_s_malleability(bytes)?; match p256::ecdsa::Signature::try_from(bytes) { Ok(p256_signature) => Ok(P256Signature(p256_signature)), Err(_) => Err(CryptoMaterialError::DeserializationError), @@ -79,7 +76,7 @@ impl P256Signature { /// Check if S < ORDER_HALF to capture invalid signatures. fn check_s_lt_order_half(s: &[u8]) -> bool { - for i in (0..32).rev() { + for i in 0..32 { match s[i].cmp(&ORDER_HALF[i]) { Ordering::Less => return true, Ordering::Greater => return false, @@ -105,6 +102,7 @@ impl P256Signature { let one = NonZeroScalar::from_uint(::Uint::ONE).unwrap(); // Dereferencing a NonZeroScalar makes it a Scalar, which implements subtraction let new_s = *order_minus_one - *s + *one; + //let new_s = s.invert().unwrap(); // TODO: Make sure this never panics let new_s_nonzero = NonZeroScalar::new(new_s).unwrap(); // TODO: Make sure this never panics diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index f06319e4f243a..af4d1ccd2f53a 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -5,13 +5,6 @@ use crate as aptos_crypto; use crate::{ - ed25519::{ - Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, ED25519_PRIVATE_KEY_LENGTH, - ED25519_PUBLIC_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, - }, - p256::{ - P256PrivateKey, P256PublicKey, P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH, P256_SIGNATURE_LENGTH, - }, test_utils::{ random_serializable_struct, small_order_pk_with_adversarial_message, uniform_keypair_strategy, @@ -110,7 +103,6 @@ proptest! { ) { let signature = keypair.private_key.sign(&message).unwrap(); let serialized: &[u8] = &(signature.to_bytes()); - println!("serialized is {:?}", serialized); prop_assert_eq!(P256_SIGNATURE_LENGTH, serialized.len()); let deserialized = P256Signature::try_from(serialized).unwrap(); prop_assert!(deserialized.verify(&message, &keypair.public_key).is_ok()); From d34e8c3656631488b482f85a92c32b59670770de Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 9 Aug 2023 08:33:13 -0500 Subject: [PATCH 12/37] edits --- crates/aptos-crypto/src/p256/mod.rs | 2 +- .../aptos-crypto/src/unit_tests/p256_test.rs | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs index 0ca40f033fbfe..df76751965b76 100644 --- a/crates/aptos-crypto/src/p256/mod.rs +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -47,7 +47,7 @@ const ORDER_MINUS_ONE: [u8; 32] = [ /// qq = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 /// q_half = (qq-1)/2 // TODO: Make sure qq-1 is the correct thing to do -const ORDER_HALF: [u8; 32] = [ +pub const ORDER_HALF: [u8; 32] = [ 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x73, 0x7D, 0x56, 0xD3, 0x8B, 0xCF, 0x42, 0x79, 0xDC, 0xE5, 0x61, 0x7E, 0x31, 0x92, 0xA8, ]; diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index af4d1ccd2f53a..460d788de02c4 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -5,6 +5,7 @@ use crate as aptos_crypto; use crate::{ + p256::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, test_utils::{ random_serializable_struct, small_order_pk_with_adversarial_message, uniform_keypair_strategy, @@ -12,6 +13,7 @@ use crate::{ traits::*, x25519, }; +use signature::Verifier; use p256::EncodedPoint; use aptos_crypto_derive::{BCSCryptoHash, CryptoHasher}; use core::{ @@ -135,7 +137,7 @@ proptest! { } - /*// Check for canonical S. + // Check for canonical S. #[test] fn test_signature_malleability( message in random_serializable_struct(), @@ -156,7 +158,7 @@ proptest! { let s = Scalar52::from_bytes(&s_bytes); // adding L (order of the base point) so that S + L > L - let malleable_s = Scalar52::add(&s, &ORDER_HALF); + let malleable_s = Scalar52::add(&s, &Scalar52::from_bytes(&ORDER_HALF)); let malleable_s_bytes = malleable_s.to_bytes(); // Update the signature (the S part). serialized[32..].copy_from_slice(&malleable_s_bytes); @@ -165,12 +167,12 @@ proptest! { // Check that malleable signatures will pass verification and deserialization in dalek. // Construct the corresponding dalek public key. - let _dalek_public_key = ed25519_dalek::PublicKey::from_bytes( + let _dalek_public_key = p256::ecdsa::VerifyingKey::from_sec1_bytes( &keypair.public_key.to_bytes() ).unwrap(); // Construct the corresponding dalek Signature. This signature is malleable. - let dalek_sig = ed25519_dalek::Signature::from_bytes(&serialized); + let dalek_sig = p256::ecdsa::Signature::try_from(&serialized[..]); // ed25519_dalek will (post 2.0) deserialize the malleable // signature. It does not detect it. @@ -179,26 +181,25 @@ proptest! { let msg_bytes = bcs::to_bytes(&message); prop_assert!(msg_bytes.is_ok()); + let dalek_sig = dalek_sig.unwrap(); // ed25519_dalek verify will NOT accept the mauled signature - prop_assert!(_dalek_public_key.verify(msg_bytes.as_ref().unwrap(), dalek_sig.as_ref().unwrap()).is_err()); - // ...and ed25519_dalek verify_strict will NOT accept it either - prop_assert!(_dalek_public_key.verify_strict(msg_bytes.as_ref().unwrap(), dalek_sig.as_ref().unwrap()).is_err()); + prop_assert!(_dalek_public_key.verify(msg_bytes.as_ref().unwrap(), &dalek_sig).is_err()); // ...therefore, neither will our own Ed25519Signature::verify_arbitrary_msg - let sig = Ed25519Signature::from_bytes_unchecked(&serialized).unwrap(); + let sig = P256Signature::from_bytes(&serialized).unwrap(); prop_assert!(sig.verify(&message, &keypair.public_key).is_err()); let serialized_malleable: &[u8] = &serialized; // try_from will fail on malleable signatures. We detect malleable signatures // early during deserialization. prop_assert_eq!( - Ed25519Signature::try_from(serialized_malleable), + P256Signature::try_from(serialized_malleable), Err(CryptoMaterialError::CanonicalRepresentationError) ); // We expect from_bytes_unchecked deserialization to succeed, as dalek // does not check for signature malleability. This method is pub(crate) // and only used for test purposes. - let sig_unchecked = Ed25519Signature::from_bytes_unchecked(&serialized); + let sig_unchecked = P256Signature::from_bytes(&serialized); prop_assert!(sig_unchecked.is_ok()); // Update the signature by setting S = L to make it invalid. @@ -206,10 +207,10 @@ proptest! { let serialized_malleable_l: &[u8] = &serialized; // try_from will fail with CanonicalRepresentationError. prop_assert_eq!( - Ed25519Signature::try_from(serialized_malleable_l), + P256Signature::try_from(serialized_malleable_l), Err(CryptoMaterialError::CanonicalRepresentationError) ); - }*/ + } } From 87f27f210bd0336de8f13b3214af5e6873b39124 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 9 Aug 2023 13:12:23 -0500 Subject: [PATCH 13/37] tests pass --- crates/aptos-crypto/src/p256/p256_sigs.rs | 1 + .../aptos-crypto/src/unit_tests/p256_test.rs | 183 +----------------- 2 files changed, 8 insertions(+), 176 deletions(-) diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index 99838df4328ec..f820acb0458b9 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -168,6 +168,7 @@ impl TryFrom<&[u8]> for P256Signature { type Error = CryptoMaterialError; fn try_from(bytes: &[u8]) -> std::result::Result { + P256Signature::check_s_malleability(bytes)?; P256Signature::from_bytes(bytes) } } diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index 460d788de02c4..cfced385b9194 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -7,29 +7,17 @@ use crate as aptos_crypto; use crate::{ p256::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, test_utils::{ - random_serializable_struct, small_order_pk_with_adversarial_message, + random_serializable_struct, uniform_keypair_strategy, }, traits::*, - x25519, }; use signature::Verifier; -use p256::EncodedPoint; +use p256::{EncodedPoint, NonZeroScalar}; use aptos_crypto_derive::{BCSCryptoHash, CryptoHasher}; -use core::{ - convert::TryFrom, - ops::{Add, Index, IndexMut, Mul, Neg}, -}; -use curve25519_dalek::{ - constants::ED25519_BASEPOINT_POINT, - edwards::{CompressedEdwardsY, EdwardsPoint}, - scalar::Scalar, -}; -use digest::Digest; -use ed25519_dalek::ed25519::signature::Verifier as _; +use core::convert::TryFrom; use proptest::{collection::vec, prelude::*}; use serde::{Deserialize, Serialize}; -use sha2::Sha512; #[derive(CryptoHasher, BCSCryptoHash, Serialize, Deserialize)] struct CryptoHashable(pub usize); @@ -155,10 +143,11 @@ proptest! { s_bytes.copy_from_slice(&serialized[32..]); // ed25519-dalek signing ensures a canonical S value. - let s = Scalar52::from_bytes(&s_bytes); + let s = NonZeroScalar::try_from(&s_bytes[..]).unwrap(); + let order_half = NonZeroScalar::try_from(&ORDER_HALF[..]).unwrap(); // adding L (order of the base point) so that S + L > L - let malleable_s = Scalar52::add(&s, &Scalar52::from_bytes(&ORDER_HALF)); + let malleable_s = NonZeroScalar::new(*s + *order_half).unwrap(); let malleable_s_bytes = malleable_s.to_bytes(); // Update the signature (the S part). serialized[32..].copy_from_slice(&malleable_s_bytes); @@ -203,7 +192,7 @@ proptest! { prop_assert!(sig_unchecked.is_ok()); // Update the signature by setting S = L to make it invalid. - serialized[32..].copy_from_slice(&L.to_bytes()); + serialized[32..].copy_from_slice(&ORDER_HALF); let serialized_malleable_l: &[u8] = &serialized; // try_from will fail with CanonicalRepresentationError. prop_assert_eq!( @@ -214,161 +203,3 @@ proptest! { } - -// The 8-torsion subgroup E[8]. -// -// In the case of Curve25519, it is cyclic; the i-th element of -// the array is [i]P, where P is a point of order 8 -// generating E[8]. -// -// Thus E[8] is the points indexed by `0,2,4,6`, and -// E[2] is the points indexed by `0,4`. -// -// The following byte arrays have been ported from curve25519-dalek /backend/serial/u64/constants.rs -// and they represent the serialised version of the CompressedEdwardsY points. - -pub const EIGHT_TORSION: [[u8; 32]; 8] = [ - [ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, - ], - [ - 199, 23, 106, 112, 61, 77, 216, 79, 186, 60, 11, 118, 13, 16, 103, 15, 42, 32, 83, 250, 44, - 57, 204, 198, 78, 199, 253, 119, 146, 172, 3, 122, - ], - [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, - ], - [ - 38, 232, 149, 143, 194, 178, 39, 176, 69, 195, 244, 137, 242, 239, 152, 240, 213, 223, 172, - 5, 211, 198, 51, 57, 177, 56, 2, 136, 109, 83, 252, 5, - ], - [ - 236, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, - ], - [ - 38, 232, 149, 143, 194, 178, 39, 176, 69, 195, 244, 137, 242, 239, 152, 240, 213, 223, 172, - 5, 211, 198, 51, 57, 177, 56, 2, 136, 109, 83, 252, 133, - ], - [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, - ], - [ - 199, 23, 106, 112, 61, 77, 216, 79, 186, 60, 11, 118, 13, 16, 103, 15, 42, 32, 83, 250, 44, - 57, 204, 198, 78, 199, 253, 119, 146, 172, 3, 250, - ], -]; - -/// The `Scalar52` struct represents an element in -/// ℤ/ℓℤ as 5 52-bit limbs. -pub struct Scalar52(pub [u64; 5]); - -/// `L` is the order of base point, i.e. 2^252 + 27742317777372353535851937790883648493 -pub const L: Scalar52 = Scalar52([ - 0x0002_631A_5CF5_D3ED, - 0x000D_EA2F_79CD_6581, - 0x0000_0000_0014_DEF9, - 0x0000_0000_0000_0000, - 0x0000_1000_0000_0000, -]); - -impl Scalar52 { - /// Return the zero scalar - fn zero() -> Scalar52 { - Scalar52([0, 0, 0, 0, 0]) - } - - /// Unpack a 32 byte / 256 bit scalar into 5 52-bit limbs. - pub fn from_bytes(bytes: &[u8; 32]) -> Scalar52 { - let mut words = [0u64; 4]; - for i in 0..4 { - for j in 0..8 { - words[i] |= u64::from(bytes[(i * 8) + j]) << (j * 8) as u64; - } - } - - let mask = (1u64 << 52) - 1; - let top_mask = (1u64 << 48) - 1; - let mut s = Scalar52::zero(); - - s[0] = words[0] & mask; - s[1] = ((words[0] >> 52) | (words[1] << 12)) & mask; - s[2] = ((words[1] >> 40) | (words[2] << 24)) & mask; - s[3] = ((words[2] >> 28) | (words[3] << 36)) & mask; - s[4] = (words[3] >> 16) & top_mask; - - s - } - - /// Pack the limbs of this `Scalar52` into 32 bytes - pub fn to_bytes(&self) -> [u8; 32] { - let mut s = [0u8; 32]; - - s[0] = self.0[0] as u8; - s[1] = (self.0[0] >> 8) as u8; - s[2] = (self.0[0] >> 16) as u8; - s[3] = (self.0[0] >> 24) as u8; - s[4] = (self.0[0] >> 32) as u8; - s[5] = (self.0[0] >> 40) as u8; - s[6] = ((self.0[0] >> 48) | (self.0[1] << 4)) as u8; - s[7] = (self.0[1] >> 4) as u8; - s[8] = (self.0[1] >> 12) as u8; - s[9] = (self.0[1] >> 20) as u8; - s[10] = (self.0[1] >> 28) as u8; - s[11] = (self.0[1] >> 36) as u8; - s[12] = (self.0[1] >> 44) as u8; - s[13] = self.0[2] as u8; - s[14] = (self.0[2] >> 8) as u8; - s[15] = (self.0[2] >> 16) as u8; - s[16] = (self.0[2] >> 24) as u8; - s[17] = (self.0[2] >> 32) as u8; - s[18] = (self.0[2] >> 40) as u8; - s[19] = ((self.0[2] >> 48) | (self.0[3] << 4)) as u8; - s[20] = (self.0[3] >> 4) as u8; - s[21] = (self.0[3] >> 12) as u8; - s[22] = (self.0[3] >> 20) as u8; - s[23] = (self.0[3] >> 28) as u8; - s[24] = (self.0[3] >> 36) as u8; - s[25] = (self.0[3] >> 44) as u8; - s[26] = self.0[4] as u8; - s[27] = (self.0[4] >> 8) as u8; - s[28] = (self.0[4] >> 16) as u8; - s[29] = (self.0[4] >> 24) as u8; - s[30] = (self.0[4] >> 32) as u8; - s[31] = (self.0[4] >> 40) as u8; - - s - } - - /// Compute `a + b` (without mod ℓ) - pub fn add(a: &Scalar52, b: &Scalar52) -> Scalar52 { - let mut sum = Scalar52::zero(); - let mask = (1u64 << 52) - 1; - - // a + b - let mut carry: u64 = 0; - for i in 0..5 { - carry = a[i] + b[i] + (carry >> 52); - sum[i] = carry & mask; - } - - sum - } -} - -impl Index for Scalar52 { - type Output = u64; - - fn index(&self, _index: usize) -> &u64 { - &(self.0[_index]) - } -} - -impl IndexMut for Scalar52 { - fn index_mut(&mut self, _index: usize) -> &mut u64 { - &mut (self.0[_index]) - } -} From 5dbc2c4d080c1d9e94d834ba4ae81f57def998c5 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 9 Aug 2023 14:44:06 -0500 Subject: [PATCH 14/37] edits --- crates/aptos-crypto/src/p256/mod.rs | 4 +-- crates/aptos-crypto/src/p256/p256_sigs.rs | 3 -- .../aptos-crypto/src/unit_tests/p256_test.rs | 31 +++++++++---------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/p256/mod.rs index df76751965b76..0caae73fae0da 100644 --- a/crates/aptos-crypto/src/p256/mod.rs +++ b/crates/aptos-crypto/src/p256/mod.rs @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 //! This module provides an API for the ECDSA signature scheme over the NIST-P256 curve as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). //! -//! Signature verification also checks and rejects non-canonical signatures. +//! Signature verification also checks and rejects non-canonical signatures. Signing is guaranteed +//! to output the canonical signature which passes this module's verification. //! //! # Examples //! @@ -46,7 +47,6 @@ const ORDER_MINUS_ONE: [u8; 32] = [ /// # Curve order /// qq = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 /// q_half = (qq-1)/2 -// TODO: Make sure qq-1 is the correct thing to do pub const ORDER_HALF: [u8; 32] = [ 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x73, 0x7D, 0x56, 0xD3, 0x8B, 0xCF, 0x42, 0x79, 0xDC, 0xE5, 0x61, 0x7E, 0x31, 0x92, 0xA8, ]; diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index f820acb0458b9..b76fccbe3378a 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -102,10 +102,7 @@ impl P256Signature { let one = NonZeroScalar::from_uint(::Uint::ONE).unwrap(); // Dereferencing a NonZeroScalar makes it a Scalar, which implements subtraction let new_s = *order_minus_one - *s + *one; - //let new_s = s.invert().unwrap(); - // TODO: Make sure this never panics let new_s_nonzero = NonZeroScalar::new(new_s).unwrap(); - // TODO: Make sure this never panics let new_sig = p256::ecdsa::Signature::from_scalars(&r, &new_s_nonzero).unwrap(); P256Signature(new_sig) } diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index cfced385b9194..9bff1b280255a 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -142,11 +142,11 @@ proptest! { let mut s_bytes: [u8; 32] = [0u8; 32]; s_bytes.copy_from_slice(&serialized[32..]); - // ed25519-dalek signing ensures a canonical S value. + // NIST-P256 signing ensures a canonical S value. let s = NonZeroScalar::try_from(&s_bytes[..]).unwrap(); let order_half = NonZeroScalar::try_from(&ORDER_HALF[..]).unwrap(); - // adding L (order of the base point) so that S + L > L + // adding ORDER_HALF (half the order of the base point) so that S + ORDER_HALF > ORDER_HALF let malleable_s = NonZeroScalar::new(*s + *order_half).unwrap(); let malleable_s_bytes = malleable_s.to_bytes(); // Update the signature (the S part). @@ -154,26 +154,27 @@ proptest! { prop_assert_ne!(serialized_old, serialized); - // Check that malleable signatures will pass verification and deserialization in dalek. - // Construct the corresponding dalek public key. - let _dalek_public_key = p256::ecdsa::VerifyingKey::from_sec1_bytes( + // Check that malleable signatures will pass verification and deserialization in the RustCrypto + // p256 crate. + // Construct the corresponding RustCrypto p256 public key. + let rustcrypto_public_key = p256::ecdsa::VerifyingKey::from_sec1_bytes( &keypair.public_key.to_bytes() ).unwrap(); - // Construct the corresponding dalek Signature. This signature is malleable. - let dalek_sig = p256::ecdsa::Signature::try_from(&serialized[..]); + // Construct the corresponding RustCrypto p256 Signature. This signature is malleable. + let rustcrypto_sig = p256::ecdsa::Signature::try_from(&serialized[..]); - // ed25519_dalek will (post 2.0) deserialize the malleable + // RustCrypto p256 will deserialize the malleable // signature. It does not detect it. - prop_assert!(dalek_sig.is_ok()); + prop_assert!(rustcrypto_sig.is_ok()); let msg_bytes = bcs::to_bytes(&message); prop_assert!(msg_bytes.is_ok()); - let dalek_sig = dalek_sig.unwrap(); - // ed25519_dalek verify will NOT accept the mauled signature - prop_assert!(_dalek_public_key.verify(msg_bytes.as_ref().unwrap(), &dalek_sig).is_err()); - // ...therefore, neither will our own Ed25519Signature::verify_arbitrary_msg + let rustcrypto_sig = rustcrypto_sig.unwrap(); + // RustCrypto p256 verify will NOT accept the mauled signature + prop_assert!(rustcrypto_public_key.verify(msg_bytes.as_ref().unwrap(), &rustcrypto_sig).is_err()); + // ...therefore, neither will our own P256Signature::verify_arbitrary_msg let sig = P256Signature::from_bytes(&serialized).unwrap(); prop_assert!(sig.verify(&message, &keypair.public_key).is_err()); @@ -185,7 +186,7 @@ proptest! { Err(CryptoMaterialError::CanonicalRepresentationError) ); - // We expect from_bytes_unchecked deserialization to succeed, as dalek + // We expect from_bytes_unchecked deserialization to succeed, as RustCrypto p256 // does not check for signature malleability. This method is pub(crate) // and only used for test purposes. let sig_unchecked = P256Signature::from_bytes(&serialized); @@ -200,6 +201,4 @@ proptest! { Err(CryptoMaterialError::CanonicalRepresentationError) ); } - - } From ebf8bec1c0eb0d9c4d8dfd8a7ce5db8658e0a79f Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 10 Aug 2023 09:35:31 -0500 Subject: [PATCH 15/37] edits --- crates/aptos-crypto/src/p256/p256_keys.rs | 11 +++-------- crates/aptos-crypto/src/p256/p256_sigs.rs | 9 ++++----- crates/aptos-crypto/src/unit_tests/p256_test.rs | 6 +++--- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index 65629b86f0a88..8ae38cea10f07 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -79,10 +79,8 @@ impl P256PublicKey { (*self.0.to_sec1_bytes()).try_into().unwrap() } - /// Deserialize a P256PublicKey without any validation checks apart from expected key size - /// and valid curve point, although not necessarily in the prime-order subgroup. - /// - /// This function does NOT check the public key for membership in a small subgroup. + /// Deserialize a P256PublicKey, checking expected key size + /// and that it is a valid curve point. pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { @@ -230,10 +228,7 @@ impl fmt::Debug for P256PublicKey { impl TryFrom<&[u8]> for P256PublicKey { type Error = CryptoMaterialError; - /// Deserialize a P256PublicKey. This method will NOT check for key validity, which means - /// the returned public key could be in a small subgroup. Nonetheless, our signature - /// verification implicitly checks if the public key lies in a small subgroup, so canonical - /// uses of this library will not be susceptible to small subgroup attacks. + /// Deserialize a P256PublicKey. fn try_from(bytes: &[u8]) -> std::result::Result { P256PublicKey::from_bytes_unchecked(bytes) } diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index b76fccbe3378a..f583217cca0ad 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -36,11 +36,10 @@ impl P256Signature { self.0.to_bytes().try_into().unwrap() } - /// Deserialize an P256Signature, checking for malleability - pub(crate) fn from_bytes( + /// Deserialize an P256Signature, without checking for malleability + pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { - //P256Signature::check_s_malleability(bytes)?; match p256::ecdsa::Signature::try_from(bytes) { Ok(p256_signature) => Ok(P256Signature(p256_signature)), Err(_) => Err(CryptoMaterialError::DeserializationError), @@ -50,7 +49,7 @@ impl P256Signature { /// return an all-zero signature (for test only) #[cfg(any(test, feature = "fuzzing"))] pub fn dummy_signature() -> Self { - Self::from_bytes(&[0u8; Self::LENGTH]).unwrap() + Self::from_bytes_unchecked(&[0u8; Self::LENGTH]).unwrap() } /// Check for correct size and third-party based signature malleability issues. @@ -166,7 +165,7 @@ impl TryFrom<&[u8]> for P256Signature { fn try_from(bytes: &[u8]) -> std::result::Result { P256Signature::check_s_malleability(bytes)?; - P256Signature::from_bytes(bytes) + P256Signature::from_bytes_unchecked(bytes) } } diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index 9bff1b280255a..f196e7db74577 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -174,8 +174,8 @@ proptest! { let rustcrypto_sig = rustcrypto_sig.unwrap(); // RustCrypto p256 verify will NOT accept the mauled signature prop_assert!(rustcrypto_public_key.verify(msg_bytes.as_ref().unwrap(), &rustcrypto_sig).is_err()); - // ...therefore, neither will our own P256Signature::verify_arbitrary_msg - let sig = P256Signature::from_bytes(&serialized).unwrap(); + // ...therefore, neither will our own P256Signature::verify + let sig = P256Signature::from_bytes_unchecked(&serialized).unwrap(); prop_assert!(sig.verify(&message, &keypair.public_key).is_err()); let serialized_malleable: &[u8] = &serialized; @@ -189,7 +189,7 @@ proptest! { // We expect from_bytes_unchecked deserialization to succeed, as RustCrypto p256 // does not check for signature malleability. This method is pub(crate) // and only used for test purposes. - let sig_unchecked = P256Signature::from_bytes(&serialized); + let sig_unchecked = P256Signature::from_bytes_unchecked(&serialized); prop_assert!(sig_unchecked.is_ok()); // Update the signature by setting S = L to make it invalid. From b760539de312b492181701909af1e3c1a735a9db Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 10 Aug 2023 17:08:01 -0500 Subject: [PATCH 16/37] smaller Cargo.lock --- Cargo.lock | 3185 ++++++++++++++++++++++++++-------------------------- 1 file changed, 1564 insertions(+), 1621 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed37b8e72d275..062aeafab558b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" [[package]] name = "addr2line" -version = "0.20.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ "gimli", ] @@ -25,30 +25,30 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.5.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "crypto-common", "generic-array 0.14.7", ] [[package]] name = "aes" -version = "0.8.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", "cipher", "cpufeatures", + "opaque-debug 0.3.0", ] [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ "aead", "aes", @@ -75,7 +75,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.7", "once_cell", "version_check", ] @@ -87,16 +87,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", - "getrandom 0.2.10", + "getrandom 0.2.7", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -107,17 +107,11 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" dependencies = [ "libc", ] @@ -160,9 +154,9 @@ checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" dependencies = [ "utf8parse", ] @@ -201,7 +195,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -240,10 +234,10 @@ dependencies = [ "aptos-vm", "aptos-vm-genesis", "async-trait", - "base64 0.13.1", + "base64 0.13.0", "bcs 0.1.4", "chrono", - "clap 4.3.21", + "clap 4.3.5", "clap_complete", "codespan-reporting", "dirs", @@ -272,7 +266,7 @@ dependencies = [ "regex", "reqwest", "self_update", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "shadow-rs", @@ -280,8 +274,8 @@ dependencies = [ "termcolor", "thiserror", "tokio", - "tokio-util 0.7.8", - "toml 0.7.6", + "tokio-util 0.7.3", + "toml 0.7.4", "walkdir", ] @@ -354,7 +348,7 @@ dependencies = [ "async-trait", "bcs 0.1.4", "bytes", - "fail 0.5.1", + "fail 0.5.0", "futures", "hex", "hyper", @@ -372,7 +366,7 @@ dependencies = [ "rand 0.7.3", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", "url", @@ -413,7 +407,7 @@ dependencies = [ "rand 0.7.3", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", "url", @@ -444,7 +438,7 @@ dependencies = [ "poem", "poem-openapi", "poem-openapi-derive", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -473,7 +467,7 @@ dependencies = [ "async-trait", "bcs 0.1.4", "bytes", - "clap 4.3.21", + "clap 4.3.5", "csv", "futures", "itertools", @@ -486,13 +480,13 @@ dependencies = [ "rand 0.7.3", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tokio", "tokio-io-timeout", "tokio-stream", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "warp", ] @@ -515,7 +509,7 @@ dependencies = [ "hyper", "once_cell", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "tokio", "warp", ] @@ -527,7 +521,7 @@ dependencies = [ "bcs 0.1.4", "proptest", "proptest-derive", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", ] @@ -573,7 +567,7 @@ dependencies = [ "aptos-metrics-core", "aptos-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "dashmap", "itertools", "move-core-types", @@ -604,7 +598,7 @@ dependencies = [ "aptos-framework", "aptos-types", "bcs 0.1.4", - "include_dir 0.7.3", + "include_dir 0.7.2", "move-core-types", "once_cell", "proptest", @@ -629,7 +623,7 @@ name = "aptos-cli-common" version = "1.0.0" dependencies = [ "anstyle", - "clap 4.3.21", + "clap 4.3.5", "clap_complete", ] @@ -644,7 +638,7 @@ dependencies = [ "bcs 0.1.4", "lz4", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -670,7 +664,7 @@ dependencies = [ "num_cpus", "poem-openapi", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "serde_merge", "serde_yaml 0.8.26", "thiserror", @@ -724,7 +718,7 @@ dependencies = [ "chrono", "claims", "dashmap", - "fail 0.5.1", + "fail 0.5.0", "futures", "futures-channel", "itertools", @@ -732,12 +726,12 @@ dependencies = [ "mirai-annotations", "move-core-types", "num-derive", - "num-traits 0.2.16", + "num-traits 0.2.15", "once_cell", "proptest", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", "tempfile", @@ -758,7 +752,7 @@ dependencies = [ "claims", "futures", "move-core-types", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", ] @@ -782,7 +776,7 @@ dependencies = [ "proptest", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", ] @@ -794,8 +788,8 @@ dependencies = [ "aptos-logger", "backtrace", "move-core-types", - "serde 1.0.183", - "toml 0.7.6", + "serde 1.0.149", + "toml 0.7.4", ] [[package]] @@ -835,11 +829,11 @@ dependencies = [ "rand_core 0.5.1", "ring", "sec1", - "serde 1.0.183", + "serde 1.0.149", "serde-name", "serde_bytes", "serde_json", - "sha2 0.10.7", + "sha2 0.10.6", "sha2 0.9.9", "sha3 0.9.1", "signature 2.1.0", @@ -855,9 +849,9 @@ name = "aptos-crypto-derive" version = "0.0.3" dependencies = [ "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -888,7 +882,7 @@ dependencies = [ "maplit", "mockall", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", ] @@ -915,7 +909,7 @@ dependencies = [ "futures", "once_cell", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", "tokio-stream", @@ -949,7 +943,7 @@ dependencies = [ "bcs 0.1.4", "byteorder", "claims", - "clap 4.3.21", + "clap 4.3.5", "dashmap", "itertools", "lru 0.7.8", @@ -963,7 +957,7 @@ dependencies = [ "proptest-derive", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "static_assertions", "status-line", "thiserror", @@ -983,7 +977,7 @@ dependencies = [ "aptos-types", "aptos-vm", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", ] [[package]] @@ -1013,7 +1007,7 @@ dependencies = [ "proptest", "proptest-derive", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -1034,7 +1028,7 @@ dependencies = [ "aptos-temppath", "aptos-types", "async-trait", - "clap 4.3.21", + "clap 4.3.5", "itertools", "owo-colors", "tokio", @@ -1061,7 +1055,7 @@ dependencies = [ "aptos-vm-logging", "aptos-vm-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-binary-format", "move-cli", "move-compiler", @@ -1079,9 +1073,9 @@ name = "aptos-enum-conversion-derive" version = "0.0.3" dependencies = [ "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", "trybuild", ] @@ -1108,7 +1102,7 @@ dependencies = [ "futures", "move-binary-format", "move-core-types", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -1154,7 +1148,7 @@ dependencies = [ "arr_macro", "bcs 0.1.4", "dashmap", - "fail 0.5.1", + "fail 0.5.0", "itertools", "move-core-types", "num_cpus", @@ -1162,7 +1156,7 @@ dependencies = [ "proptest", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -1193,7 +1187,7 @@ dependencies = [ "async-trait", "bcs 0.1.4", "chrono", - "clap 4.3.21", + "clap 4.3.5", "indicatif 0.15.0", "itertools", "jemallocator", @@ -1202,9 +1196,9 @@ dependencies = [ "once_cell", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "tokio", - "toml 0.7.6", + "toml 0.7.4", ] [[package]] @@ -1225,13 +1219,13 @@ dependencies = [ "aptos-types", "aptos-vm", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "crossbeam-channel", "itertools", "num_cpus", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", ] @@ -1275,7 +1269,7 @@ dependencies = [ "dashmap", "itertools", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -1294,7 +1288,7 @@ dependencies = [ "aptos-faucet-core", "aptos-logger", "aptos-sdk", - "clap 4.3.21", + "clap 4.3.5", "tokio", ] @@ -1310,7 +1304,7 @@ dependencies = [ "aptos-sdk", "async-trait", "captcha", - "clap 4.3.21", + "clap 4.3.5", "deadpool-redis", "enum_dispatch", "futures", @@ -1324,7 +1318,7 @@ dependencies = [ "rand 0.7.3", "redis", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tokio", @@ -1341,7 +1335,7 @@ dependencies = [ "once_cell", "poem", "prometheus", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -1352,7 +1346,7 @@ dependencies = [ "anyhow", "aptos-faucet-core", "aptos-logger", - "clap 4.3.21", + "clap 4.3.5", "tokio", ] @@ -1364,12 +1358,12 @@ dependencies = [ "aptos-logger", "aptos-node-checker", "aptos-sdk", - "clap 4.3.21", + "clap 4.3.5", "env_logger", "futures", "gcp-bigquery-client", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", ] @@ -1401,7 +1395,7 @@ dependencies = [ "aptos-transaction-generator-lib", "async-trait", "chrono", - "clap 4.3.21", + "clap 4.3.5", "either", "futures", "hex", @@ -1418,7 +1412,7 @@ dependencies = [ "rayon", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tempfile", @@ -1444,7 +1438,7 @@ dependencies = [ "aptos-testcases", "async-trait", "chrono", - "clap 4.3.21", + "clap 4.3.5", "futures", "jemallocator", "rand 0.7.3", @@ -1478,7 +1472,7 @@ dependencies = [ "ark-ff", "ark-serialize", "ark-std", - "base64 0.13.1", + "base64 0.13.0", "bcs 0.1.4", "better_any", "blake2-rfc", @@ -1486,13 +1480,13 @@ dependencies = [ "bulletproofs", "byteorder", "claims", - "clap 4.3.21", + "clap 4.3.5", "codespan-reporting", "curve25519-dalek-ng", "either", "flate2", "hex", - "include_dir 0.7.3", + "include_dir 0.7.2", "itertools", "libsecp256k1", "log", @@ -1511,7 +1505,7 @@ dependencies = [ "move-unit-test", "move-vm-runtime", "move-vm-types", - "num-traits 0.2.16", + "num-traits 0.2.15", "once_cell", "proptest", "proptest-derive", @@ -1519,11 +1513,11 @@ dependencies = [ "rand_core 0.5.1", "rayon", "ripemd", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", "serde_yaml 0.8.26", - "sha2 0.10.7", + "sha2 0.10.6", "sha2 0.9.9", "sha3 0.9.1", "siphasher", @@ -1566,7 +1560,7 @@ dependencies = [ "aptos-vault-client", "bcs 0.1.4", "byteorder", - "clap 4.3.21", + "clap 4.3.5", "datatest-stable", "hex", "move-binary-format", @@ -1607,7 +1601,7 @@ dependencies = [ "aptos-types", "aptos-vm-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "float-cmp", "move-binary-format", "move-bytecode-source-map", @@ -1674,7 +1668,7 @@ dependencies = [ "aptos-package-builder", "aptos-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-core-types", "move-model", "tempfile", @@ -1701,7 +1695,7 @@ dependencies = [ "aptos-vm-genesis", "bcs 0.1.4", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "serde_yaml 0.8.26", ] @@ -1710,8 +1704,8 @@ name = "aptos-github-client" version = "0.1.0" dependencies = [ "aptos-proxy", - "base64 0.13.1", - "serde 1.0.183", + "base64 0.13.0", + "serde 1.0.149", "serde_json", "thiserror", "ureq", @@ -1746,7 +1740,7 @@ dependencies = [ "bcs 0.1.4", "bigdecimal", "chrono", - "clap 4.3.21", + "clap 4.3.5", "diesel", "diesel_migrations", "field_count", @@ -1757,7 +1751,7 @@ dependencies = [ "reqwest", "reqwest-middleware", "reqwest-retry", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "sha2 0.9.9", "tokio", @@ -1778,15 +1772,15 @@ dependencies = [ "aptos-runtimes", "async-trait", "backoff", - "base64 0.13.1", - "clap 4.3.21", + "base64 0.13.0", + "clap 4.3.5", "futures", "futures-core", "once_cell", "prost", "redis", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tempfile", @@ -1807,14 +1801,14 @@ dependencies = [ "aptos-protos", "aptos-runtimes", "async-trait", - "base64 0.13.1", - "clap 4.3.21", + "base64 0.13.0", + "clap 4.3.5", "cloud-storage", "futures", "once_cell", "prost", "redis", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", "tokio-stream", @@ -1835,12 +1829,12 @@ dependencies = [ "aptos-moving-average", "aptos-runtimes", "async-trait", - "clap 4.3.21", + "clap 4.3.5", "cloud-storage", "futures-util", "once_cell", "redis", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", "tracing", @@ -1879,10 +1873,10 @@ dependencies = [ "aptos-types", "aptos-vm", "aptos-vm-validator", - "base64 0.13.1", + "base64 0.13.0", "bytes", "chrono", - "fail 0.5.1", + "fail 0.5.0", "futures", "goldenfile", "hex", @@ -1893,7 +1887,7 @@ dependencies = [ "once_cell", "rand 0.7.3", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", "tokio-stream", @@ -1920,8 +1914,8 @@ dependencies = [ "aptos-types", "async-trait", "backoff", - "base64 0.13.1", - "clap 4.3.21", + "base64 0.13.0", + "clap 4.3.5", "futures", "futures-core", "futures-util", @@ -1931,7 +1925,7 @@ dependencies = [ "redis", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tempfile", @@ -1954,11 +1948,11 @@ dependencies = [ "aptos-protos", "aptos-runtimes", "async-trait", - "base64 0.13.1", + "base64 0.13.0", "bcs 0.1.4", "bigdecimal", "chrono", - "clap 4.3.21", + "clap 4.3.5", "diesel", "diesel_migrations", "field_count", @@ -1967,7 +1961,7 @@ dependencies = [ "once_cell", "prost", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "sha2 0.9.9", "tokio", @@ -1987,18 +1981,18 @@ dependencies = [ "aptos-runtimes", "async-trait", "backtrace", - "base64 0.13.1", + "base64 0.13.0", "chrono", - "clap 4.3.21", + "clap 4.3.5", "futures", "hostname", "once_cell", "prost", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", - "toml 0.7.6", + "toml 0.7.4", "tonic 0.8.3", "tracing", "tracing-subscriber", @@ -2013,14 +2007,14 @@ dependencies = [ "aptos-runtimes", "async-trait", "backtrace", - "clap 4.3.21", + "clap 4.3.5", "futures", "prometheus", - "serde 1.0.183", + "serde 1.0.149", "serde_yaml 0.8.26", "tempfile", "tokio", - "toml 0.7.6", + "toml 0.7.4", "tracing", "tracing-subscriber", "warp", @@ -2036,8 +2030,8 @@ dependencies = [ "async-trait", "backoff", "backtrace", - "base64 0.13.1", - "clap 4.3.21", + "base64 0.13.0", + "clap 4.3.5", "cloud-storage", "futures", "futures-core", @@ -2048,11 +2042,11 @@ dependencies = [ "prost", "redis", "redis-test", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tokio", - "toml 0.7.6", + "toml 0.7.4", "tonic 0.8.3", "tracing", "tracing-subscriber", @@ -2106,13 +2100,13 @@ dependencies = [ "byteorder", "itertools", "num-derive", - "num-traits 0.2.16", + "num-traits 0.2.15", "once_cell", "proptest", "proptest-derive", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -2165,7 +2159,7 @@ dependencies = [ "proptest-derive", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -2185,9 +2179,9 @@ dependencies = [ name = "aptos-log-derive" version = "0.1.0" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -2206,7 +2200,7 @@ dependencies = [ "once_cell", "pretty_assertions", "prometheus", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "strum", "strum_macros", @@ -2256,7 +2250,7 @@ dependencies = [ "async-trait", "bcs 0.1.4", "enum_dispatch", - "fail 0.5.1", + "fail 0.5.0", "futures", "itertools", "maplit", @@ -2264,7 +2258,7 @@ dependencies = [ "proptest", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", "tokio", @@ -2281,7 +2275,7 @@ dependencies = [ "async-trait", "claims", "futures", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", ] @@ -2312,7 +2306,7 @@ dependencies = [ "aptos-gas-schedule", "aptos-types", "aptos-vm", - "clap 4.3.21", + "clap 4.3.5", "move-cli", "move-package", "move-prover", @@ -2401,9 +2395,9 @@ dependencies = [ "bytes", "futures", "pin-project", - "serde 1.0.183", + "serde 1.0.149", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "url", ] @@ -2445,13 +2439,13 @@ dependencies = [ "proptest-derive", "rand 0.7.3", "rand_core 0.5.1", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", "thiserror", "tokio", "tokio-retry", - "tokio-util 0.7.8", + "tokio-util 0.7.3", ] [[package]] @@ -2475,7 +2469,7 @@ dependencies = [ "futures", "maplit", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "tokio", ] @@ -2489,9 +2483,9 @@ dependencies = [ "aptos-logger", "aptos-network", "aptos-types", - "clap 4.3.21", + "clap 4.3.5", "futures", - "serde 1.0.183", + "serde 1.0.149", "tokio", ] @@ -2531,9 +2525,9 @@ dependencies = [ "aptos-indexer-grpc-server-framework", "async-trait", "backoff", - "base64 0.13.1", + "base64 0.13.0", "chrono", - "clap 4.3.21", + "clap 4.3.5", "crossbeam-channel", "csv", "diesel", @@ -2545,9 +2539,9 @@ dependencies = [ "image", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", - "time 0.3.25", + "time 0.3.24", "tokio", "tracing", "url", @@ -2604,15 +2598,15 @@ dependencies = [ "aptos-types", "aptos-vm", "bcs 0.1.4", - "clap 4.3.21", - "fail 0.5.1", + "clap 4.3.5", + "fail 0.5.0", "futures", "hex", "jemallocator", "maplit", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tokio", @@ -2634,7 +2628,7 @@ dependencies = [ "aptos-sdk", "aptos-transaction-emitter-lib", "async-trait", - "clap 4.3.21", + "clap 4.3.5", "const_format", "env_logger", "futures", @@ -2643,7 +2637,7 @@ dependencies = [ "poem-openapi", "prometheus-parse", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "thiserror", @@ -2681,9 +2675,9 @@ dependencies = [ name = "aptos-num-variants" version = "0.1.0" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -2694,7 +2688,7 @@ dependencies = [ "percent-encoding", "poem", "poem-openapi", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -2708,7 +2702,7 @@ dependencies = [ "aptos-mempool", "aptos-storage-interface", "aptos-types", - "clap 4.3.21", + "clap 4.3.5", ] [[package]] @@ -2747,7 +2741,7 @@ dependencies = [ "maplit", "once_cell", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", "tokio", @@ -2781,7 +2775,7 @@ dependencies = [ "mockall", "once_cell", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", ] @@ -2794,7 +2788,7 @@ dependencies = [ "aptos-types", "bcs 0.1.4", "cfg_block", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -2813,7 +2807,7 @@ version = "1.0.0" dependencies = [ "pbjson", "prost", - "serde 1.0.183", + "serde 1.0.149", "tonic 0.8.3", ] @@ -2844,7 +2838,7 @@ dependencies = [ "futures", "pin-project", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", ] [[package]] @@ -2864,7 +2858,7 @@ dependencies = [ "aptos-types", "aptos-vm-genesis", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "futures", "git2 0.16.1", "handlebars", @@ -2873,7 +2867,7 @@ dependencies = [ "move-core-types", "move-model", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "strum", @@ -2925,14 +2919,14 @@ dependencies = [ "aptos-types", "bcs 0.1.4", "bytes", - "clap 4.3.21", + "clap 4.3.5", "futures", "hex", "move-binary-format", "move-core-types", "poem-openapi", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", "tokio", @@ -2972,7 +2966,7 @@ dependencies = [ "aptos-types", "aptos-warp-webserver", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "futures", "hex", "itertools", @@ -2980,7 +2974,7 @@ dependencies = [ "once_cell", "percent-encoding", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tokio", @@ -2997,8 +2991,8 @@ dependencies = [ "aptos-logger", "aptos-rosetta", "aptos-types", - "clap 4.3.21", - "serde 1.0.183", + "clap 4.3.5", + "serde 1.0.149", "serde_json", "tokio", "url", @@ -3033,7 +3027,7 @@ dependencies = [ "proptest", "rand 0.7.3", "rusty-fork", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tempfile", "thiserror", @@ -3090,7 +3084,7 @@ dependencies = [ "once_cell", "rand 0.7.3", "rand_core 0.5.1", - "serde 1.0.183", + "serde 1.0.149", "tiny-bip39", "tokio", "url", @@ -3105,7 +3099,7 @@ dependencies = [ "aptos-framework", "aptos-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "heck 0.3.3", "move-core-types", "once_cell", @@ -3114,7 +3108,7 @@ dependencies = [ "serde-reflection", "serde_yaml 0.8.26", "tempfile", - "textwrap 0.15.2", + "textwrap 0.15.0", "which", ] @@ -3129,7 +3123,7 @@ dependencies = [ "bcs 0.1.4", "crossbeam-channel", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -3145,12 +3139,12 @@ dependencies = [ "aptos-temppath", "aptos-time-service", "aptos-vault-client", - "base64 0.13.1", + "base64 0.13.0", "bcs 0.1.4", "chrono", "enum_dispatch", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", ] @@ -3162,7 +3156,7 @@ dependencies = [ "hex", "mirai-annotations", "proptest", - "serde 1.0.183", + "serde 1.0.149", "static_assertions", "thiserror", ] @@ -3225,7 +3219,7 @@ dependencies = [ "ntest", "once_cell", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", "tokio-stream", @@ -3239,7 +3233,7 @@ dependencies = [ "aptos-crypto", "aptos-types", "bcs 0.1.4", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", ] @@ -3267,7 +3261,7 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "rayon", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -3293,7 +3287,7 @@ dependencies = [ "async-trait", "claims", "futures", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", ] @@ -3329,7 +3323,7 @@ dependencies = [ "mockall", "once_cell", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "thiserror", "tokio", ] @@ -3344,10 +3338,10 @@ dependencies = [ "aptos-types", "bcs 0.1.4", "claims", - "num-traits 0.2.16", + "num-traits 0.2.15", "proptest", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -3400,7 +3394,7 @@ dependencies = [ "reqwest", "reqwest-middleware", "reqwest-retry", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "sysinfo", "thiserror", @@ -3424,17 +3418,17 @@ dependencies = [ "aptos-metrics-core", "aptos-rest-client", "aptos-types", - "base64 0.13.1", + "base64 0.13.0", "bcs 0.1.4", "chrono", - "clap 4.3.21", + "clap 4.3.5", "debug-ignore", "flate2", "futures", "gcp-bigquery-client", "hex", "httpmock", - "jsonwebtoken 8.3.0", + "jsonwebtoken 8.1.1", "once_cell", "prometheus", "rand 0.7.3", @@ -3442,7 +3436,7 @@ dependencies = [ "reqwest", "reqwest-middleware", "reqwest-retry", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_repr", "serde_yaml 0.8.26", @@ -3521,7 +3515,7 @@ dependencies = [ "aptos-types", "aptos-vm", "aptos-vm-logging", - "clap 4.3.21", + "clap 4.3.5", "criterion", "criterion-cpu-time", "num_cpus", @@ -3539,7 +3533,7 @@ dependencies = [ "aptos-logger", "aptos-sdk", "aptos-transaction-emitter-lib", - "clap 4.3.21", + "clap 4.3.5", "futures", "rand 0.7.3", "tokio", @@ -3561,14 +3555,14 @@ dependencies = [ "aptos-sdk", "aptos-transaction-generator-lib", "async-trait", - "clap 4.3.21", + "clap 4.3.5", "futures", "itertools", "once_cell", "rand 0.7.3", "rand_core 0.5.1", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "tokio", "url", ] @@ -3583,12 +3577,12 @@ dependencies = [ "aptos-logger", "aptos-sdk", "async-trait", - "clap 4.3.21", + "clap 4.3.5", "move-binary-format", "once_cell", "rand 0.7.3", "rand_core 0.5.1", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -3608,7 +3602,7 @@ dependencies = [ "aptos-vm", "aptos-vm-genesis", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "datatest-stable", "hex", "move-binary-format", @@ -3619,7 +3613,7 @@ dependencies = [ "move-transactional-test-runner", "move-vm-runtime", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -3641,14 +3635,14 @@ dependencies = [ "move-core-types", "move-table-extension", "num-derive", - "num-traits 0.2.16", + "num-traits 0.2.15", "once_cell", "proptest", "proptest-derive", "rand 0.7.3", "rayon", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", "serde_yaml 0.8.26", @@ -3687,12 +3681,12 @@ dependencies = [ "aptos-crypto", "aptos-proptest-helpers", "aptos-types", - "base64 0.13.1", + "base64 0.13.0", "chrono", "native-tls", "once_cell", "proptest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", "ureq", @@ -3729,7 +3723,7 @@ dependencies = [ "bcs 0.1.4", "crossbeam-channel", "dashmap", - "fail 0.5.1", + "fail 0.5.0", "futures", "move-binary-format", "move-bytecode-utils", @@ -3745,7 +3739,7 @@ dependencies = [ "proptest", "rand 0.7.3", "rayon", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "smallvec", "tracing", @@ -3761,7 +3755,7 @@ dependencies = [ "aptos-language-e2e-tests", "aptos-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-binary-format", "move-bytecode-source-map", "move-core-types", @@ -3788,7 +3782,7 @@ dependencies = [ "proptest", "proptest-derive", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -3803,7 +3797,7 @@ dependencies = [ "aptos-types", "arc-swap", "once_cell", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -3821,7 +3815,7 @@ dependencies = [ "aptos-vm", "aptos-vm-genesis", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "glob", "move-binary-format", "move-core-types", @@ -3869,7 +3863,7 @@ dependencies = [ "aptos-types", "aptos-vm", "aptos-vm-genesis", - "fail 0.5.1", + "fail 0.5.0", "move-core-types", "rand 0.7.3", ] @@ -3884,7 +3878,7 @@ dependencies = [ "aptos-logger", "bcs 0.1.4", "hyper", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "warp", ] @@ -3910,7 +3904,7 @@ dependencies = [ "move-core-types", "move-vm-runtime", "move-vm-types", - "serde 1.0.183", + "serde 1.0.149", "tempfile", ] @@ -3943,9 +3937,9 @@ dependencies = [ [[package]] name = "ark-ec" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "3c60370a92f8e1a5f053cad73a862e1b99bc642333cd676fa11c0c39f80f4ac2" dependencies = [ "ark-ff", "ark-poly", @@ -3954,15 +3948,15 @@ dependencies = [ "derivative", "hashbrown 0.13.2", "itertools", - "num-traits 0.2.16", + "num-traits 0.2.15", "zeroize", ] [[package]] name = "ark-ff" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "4c2d42532524bee1da5a4f6f733eb4907301baa480829557adcff5dfaeee1d9a" dependencies = [ "ark-ff-asm", "ark-ff-macros", @@ -3972,7 +3966,7 @@ dependencies = [ "digest 0.10.7", "itertools", "num-bigint 0.4.3", - "num-traits 0.2.16", + "num-traits 0.2.15", "paste", "rustc_version", "zeroize", @@ -3980,32 +3974,32 @@ dependencies = [ [[package]] name = "ark-ff-asm" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "9d6873aaba7959593d89babed381d33e2329453368f1bf3c67e07686a1c1056f" dependencies = [ - "quote 1.0.32", - "syn 1.0.109", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "ark-ff-macros" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "f3c2e7d0f2d67cc7fc925355c74d36e7eda19073639be4a0a233d4611b8c959d" dependencies = [ "num-bigint 0.4.3", - "num-traits 0.2.16", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "num-traits 0.2.15", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "ark-poly" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "8f6ec811462cabe265cfe1b102fcfe3df79d7d2929c2425673648ee9abfd0272" dependencies = [ "ark-ff", "ark-serialize", @@ -4016,9 +4010,9 @@ dependencies = [ [[package]] name = "ark-serialize" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "e7e735959bc173ea4baf13327b19c22d452b8e9e8e8f7b7fc34e6bf0e316c33e" dependencies = [ "ark-serialize-derive", "ark-std", @@ -4028,13 +4022,13 @@ dependencies = [ [[package]] name = "ark-serialize-derive" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "fd34f0920d995d2c932f38861c416f70de89a6de9875876b012557079603e6cc" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -4043,7 +4037,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", "rand 0.8.5", ] @@ -4065,15 +4059,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c6368f9ae5c6ec403ca910327ae0c9437b0a85255b6950c90d497e6177f6e5e" dependencies = [ "proc-macro-hack", - "quote 1.0.32", - "syn 1.0.109", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" @@ -4092,9 +4086,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ascii-canvas" @@ -4111,7 +4105,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -4132,9 +4126,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.9.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ "concurrent-queue", "event-listener", @@ -4143,23 +4137,23 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.5.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" dependencies = [ - "async-lock", "async-task", "concurrent-queue", - "fastrand 1.9.0", + "fastrand", "futures-lite", + "once_cell", "slab", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" dependencies = [ "async-channel", "async-executor", @@ -4167,34 +4161,35 @@ dependencies = [ "async-lock", "blocking", "futures-lite", + "num_cpus", "once_cell", ] [[package]] name = "async-io" -version = "1.13.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +checksum = "0ab006897723d9352f63e2b13047177c3982d8d79709d713ce7747a8f19fd1b0" dependencies = [ - "async-lock", "autocfg", - "cfg-if", "concurrent-queue", "futures-lite", + "libc", "log", + "once_cell", "parking", "polling", - "rustix 0.37.23", "slab", "socket2", "waker-fn", + "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" dependencies = [ "event-listener", ] @@ -4210,20 +4205,20 @@ dependencies = [ [[package]] name = "async-process" -version = "1.7.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" dependencies = [ "async-io", - "async-lock", "autocfg", "blocking", "cfg-if", "event-listener", "futures-lite", - "rustix 0.37.23", + "libc", + "once_cell", "signal-hook", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] @@ -4255,48 +4250,47 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "async-task" -version = "4.4.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" [[package]] name = "atty" @@ -4316,9 +4310,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -4329,12 +4323,12 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.5.17" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" +checksum = "c9e3356844c4d6a6d6467b8da2cffb4a2820be256f50a3a386c9d152bab31043" dependencies = [ "async-trait", - "axum-core 0.2.9", + "axum-core 0.2.8", "bitflags 1.3.2", "bytes", "futures-util", @@ -4347,22 +4341,22 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", "tower", - "tower-http 0.3.5", + "tower-http 0.3.4", "tower-layer", "tower-service", ] [[package]] name = "axum" -version = "0.6.20" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" dependencies = [ "async-trait", "axum-core 0.3.4", @@ -4373,13 +4367,13 @@ dependencies = [ "http-body", "hyper", "itoa", - "matchit 0.7.2", + "matchit 0.7.0", "memchr", "mime", "percent-encoding", "pin-project-lite", "rustversion", - "serde 1.0.183", + "serde 1.0.149", "sync_wrapper", "tower", "tower-layer", @@ -4388,9 +4382,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" +checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b" dependencies = [ "async-trait", "bytes", @@ -4423,7 +4417,7 @@ dependencies = [ name = "axum-test" version = "0.1.0" dependencies = [ - "axum 0.5.17", + "axum 0.5.16", "tokio", ] @@ -4434,7 +4428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.10", + "getrandom 0.2.7", "instant", "pin-project-lite", "rand 0.8.5", @@ -4443,15 +4437,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.5.3", "object", "rustc-demangle", ] @@ -4470,15 +4464,9 @@ checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.20.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64" @@ -4505,11 +4493,11 @@ dependencies = [ [[package]] name = "basic-toml" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" +checksum = "5c0de75129aa8d0cceaf750b89013f0e08804d6ec61416da787b35ad0d7cddf1" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -4517,7 +4505,7 @@ name = "bcs" version = "0.1.4" source = "git+https://github.com/aptos-labs/bcs.git?rev=d31fab9d81748e2594be5cd5cdf845786a30562d#d31fab9d81748e2594be5cd5cdf845786a30562d" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -4527,7 +4515,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bd3ffe8b19a604421a5d461d4a70346223e535903fbc3067138bddbebddcf77" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -4546,21 +4534,21 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3deeecb812ca5300b7d3f66f730cc2ebd3511c3d36c691dd79c165d5b19a26e3" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "bigdecimal" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +checksum = "6aaf33151a6429fe9211d1b276eafdf70cdff28b071e76c0b0e1503221ea3744" dependencies = [ "num-bigint 0.4.3", "num-integer", - "num-traits 0.2.16", - "serde 1.0.183", + "num-traits 0.2.15", + "serde 1.0.149", ] [[package]] @@ -4569,7 +4557,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -4585,12 +4573,12 @@ dependencies = [ "lazycell", "peeking_take_while", "prettyplease", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "regex", "rustc-hash", "shlex", - "syn 2.0.28", + "syn 2.0.25", ] [[package]] @@ -4622,9 +4610,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" [[package]] name = "bitmaps" @@ -4702,9 +4690,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array 0.14.7", ] @@ -4726,17 +4714,16 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blocking" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" dependencies = [ "async-channel", - "async-lock", "async-task", "atomic-waker", - "fastrand 1.9.0", + "fastrand", "futures-lite", - "log", + "once_cell", ] [[package]] @@ -4760,17 +4747,7 @@ checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static 1.4.0", "memchr", - "regex-automata 0.1.10", -] - -[[package]] -name = "bstr" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" -dependencies = [ - "memchr", - "serde 1.0.183", + "regex-automata", ] [[package]] @@ -4786,7 +4763,7 @@ dependencies = [ "merlin", "rand 0.8.5", "rand_core 0.6.4", - "serde 1.0.183", + "serde 1.0.149", "serde_derive", "sha3 0.9.1", "subtle-ng", @@ -4795,9 +4772,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byte-slice-cast" @@ -4858,9 +4835,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bzip2-sys" @@ -4879,13 +4856,19 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + [[package]] name = "captcha" version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db21780337b425f968a2c3efa842eeaa4fe53d2bcb1eb27d2877460a862fb0ab" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "hound", "image", "lodepng", @@ -4913,12 +4896,11 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.0.82" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", - "libc", ] [[package]] @@ -4927,7 +4909,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.3", + "nom 7.1.1", ] [[package]] @@ -4944,16 +4926,16 @@ checksum = "18758054972164c3264f7c8386f5fc6da6114cb46b619fd365d4e3b2dc3ae487" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", - "num-traits 0.2.16", - "serde 1.0.183", - "time 0.1.43", + "num-integer", + "num-traits 0.2.15", + "serde 1.0.149", + "time 0.1.44", "wasm-bindgen", "winapi 0.3.9", ] @@ -4982,18 +4964,17 @@ dependencies = [ [[package]] name = "chunked_transfer" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca491388666e04d7248af3f60f0c40cfb0991c72205595d7c396e3510207d1a" +checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "cipher" -version = "0.4.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "crypto-common", - "inout", + "generic-array 0.14.7", ] [[package]] @@ -5007,9 +4988,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" dependencies = [ "glob", "libc", @@ -5033,15 +5014,15 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "3.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "atty", "bitflags 1.3.2", - "clap_derive 3.2.25", + "clap_derive 3.2.18", "clap_lex 0.2.4", - "indexmap 1.9.3", + "indexmap", "once_cell", "strsim 0.10.0", "termcolor", @@ -5050,59 +5031,60 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.21" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" +checksum = "2686c4115cb0810d9a984776e197823d08ec94f176549a89a9efded477c456dc" dependencies = [ "clap_builder", - "clap_derive 4.3.12", + "clap_derive 4.3.2", "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.21" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" +checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" dependencies = [ "anstream", "anstyle", + "bitflags 1.3.2", "clap_lex 0.5.0", "strsim 0.10.0", ] [[package]] name = "clap_complete" -version = "4.3.2" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc443334c81a804575546c5a8a79b4913b50e28d69232903604cada1de817ce" +checksum = "7f6b5c519bab3ea61843a7923d074b04245624bb84a64a8c150f5deb014e388b" dependencies = [ - "clap 4.3.21", + "clap 4.3.5", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ - "heck 0.4.1", + "heck 0.4.0", "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "heck 0.4.0", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", ] [[package]] @@ -5136,7 +5118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7602ac4363f68ac757d6b87dd5d850549a14d37489902ae639c06ecec06ad275" dependencies = [ "async-trait", - "base64 0.13.1", + "base64 0.13.0", "bytes", "chrono", "dotenv", @@ -5147,7 +5129,7 @@ dependencies = [ "openssl", "percent-encoding", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tokio", ] @@ -5159,7 +5141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3362992a0d9f1dd7c3d0e89e0ab2bb540b7a95fea8cd798090e758fda2899b5e" dependencies = [ "codespan-reporting", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -5168,7 +5150,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "termcolor", "unicode-width", ] @@ -5187,13 +5169,13 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" dependencies = [ - "is-terminal", + "atty", "lazy_static 1.4.0", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] @@ -5207,16 +5189,16 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", ] [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" dependencies = [ - "crossbeam-utils", + "cache-padded", ] [[package]] @@ -5226,45 +5208,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" dependencies = [ "lazy_static 1.4.0", - "nom 5.1.3", + "nom 5.1.2", "rust-ini", - "serde 1.0.183", + "serde 1.0.149", "serde-hjson", "serde_json", - "toml 0.5.11", + "toml 0.5.9", "yaml-rust", ] [[package]] name = "console" -version = "0.15.7" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847" dependencies = [ "encode_unicode", - "lazy_static 1.4.0", "libc", + "once_cell", + "terminal_size", "unicode-width", - "windows-sys 0.45.0", + "winapi 0.3.9", ] [[package]] name = "console-api" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" +checksum = "e57ff02e8ad8e06ab9731d5dc72dc23bef9200778eae1a89d555d8c42e5d4a86" dependencies = [ "prost", "prost-types", - "tonic 0.9.2", + "tonic 0.8.3", "tracing-core", ] [[package]] name = "console-subscriber" -version = "0.1.10" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" +checksum = "22a3a81dfaf6b66bce5d159eddae701e3a002f194d378cbf7be5f053c281d9be" dependencies = [ "console-api", "crossbeam-channel", @@ -5273,12 +5256,12 @@ dependencies = [ "hdrhistogram", "humantime", "prost-types", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thread_local", "tokio", "tokio-stream", - "tonic 0.9.2", + "tonic 0.8.3", "tracing", "tracing-core", "tracing-subscriber", @@ -5304,22 +5287,22 @@ checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] name = "const_format" -version = "0.2.31" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +checksum = "939dc9e2eb9077e0679d2ce32de1ded8531779360b003b4a972a7a39ec263495" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.31" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +checksum = "ef196d5d972878a48da7decb7686eded338b4858fbabeed513d63a7c98b2b82d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "unicode-xid 0.2.4", + "proc-macro2 1.0.64", + "quote 1.0.29", + "unicode-xid 0.2.3", ] [[package]] @@ -5336,36 +5319,35 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cookie" -version = "0.16.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +checksum = "94d4706de1b0fa5b132270cddffa8585166037822e260a944fe161acd137ca05" dependencies = [ "aes-gcm", - "base64 0.20.0", + "base64 0.13.0", "hkdf 0.12.3", "hmac 0.12.1", "percent-encoding", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.6", "subtle", - "time 0.3.25", + "time 0.3.24", "version_check", ] [[package]] name = "cookie_store" -version = "0.16.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d606d0fba62e13cf04db20536c05cb7f13673c161cb47a47a82b9b9e7d3f1daa" +checksum = "2e4b6aa369f41f5faa04bb80c9b1f4216ea81646ed6124d76ba5c49a7aafd9cd" dependencies = [ "cookie", "idna 0.2.3", "log", "publicsuffix", - "serde 1.0.183", - "serde_derive", + "serde 1.0.149", "serde_json", - "time 0.3.25", + "time 0.3.24", "url", ] @@ -5381,15 +5363,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" dependencies = [ "libc", ] @@ -5416,12 +5398,12 @@ dependencies = [ "csv", "itertools", "lazy_static 1.4.0", - "num-traits 0.2.16", + "num-traits 0.2.15", "oorandom", "plotters", "rayon", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_cbor", "serde_derive", "serde_json", @@ -5465,9 +5447,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -5475,9 +5457,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -5486,22 +5468,23 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", "memoffset", + "once_cell", "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" dependencies = [ "cfg-if", "crossbeam-utils", @@ -5509,11 +5492,12 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ "cfg-if", + "once_cell", ] [[package]] @@ -5550,9 +5534,9 @@ dependencies = [ [[package]] name = "crossterm_winapi" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" dependencies = [ "winapi 0.3.9", ] @@ -5592,7 +5576,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", "typenum", ] @@ -5618,14 +5601,14 @@ dependencies = [ [[package]] name = "csv" -version = "1.2.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" dependencies = [ "csv-core", "itoa", "ryu", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -5637,11 +5620,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctor" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +dependencies = [ + "quote 1.0.29", + "syn 1.0.105", +] + [[package]] name = "ctr" -version = "0.9.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ "cipher", ] @@ -5663,9 +5656,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.65+curl-8.2.1" +version = "0.4.56+curl-7.83.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" +checksum = "6093e169dd4de29e468fa649fbae11cdcd5551c81fe5bf1b0677adad7ef3d26f" dependencies = [ "cc", "libc", @@ -5699,16 +5692,16 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.6.4", - "serde 1.0.183", + "serde 1.0.149", "subtle-ng", "zeroize", ] [[package]] name = "darling" -version = "0.14.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "4529658bdda7fd6769b8614be250cdcfc3aeb0ee72fe66f9e41e5e5eb73eac02" dependencies = [ "darling_core", "darling_macro", @@ -5716,40 +5709,38 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "strsim 0.10.0", - "syn 1.0.109", + "syn 1.0.105", ] [[package]] name = "darling_macro" -version = "0.14.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5" dependencies = [ "darling_core", - "quote 1.0.32", - "syn 1.0.109", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "dashmap" -version = "5.5.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" +checksum = "4c8858831f7781322e539ea39e72449c46b059638250c14344fec8d0aa6e539c" dependencies = [ "cfg-if", - "hashbrown 0.14.0", - "lock_api", - "once_cell", - "parking_lot_core 0.9.8", + "num_cpus", + "parking_lot 0.12.1", ] [[package]] @@ -5797,11 +5788,11 @@ dependencies = [ [[package]] name = "debug-ignore" -version = "1.0.5" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" +checksum = "4b48b0b49e2f473c499ddcd133e78f0f2629aaa997ee61adadb2d1753e6af4cf" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -5828,11 +5819,11 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "8810e7e2cf385b1e9b50d68264908ec367ba642c96d02edfe61c39e88e2a3c01" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -5847,9 +5838,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -5858,9 +5849,9 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", ] [[package]] @@ -5870,17 +5861,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "rustc_version", - "syn 1.0.109", + "syn 1.0.105", ] [[package]] name = "deunicode" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95203a6a50906215a502507c0f879a0ce7ff205a6111e2db2a5ef8e4bb92e43" +checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" [[package]] name = "diesel" @@ -5889,14 +5880,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7a532c1f99a0f596f6960a60d1e119e91582b24b39e2d83a190e61262c3ef0c" dependencies = [ "bigdecimal", - "bitflags 2.3.3", + "bitflags 2.0.2", "byteorder", "chrono", "diesel_derives", "itoa", "num-bigint 0.4.3", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", "pq-sys", "r2d2", "serde_json", @@ -5909,9 +5900,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74398b79d81e52e130d991afeed9c86034bb1b7735f46d2f5bf7deb261d80303" dependencies = [ "diesel_table_macro_syntax", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 2.0.25", ] [[package]] @@ -5931,7 +5922,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.28", + "syn 2.0.25", ] [[package]] @@ -5976,7 +5967,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer 0.10.2", "const-oid 0.9.5", "crypto-common", "subtle", @@ -6073,9 +6064,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" [[package]] name = "e2e-move-tests" @@ -6111,7 +6102,7 @@ dependencies = [ "proptest", "rand 0.7.3", "rstest", - "serde 1.0.183", + "serde 1.0.149", "tempfile", ] @@ -6132,12 +6123,12 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" dependencies = [ - "serde 1.0.183", - "signature 1.6.4", + "serde 1.0.149", + "signature 1.6.0", ] [[package]] @@ -6149,7 +6140,7 @@ dependencies = [ "curve25519-dalek", "ed25519", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "sha2 0.9.9", "zeroize", @@ -6164,14 +6155,14 @@ dependencies = [ "derivation-path", "ed25519-dalek", "hmac 0.12.1", - "sha2 0.10.7", + "sha2 0.10.6", ] [[package]] name = "either" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" @@ -6196,9 +6187,9 @@ dependencies = [ [[package]] name = "ena" -version = "0.14.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" dependencies = [ "log", ] @@ -6211,23 +6202,23 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if", ] [[package]] name = "enum_dispatch" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" +checksum = "0eb359f1476bf611266ac1f5355bc14aeca37b299d0ebccc038ee7058891c9cb" dependencies = [ "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -6249,30 +6240,24 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "erased-serde" -version = "0.3.28" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da96524cc884f6558f1769b6c46686af2fe8e8b4cd253bd5a3cdba8181b8e070" +checksum = "003000e712ad0f95857bd4d2ef8d1890069e06554101697d12050668b2f6f020" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "errno" -version = "0.3.2" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] @@ -6295,9 +6280,9 @@ dependencies = [ "hex", "once_cell", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", - "sha3 0.10.8", + "sha3 0.10.6", "thiserror", "uint", ] @@ -6343,7 +6328,7 @@ dependencies = [ "rlp", "rlp-derive", "scale-info", - "serde 1.0.183", + "serde 1.0.149", "sha3 0.9.1", "triehash", ] @@ -6379,9 +6364,9 @@ dependencies = [ [[package]] name = "ethnum" -version = "1.3.2" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0198b9d0078e0f30dedc7acbb21c974e838fc8fae3ee170128658a98cb2c1c04" +checksum = "87e4a7b7dde9ed6aed8eb4dd7474d22fb1713a4b05ac5071cdb60d9903248ad3" [[package]] name = "event-listener" @@ -6406,7 +6391,7 @@ dependencies = [ "primitive-types 0.10.1", "rlp", "scale-info", - "serde 1.0.183", + "serde 1.0.149", "sha3 0.8.2", ] @@ -6420,7 +6405,7 @@ dependencies = [ "parity-scale-codec 2.3.1", "primitive-types 0.10.1", "scale-info", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -6463,17 +6448,17 @@ dependencies = [ [[package]] name = "exr" -version = "1.7.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" +checksum = "e8af5ef47e2ed89d23d0ecbc1b681b30390069de70260937877514377fc24feb" dependencies = [ "bit_field", "flume", - "half 2.2.1", + "half 2.3.1", "lebe", - "miniz_oxide", - "rayon-core", + "miniz_oxide 0.6.2", "smallvec", + "threadpool", "zune-inflate", ] @@ -6490,48 +6475,33 @@ dependencies = [ [[package]] name = "fail" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5e43d0f78a42ad591453aedb1d7ae631ce7ee445c7643691055a9ed8d3b01c" +checksum = "ec3245a0ca564e7f3c797d20d833a6870f57a728ac967d5225b3ffdef4465011" dependencies = [ + "lazy_static 1.4.0", "log", - "once_cell", "rand 0.8.5", ] [[package]] name = "fallible_collections" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" +checksum = "9acf77205554f3cfeca94a4b910e159ad9824e8c2d164de02b3f12495cc1074d" dependencies = [ "hashbrown 0.13.2", ] [[package]] name = "fastrand" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "fdeflate" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" -dependencies = [ - "simd-adler32", -] - [[package]] name = "ff" version = "0.13.0" @@ -6557,8 +6527,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1320970ff3b1c1cacc6a38e8cdb1aced955f29627697cd992c5ded82eb646a8" dependencies = [ - "quote 1.0.32", - "syn 1.0.109", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -6593,12 +6563,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.5.3", ] [[package]] @@ -6607,7 +6577,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -6620,7 +6590,7 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin 0.9.8", + "spin 0.9.4", ] [[package]] @@ -6661,9 +6631,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "fs_extra" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" [[package]] name = "fst" @@ -6710,9 +6680,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-executor" @@ -6727,17 +6697,17 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-lite" -version = "1.13.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ - "fastrand 1.9.0", + "fastrand", "futures-core", "futures-io", "memchr", @@ -6752,22 +6722,22 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-timer" @@ -6829,13 +6799,13 @@ checksum = "09ab5966c98f6d4e71e247cda6a6d8497bc8a1df3a4ba9ee548087842cffc21d" dependencies = [ "async-stream", "hyper", - "hyper-rustls 0.23.2", + "hyper-rustls", "log", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", - "time 0.3.25", + "time 0.3.24", "tokio", "tokio-stream", "url", @@ -6855,10 +6825,10 @@ dependencies = [ "aptos-network", "aptos-types", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-core-types", "rand 0.7.3", - "serde 1.0.183", + "serde 1.0.149", "serde-reflection", "serde_yaml 0.8.26", ] @@ -6920,9 +6890,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "js-sys", @@ -6933,9 +6903,9 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug 0.3.0", "polyval", @@ -6943,9 +6913,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.12.0" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" dependencies = [ "color_quant", "weezl", @@ -6953,9 +6923,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "git2" @@ -6987,18 +6957,18 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ "aho-corasick", - "bstr 1.6.0", + "bstr", "fnv", "log", "regex", @@ -7017,9 +6987,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.6" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" dependencies = [ "futures-channel", "futures-core", @@ -7029,9 +6999,9 @@ dependencies = [ [[package]] name = "goldenfile" -version = "1.5.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86342e69ffaa1cd5450d6bad08a80da96c441d891a0e07c72c62c4abdd281713" +checksum = "03bd0e9c2ea26ce269d37016d6b95556bbfa544cbbbdeff40102ac54121c990b" dependencies = [ "similar-asserts", "tempfile", @@ -7048,12 +7018,12 @@ dependencies = [ "google-cloud-metadata", "google-cloud-token", "home", - "jsonwebtoken 8.3.0", + "jsonwebtoken 8.1.1", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", - "time 0.3.25", + "time 0.3.24", "tokio", "tracing", "urlencoding", @@ -7112,7 +7082,7 @@ dependencies = [ "prost-types", "thiserror", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "tracing", ] @@ -7136,11 +7106,11 @@ dependencies = [ "reqwest", "ring", "rsa", - "serde 1.0.183", + "serde 1.0.149", "serde_json", - "sha2 0.10.7", + "sha2 0.10.6", "thiserror", - "time 0.3.25", + "time 0.3.24", "tokio", "tracing", "url", @@ -7178,10 +7148,10 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "tracing", ] @@ -7193,23 +7163,24 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "half" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" dependencies = [ + "cfg-if", "crunchy", ] [[package]] name = "handlebars" -version = "4.3.7" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "360d9740069b2f6cbb63ce2dbaa71a20d3185350cbb990d7bebeb9318415eb17" dependencies = [ "log", "pest", "pest_derive", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", ] @@ -7247,39 +7218,33 @@ dependencies = [ "ahash 0.8.3", ] -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "6ea9fe3952d32674a14e0975009a3547af9ea364995b5ec1add2e23c2ae523ab" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "byteorder", "flate2", - "nom 7.1.3", - "num-traits 0.2.16", + "nom 7.1.1", + "num-traits 0.2.15", ] [[package]] name = "headers" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "4cff78e5788be1e0ab65b04d306b2ed5092c815ec97ec70f4ebd5aee158aa55d" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bitflags 1.3.2", "bytes", "headers-core", "http", "httpdate", "mime", - "sha1", + "sha-1", ] [[package]] @@ -7302,9 +7267,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" @@ -7317,9 +7282,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" [[package]] name = "hex" @@ -7454,9 +7419,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" [[package]] name = "httparse" @@ -7472,14 +7437,14 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "httpmock" -version = "0.6.8" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b02e044d3b4c2f94936fb05f9649efa658ca788f44eb6b87554e2033fc8ce93" +checksum = "c159c4fc205e6c1a9b325cb7ec135d13b5f47188ce175dabb76ec847f331d9bd" dependencies = [ "assert-json-diff", "async-object-pool", "async-trait", - "base64 0.21.2", + "base64 0.13.0", "basic-cookies", "crossbeam-utils", "form_urlencoded", @@ -7490,7 +7455,7 @@ dependencies = [ "levenshtein", "log", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_regex", "similar", @@ -7536,38 +7501,24 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ "http", "hyper", "log", - "rustls 0.20.8", + "rustls 0.20.6", "rustls-native-certs", "tokio", "tokio-rustls 0.23.4", ] [[package]] -name = "hyper-rustls" -version = "0.24.1" +name = "hyper-timeout" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" -dependencies = [ - "futures-util", - "http", - "hyper", - "rustls 0.21.6", - "tokio", - "tokio-rustls 0.24.1", -] - -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ "hyper", "pin-project-lite", @@ -7590,25 +7541,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501" dependencies = [ "android_system_properties", "core-foundation-sys", - "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", + "winapi 0.3.9", ] [[package]] @@ -7628,16 +7569,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -7650,10 +7581,11 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" dependencies = [ + "crossbeam-utils", "globset", "lazy_static 1.4.0", "log", @@ -7681,9 +7613,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.7" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" dependencies = [ "bytemuck", "byteorder", @@ -7692,9 +7624,9 @@ dependencies = [ "gif", "jpeg-decoder", "num-rational 0.4.1", - "num-traits 0.2.16", + "num-traits 0.2.15", "png", - "qoi", + "scoped_threadpool", "tiff", ] @@ -7713,7 +7645,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.4.0", ] [[package]] @@ -7731,7 +7663,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -7740,9 +7672,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -7758,9 +7690,9 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "482a2e29200b7eed25d7fdbd14423326760b7f6658d21a4cf12d55a50713c69f" dependencies = [ "glob", "include_dir_macros", @@ -7774,19 +7706,19 @@ checksum = "0a0c890c85da4bab7bce4204c707396bbd3c6c8a681716a51c8814cfc2b682df" dependencies = [ "anyhow", "proc-macro-hack", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "5e074c19deab2501407c91ba1860fa3d6820bfde307db6d8cb851b55a10be89b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", ] [[package]] @@ -7799,16 +7731,6 @@ dependencies = [ "hashbrown 0.12.3", ] -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - [[package]] name = "indicatif" version = "0.15.0" @@ -7823,12 +7745,11 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.6" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" dependencies = [ "console", - "instant", "number_prefix 0.4.0", "portable-atomic", "unicode-width", @@ -7836,9 +7757,9 @@ dependencies = [ [[package]] name = "indoc" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" +checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3" [[package]] name = "inferno" @@ -7847,12 +7768,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fb7c1b80a1dfa604bb4a649a5c5aeef3d913f7c520cb42b40e534e8a61bcdfc" dependencies = [ "ahash 0.8.3", - "clap 4.3.21", + "clap 4.3.5", "crossbeam-channel", "crossbeam-utils", "dashmap", "env_logger", - "indexmap 1.9.3", + "indexmap", "is-terminal", "itoa", "log", @@ -7863,15 +7784,6 @@ dependencies = [ "str_stack", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "instant" version = "0.1.12" @@ -7879,9 +7791,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", ] [[package]] @@ -7908,20 +7817,26 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.11" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" + +[[package]] +name = "io-lifetimes" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.1", "libc", - "windows-sys 0.48.0", + "windows-sys 0.45.0", ] [[package]] name = "ipnet" -version = "2.8.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "iprange" @@ -7934,13 +7849,14 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.7", - "windows-sys 0.48.0", + "hermit-abi 0.3.1", + "io-lifetimes 1.0.9", + "rustix 0.36.11", + "windows-sys 0.45.0", ] [[package]] @@ -7978,18 +7894,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jemalloc-sys" @@ -8014,9 +7930,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] @@ -8032,20 +7948,20 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] [[package]] name = "json-patch" -version = "0.2.7" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3fa5a61630976fc4c353c70297f2e93f1930e3ccee574d59d618ccbd5154ce" +checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "serde_json", "treediff", ] @@ -8057,7 +7973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaa63191d68230cccb81c5aa23abd53ed64d83337cacbb25a7b8c7979523774f" dependencies = [ "log", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -8070,21 +7986,21 @@ dependencies = [ "base64 0.12.3", "pem 0.8.3", "ring", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "simple_asn1 0.4.1", ] [[package]] name = "jsonwebtoken" -version = "8.3.0" +version = "8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" +checksum = "1aa4b4af834c6cfd35d8763d359661b90f2e45d8f750a0849156c7f4671af09c" dependencies = [ - "base64 0.21.2", - "pem 1.1.1", + "base64 0.13.0", + "pem 1.1.0", "ring", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "simple_asn1 0.6.2", ] @@ -8095,22 +8011,19 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f8de9873b904e74b3533f77493731ee26742418077503683db44e1b3c54aa5c" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bytes", "chrono", - "serde 1.0.183", + "serde 1.0.149", "serde-value", "serde_json", ] [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kube" @@ -8129,7 +8042,7 @@ version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95dddb1fcced906d79cdae530ff39079c2d3772b2d623088fdbebe610bfa8217" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bytes", "chrono", "dirs-next", @@ -8138,16 +8051,16 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls 0.23.2", + "hyper-rustls", "hyper-timeout", "jsonpath_lib", "k8s-openapi", "kube-core", - "pem 1.1.1", + "pem 1.1.0", "pin-project", - "rustls 0.20.8", + "rustls 0.20.6", "rustls-pemfile 0.2.1", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "thiserror", @@ -8170,7 +8083,7 @@ dependencies = [ "json-patch", "k8s-openapi", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", ] @@ -8186,31 +8099,32 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823" dependencies = [ "ascii-canvas", + "atty", "bit-set", "diff", "ena", - "is-terminal", "itertools", "lalrpop-util", - "petgraph 0.6.3", + "petgraph 0.6.2", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax", "string_cache", "term", "tiny-keccak", - "unicode-xid 0.2.4", + "unicode-xid 0.2.3", ] [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4" dependencies = [ "regex", ] @@ -8238,14 +8152,14 @@ dependencies = [ "aptos-vm-types", "aptos-writeset-generator", "bcs 0.1.4", - "fail 0.5.1", + "fail 0.5.0", "itertools", "move-binary-format", "move-bytecode-verifier", "move-core-types", "move-ir-compiler", "proptest", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -8333,9 +8247,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libfuzzer-sys" @@ -8364,9 +8278,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ "cfg-if", "winapi 0.3.9", @@ -8380,9 +8294,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libnghttp2-sys" -version = "0.1.8+1.55.1" +version = "0.1.7+1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fae956c192dadcdb5dace96db71fa0b827333cce7c7b38dc71446f024d8a340" +checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" dependencies = [ "cc", "libc", @@ -8411,14 +8325,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", - "base64 0.13.1", + "base64 0.13.0", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", "rand 0.8.5", - "serde 1.0.183", + "serde 1.0.149", "sha2 0.9.9", "typenum", ] @@ -8472,16 +8386,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79529479c298f5af41375b0c1a77ef670d450b4c9cd7949d2b43af08121b20ec" dependencies = [ - "clap 3.2.25", + "clap 3.2.23", "termcolor", "threadpool", ] [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" dependencies = [ "cc", "libc", @@ -8497,38 +8411,31 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" +version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "listener" version = "0.1.0" dependencies = [ "bytes", - "clap 4.3.21", + "clap 4.3.5", "tokio", ] [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ - "autocfg", "scopeguard", ] @@ -8547,11 +8454,12 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "serde 1.0.183", + "cfg-if", + "serde 1.0.149", "value-bag", ] @@ -8581,7 +8489,7 @@ checksum = "c351c75989da23b355226dc188dc2b52538a7f4f218d70fd7393c6b62b110444" dependencies = [ "crossbeam-channel", "log", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -8592,7 +8500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f3734ab1d7d157fc0c45110e06b587c31cd82bea2ccfd6b563cbff0aaeeb1d3" dependencies = [ "bitflags 1.3.2", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_repr", "url", @@ -8645,14 +8553,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] name = "matches" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "matchit" @@ -8662,9 +8570,9 @@ checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" [[package]] name = "matchit" -version = "0.7.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" [[package]] name = "matrixmultiply" @@ -8684,9 +8592,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.9.0" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] @@ -8718,8 +8626,8 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" dependencies = [ - "serde 1.0.183", - "toml 0.7.6", + "serde 1.0.149", + "toml 0.7.4", ] [[package]] @@ -8729,15 +8637,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" dependencies = [ "migrations_internals", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", ] [[package]] name = "mime" -version = "0.3.17" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime_guess" @@ -8757,24 +8665,32 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", - "simd-adler32", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.36.1", ] [[package]] @@ -8805,9 +8721,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ "cfg-if", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -8830,15 +8746,15 @@ dependencies = [ "anyhow", "aptos-framework", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-binary-format", ] [[package]] name = "more-asserts" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" +checksum = "5474f8732dc7e0635ae9df6595bcd39cd30e3cfe8479850d4fa3e69306c19712" [[package]] name = "move-abigen" @@ -8857,7 +8773,7 @@ dependencies = [ "move-model", "move-prover", "move-prover-test-utils", - "serde 1.0.183", + "serde 1.0.149", "tempfile", ] @@ -8866,7 +8782,7 @@ name = "move-analyzer" version = "1.0.0" dependencies = [ "anyhow", - "clap 4.3.21", + "clap 4.3.5", "codespan-reporting", "crossbeam", "derivative", @@ -8880,7 +8796,7 @@ dependencies = [ "move-package", "move-symbol-pool", "petgraph 0.5.1", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tempfile", "url", @@ -8916,13 +8832,13 @@ dependencies = [ "anyhow", "arbitrary", "backtrace", - "indexmap 1.9.3", + "indexmap", "move-core-types", "once_cell", "proptest", "proptest-derive", "ref-cast", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "variant_count", ] @@ -8942,7 +8858,7 @@ dependencies = [ "move-core-types", "move-ir-types", "move-symbol-pool", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -8976,7 +8892,7 @@ name = "move-bytecode-viewer" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.3.21", + "clap 4.3.5", "crossterm 0.26.1", "move-binary-format", "move-bytecode-source-map", @@ -8993,7 +8909,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "codespan-reporting", "colored", "datatest-stable", @@ -9025,7 +8941,7 @@ dependencies = [ "move-vm-types", "once_cell", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_yaml 0.8.26", "tempfile", @@ -9044,7 +8960,7 @@ dependencies = [ "move-core-types", "num-bigint 0.4.3", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "sha2 0.9.9", "walkdir", ] @@ -9055,7 +8971,7 @@ version = "0.0.1" dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "codespan-reporting", "datatest-stable", "difference", @@ -9093,7 +9009,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bcs 0.1.4", - "clap 3.2.25", + "clap 3.2.23", "codespan", "codespan-reporting", "datatest-stable", @@ -9108,9 +9024,9 @@ dependencies = [ "move-prover-test-utils", "move-stackless-bytecode", "move-stdlib", - "num 0.4.1", + "num 0.4.0", "once_cell", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9130,7 +9046,7 @@ dependencies = [ "bcs 0.1.4", "ethnum", "hex", - "num 0.4.1", + "num 0.4.0", "once_cell", "primitive-types 0.10.1", "proptest", @@ -9138,7 +9054,7 @@ dependencies = [ "rand 0.8.5", "ref-cast", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_bytes", "serde_json", "uint", @@ -9150,7 +9066,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "codespan", "colored", "move-binary-format", @@ -9160,7 +9076,7 @@ dependencies = [ "move-ir-types", "once_cell", "petgraph 0.5.1", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9168,7 +9084,7 @@ name = "move-disassembler" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.3.21", + "clap 4.3.5", "colored", "move-binary-format", "move-bytecode-source-map", @@ -9195,10 +9111,10 @@ dependencies = [ "move-model", "move-prover", "move-prover-test-utils", - "num 0.4.1", + "num 0.4.0", "once_cell", "regex", - "serde 1.0.183", + "serde 1.0.149", "tempfile", ] @@ -9215,7 +9131,7 @@ dependencies = [ "move-core-types", "move-model", "move-prover", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9226,7 +9142,7 @@ dependencies = [ "ethabi", "once_cell", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -9235,7 +9151,7 @@ name = "move-explain" version = "0.1.0" dependencies = [ "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-command-line-common", "move-core-types", ] @@ -9246,7 +9162,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "move-binary-format", "move-bytecode-source-map", "move-bytecode-verifier", @@ -9306,7 +9222,7 @@ dependencies = [ "move-core-types", "move-symbol-pool", "once_cell", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9330,10 +9246,10 @@ dependencies = [ "move-ir-types", "move-prover-test-utils", "move-symbol-pool", - "num 0.4.1", + "num 0.4.0", "once_cell", "regex", - "serde 1.0.183", + "serde 1.0.149", "trace", ] @@ -9343,7 +9259,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bcs 0.1.4", - "clap 4.3.21", + "clap 4.3.5", "colored", "datatest-stable", "dirs-next", @@ -9367,12 +9283,12 @@ dependencies = [ "ptree", "regex", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_yaml 0.8.26", "sha2 0.9.9", "tempfile", "termcolor", - "toml 0.5.11", + "toml 0.5.9", "walkdir", "whoami", ] @@ -9384,7 +9300,7 @@ dependencies = [ "anyhow", "async-trait", "atty", - "clap 4.3.21", + "clap 4.3.5", "codespan", "codespan-reporting", "datatest-stable", @@ -9404,17 +9320,17 @@ dependencies = [ "move-prover-boogie-backend", "move-prover-test-utils", "move-stackless-bytecode", - "num 0.4.1", + "num 0.4.0", "once_cell", "pretty", "rand 0.8.5", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "shell-words", "simplelog", "tempfile", "tokio", - "toml 0.5.11", + "toml 0.5.9", "walkdir", ] @@ -9435,12 +9351,12 @@ dependencies = [ "move-core-types", "move-model", "move-stackless-bytecode", - "num 0.4.1", + "num 0.4.0", "once_cell", "pretty", "rand 0.8.5", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "tera", "tokio", @@ -9467,7 +9383,7 @@ dependencies = [ "move-bytecode-utils", "move-core-types", "once_cell", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9492,11 +9408,11 @@ dependencies = [ "move-model", "move-prover-test-utils", "move-stdlib", - "num 0.4.1", + "num 0.4.0", "once_cell", "paste", "petgraph 0.5.1", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9532,7 +9448,7 @@ name = "move-symbol-pool" version = "0.1.0" dependencies = [ "once_cell", - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -9563,7 +9479,7 @@ version = "0.1.0" dependencies = [ "anyhow", "atty", - "clap 4.3.21", + "clap 4.3.5", "codespan", "codespan-reporting", "datatest-stable", @@ -9585,18 +9501,18 @@ dependencies = [ "move-prover-test-utils", "move-stackless-bytecode", "move-stdlib", - "num 0.4.1", + "num 0.4.0", "once_cell", "pretty", "primitive-types 0.10.1", "rand 0.8.5", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "sha3 0.9.1", "simplelog", "tempfile", - "toml 0.5.11", + "toml 0.5.9", "walkdir", ] @@ -9605,7 +9521,7 @@ name = "move-transactional-test-runner" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.3.21", + "clap 4.3.5", "colored", "datatest-stable", "difference", @@ -9640,7 +9556,7 @@ version = "0.1.0" dependencies = [ "anyhow", "better_any", - "clap 4.3.21", + "clap 4.3.5", "codespan-reporting", "colored", "datatest-stable", @@ -9727,7 +9643,7 @@ dependencies = [ "move-table-extension", "move-vm-types", "once_cell", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -9747,7 +9663,7 @@ dependencies = [ "move-core-types", "once_cell", "proptest", - "serde 1.0.183", + "serde 1.0.149", "smallvec", ] @@ -9765,7 +9681,7 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.8", + "spin 0.9.4", "tokio", "version_check", ] @@ -9779,9 +9695,9 @@ dependencies = [ "approx", "matrixmultiply", "nalgebra-macros", - "num-complex 0.4.3", + "num-complex 0.4.2", "num-rational 0.4.1", - "num-traits 0.2.16", + "num-traits 0.2.15", "simba", "typenum", ] @@ -9792,9 +9708,9 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -9817,14 +9733,14 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.7", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" dependencies = [ "lazy_static 1.4.0", "libc", @@ -9858,9 +9774,9 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "nom" -version = "5.1.3" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" dependencies = [ "lexical-core", "memchr", @@ -9869,9 +9785,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.3" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" dependencies = [ "memchr", "minimal-lexical", @@ -9908,9 +9824,9 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be7d33be719c6f4d09e64e27c1ef4e73485dc4cc1f4d22201f89860a7fe22e22" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -9920,9 +9836,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "066b468120587a402f0b47d8f80035c921f6a46f8209efd0632a89a16f5188a4" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -9946,21 +9862,21 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.3.2", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] name = "num" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" dependencies = [ "num-bigint 0.4.3", - "num-complex 0.4.3", + "num-complex 0.4.2", "num-integer", "num-iter", "num-rational 0.4.1", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -9971,7 +9887,7 @@ checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -9982,7 +9898,7 @@ checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -9993,21 +9909,21 @@ checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] name = "num-bigint-dig" -version = "0.8.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "566d173b2f9406afbc5510a90925d5a2cd80cae4605631f1212303df265de011" dependencies = [ "byteorder", "lazy_static 1.4.0", "libm", "num-integer", "num-iter", - "num-traits 0.2.16", + "num-traits 0.2.15", "rand 0.8.5", "smallvec", "zeroize", @@ -10019,16 +9935,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -10037,9 +9953,9 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -10048,7 +9964,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.2", "itoa", ] @@ -10059,7 +9975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -10070,7 +9986,7 @@ checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -10082,7 +9998,7 @@ dependencies = [ "autocfg", "num-bigint 0.3.3", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -10094,7 +10010,7 @@ dependencies = [ "autocfg", "num-bigint 0.4.3", "num-integer", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -10103,14 +10019,14 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", "libm", @@ -10118,11 +10034,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.1.19", "libc", ] @@ -10149,9 +10065,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.31.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] @@ -10182,9 +10098,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.56" +version = "0.10.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -10197,13 +10113,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -10214,9 +10130,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.91" +version = "0.9.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0" dependencies = [ "cc", "libc", @@ -10236,14 +10152,14 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] name = "os_str_bytes" -version = "6.5.1" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" [[package]] name = "ouroboros" @@ -10273,9 +10189,9 @@ checksum = "03f2cb802b5bdfdf52f1ffa0b54ce105e4d346e91990dd571f86c91321ad49e2" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -10286,9 +10202,18 @@ checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", +] + +[[package]] +name = "output_vt100" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" +dependencies = [ + "winapi 0.3.9", ] [[package]] @@ -10313,16 +10238,7 @@ dependencies = [ "elliptic-curve", "primeorder", "serdect", - "sha2 0.10.7", -] - -[[package]] -name = "pad" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ad9b889f1b12e0b9ee24db044b5129150d5eada288edc800f789928dc8c0e3" -dependencies = [ - "unicode-width", + "sha2 0.10.6", ] [[package]] @@ -10331,26 +10247,26 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.2", "bitvec 0.20.4", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive 2.3.1", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.2", "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.6.4", - "serde 1.0.183", + "parity-scale-codec-derive 3.1.4", + "serde 1.0.149", ] [[package]] @@ -10360,28 +10276,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "parking" -version = "2.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" @@ -10391,7 +10307,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.6", + "parking_lot_core 0.8.5", ] [[package]] @@ -10401,34 +10317,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.3", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets 0.48.1", + "windows-sys 0.36.1", ] [[package]] @@ -10442,9 +10358,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "9423e2b32f7a043629287a536f21951e8c6a82482d0acb1eeebfc90bc2225b22" [[package]] name = "pbjson" @@ -10452,8 +10368,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "599fe9aefc2ca0df4a96179b3075faee2cacb89d4cf947a00b9a89152dfffc9d" dependencies = [ - "base64 0.13.1", - "serde 1.0.183", + "base64 0.13.0", + "serde 1.0.149", ] [[package]] @@ -10477,18 +10393,18 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "once_cell", "regex", ] [[package]] name = "pem" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", ] [[package]] @@ -10517,9 +10433,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4" dependencies = [ "thiserror", "ucd-trie", @@ -10527,9 +10443,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "905708f7f674518498c1f8d644481440f476d39ca6ecae83319bba7c6c12da91" dependencies = [ "pest", "pest_generator", @@ -10537,26 +10453,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "5803d8284a629cc999094ecd630f55e91b561a1d1ba75e233b00ae13b91a69ad" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "1538eb784f07615c6d9a8ab061089c6c54a344c5b4301db51990ca1c241e8c04" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", + "sha-1", ] [[package]] @@ -10566,45 +10482,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" dependencies = [ "fixedbitset 0.2.0", - "indexmap 1.9.3", + "indexmap", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" dependencies = [ "fixedbitset 0.4.2", - "indexmap 1.9.3", + "indexmap", ] [[package]] name = "phf" -version = "0.11.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" dependencies = [ - "phf_shared 0.11.2", + "phf_shared 0.11.1", ] [[package]] name = "phf_codegen" -version = "0.11.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared 0.11.1", ] [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" dependencies = [ - "phf_shared 0.11.2", + "phf_shared 0.11.1", "rand 0.8.5", ] @@ -10619,39 +10535,45 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" dependencies = [ "siphasher", "uncased", ] +[[package]] +name = "pico-args" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" + [[package]] name = "pin-project" -version = "1.1.3" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "pin-project-lite" -version = "0.2.11" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -10693,9 +10615,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "plotters" @@ -10703,7 +10625,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ - "num-traits 0.2.16", + "num-traits 0.2.15", "plotters-backend", "plotters-svg", "wasm-bindgen", @@ -10727,15 +10649,14 @@ dependencies = [ [[package]] name = "png" -version = "0.17.9" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59871cc5b6cce7eaccca5a802b4173377a1c2ba90654246789a8fa2334426d11" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" dependencies = [ "bitflags 1.3.2", "crc32fast", - "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -10762,31 +10683,31 @@ dependencies = [ "quick-xml 0.26.0", "regex", "rfc7239", - "rustls-pemfile 1.0.3", - "serde 1.0.183", + "rustls-pemfile 1.0.1", + "serde 1.0.149", "serde_json", "serde_urlencoded", "smallvec", "tempfile", "thiserror", - "time 0.3.25", + "time 0.3.24", "tokio", "tokio-rustls 0.23.4", "tokio-stream", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "tracing", ] [[package]] name = "poem-derive" -version = "1.3.57" +version = "1.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5dd58846a1f582215370384c3090c62c9ef188e9d798ffc67ea90d0a1a8a3b8" +checksum = "3b839bad877aa933dd00901abd127a44496130e3def48e079d60e43f2c8a33cc" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -10795,20 +10716,20 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e69c569eb0671cc85e65cfb6bd960d0168d24732ff58825227b4d2a10167ba91" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bytes", "derive_more", "futures-util", "mime", - "num-traits 0.2.16", + "num-traits 0.2.15", "poem", "poem-openapi-derive", "quick-xml 0.23.1", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_urlencoded", - "serde_yaml 0.9.25", + "serde_yaml 0.9.10", "thiserror", "tokio", "url", @@ -10822,37 +10743,35 @@ checksum = "274cf13f710999977a3c1e396c2a5000d104075a7127ce6470fbdae4706be621" dependencies = [ "darling", "http", - "indexmap 1.9.3", + "indexmap", "mime", "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "regex", - "syn 1.0.109", + "syn 1.0.105", "thiserror", ] [[package]] name = "polling" -version = "2.8.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" dependencies = [ "autocfg", - "bitflags 1.3.2", "cfg-if", - "concurrent-queue", "libc", "log", - "pin-project-lite", - "windows-sys 0.48.0", + "wepoll-ffi", + "winapi 0.3.9", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if", "cpufeatures", @@ -10875,28 +10794,28 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597c3287a549da151aca6ada2795ecde089c7527bd5093114e8e0e1c3f0e52b1" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "portable-atomic" -version = "1.4.2" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" +checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "pq-sys" -version = "0.4.8" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +checksum = "3b845d6d8ec554f972a2c5298aad68953fd64e7441e846075450b44656a016d1" dependencies = [ "vcpkg", ] @@ -10909,9 +10828,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "2.1.5" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" dependencies = [ "difflib", "float-cmp", @@ -10923,15 +10842,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032" dependencies = [ "predicates-core", "termtree", @@ -10949,32 +10868,33 @@ dependencies = [ [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "c89f989ac94207d048d92db058e4f6ec7342b0971fc58d1271ca148b799b3563" dependencies = [ + "ansi_term", + "ctor", "diff", - "yansi", + "output_vt100", ] [[package]] name = "prettydiff" -version = "0.6.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff1fec61082821f8236cf6c0c14e8172b62ce8a72a0eedc30d3b247bb68dc11" +checksum = "d593ade80c7e334ad6bffbe003afac07948b88a0ae41aa321a5cd87abf260928" dependencies = [ "ansi_term", - "pad", ] [[package]] name = "prettyplease" -version = "0.2.12" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +checksum = "3b69d39aab54d069e7f2fe8cb970493e7834601ca2d8c65fd7bbd183578080d1" dependencies = [ - "proc-macro2 1.0.66", - "syn 2.0.28", + "proc-macro2 1.0.64", + "syn 2.0.25", ] [[package]] @@ -11016,12 +10936,13 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ "once_cell", - "toml_edit 0.19.14", + "thiserror", + "toml 0.5.9", ] [[package]] @@ -11031,9 +10952,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", "version_check", ] @@ -11043,16 +10964,16 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "version_check", ] [[package]] name = "proc-macro-hack" -version = "0.5.20+deprecated" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" @@ -11071,18 +10992,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] [[package]] name = "procfs" -version = "0.14.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" +checksum = "2dfb6451c91904606a1abe93e83a8ec851f45827fa84273f256ade45dc095818" dependencies = [ "bitflags 1.3.2", "byteorder", @@ -11090,7 +11011,7 @@ dependencies = [ "flate2", "hex", "lazy_static 1.4.0", - "rustix 0.36.15", + "rustix 0.35.9", ] [[package]] @@ -11101,15 +11022,15 @@ checksum = "8bccbff07d5ed689c4087d20d7307a52ab6141edeedf487c3876a55b86cf63df" [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "b7f64969ffd5dd8f39bd57a68ac53c163a095ed9d0fb707146da1b27025a3504" dependencies = [ "cfg-if", "fnv", "lazy_static 1.4.0", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.11.2", "thiserror", ] @@ -11120,9 +11041,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ae2f6a3f14ff35c16b51ac796d1dc73c15ad6472c48836c6c467f6d52266648" dependencies = [ "reqwest", - "serde 1.0.183", + "serde 1.0.149", "serde_json", - "time 0.3.25", + "time 0.3.24", "url", ] @@ -11140,22 +11061,22 @@ dependencies = [ [[package]] name = "proptest" -version = "1.2.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" +checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" dependencies = [ "bit-set", "bitflags 1.3.2", "byteorder", "lazy_static 1.4.0", - "num-traits 0.2.16", + "num-traits 0.2.15", + "quick-error 2.0.1", "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.6.29", + "regex-syntax", "rusty-fork", "tempfile", - "unarray", ] [[package]] @@ -11187,9 +11108,9 @@ checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -11207,7 +11128,7 @@ version = "0.1.0" dependencies = [ "anyhow", "chrono", - "clap 4.3.21", + "clap 4.3.5", "codespan-reporting", "hex", "itertools", @@ -11217,9 +11138,9 @@ dependencies = [ "move-prover", "move-prover-boogie-backend", "move-stackless-bytecode", - "num 0.4.1", + "num 0.4.0", "plotters", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "simplelog", "z3tracer", @@ -11241,31 +11162,22 @@ dependencies = [ "atty", "config", "directories", - "petgraph 0.6.3", - "serde 1.0.183", + "petgraph 0.6.2", + "serde 1.0.149", "serde-value", "tint", ] [[package]] name = "publicsuffix" -version = "2.2.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" +checksum = "aeeedb0b429dc462f30ad27ef3de97058b060016f47790c066757be38ef792b4" dependencies = [ - "idna 0.3.0", + "idna 0.2.3", "psl-types", ] -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - [[package]] name = "qstring" version = "0.7.2" @@ -11286,7 +11198,7 @@ dependencies = [ "mach", "once_cell", "raw-cpuid", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.10.0+wasi-snapshot-preview1", "web-sys", "winapi 0.3.9", ] @@ -11297,6 +11209,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-xml" version = "0.22.0" @@ -11313,7 +11231,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" dependencies = [ "memchr", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -11323,7 +11241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f50b1c63b38611e7d4d7f68b82d3ad0cc71a2ad2e7f61fc10f1328d917c93cd" dependencies = [ "memchr", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -11337,11 +11255,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.64", ] [[package]] @@ -11427,7 +11345,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.7", ] [[package]] @@ -11478,9 +11396,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "10.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "6aa2540135b6a94f74c7bc90ad4b794f822026a894f3d7bcd185c100d13d4ad6" dependencies = [ "bitflags 1.3.2", ] @@ -11493,19 +11411,21 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.7.0" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ + "autocfg", + "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -11531,7 +11451,7 @@ dependencies = [ "ryu", "sha1_smol", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "url", ] @@ -11554,56 +11474,46 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_users" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.7", + "redox_syscall", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.19" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" +checksum = "ed13bcd201494ab44900a96490291651d200730904221832b9547d24a87d332b" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.19" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" +checksum = "5234cd6063258a5e32903b53b1b6ac043a0541c8adc1f610f67b0326c7a578fa" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "regex" -version = "1.9.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-syntax", ] [[package]] @@ -11612,39 +11522,31 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.4", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] -name = "regex-syntax" -version = "0.7.4" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi 0.3.9", +] [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" dependencies = [ - "base64 0.21.2", + "base64 0.13.0", "bytes", "cookie", "cookie_store", @@ -11655,72 +11557,69 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", + "lazy_static 1.4.0", "log", "mime", "mime_guess", "native-tls", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.6", - "rustls-pemfile 1.0.3", - "serde 1.0.183", + "proc-macro-hack", + "rustls 0.20.6", + "rustls-pemfile 1.0.1", + "serde 1.0.149", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", - "tokio-util 0.7.8", + "tokio-rustls 0.23.4", + "tokio-util 0.7.3", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", - "webpki-roots 0.22.6", + "webpki-roots 0.22.4", "winreg", ] [[package]] name = "reqwest-middleware" -version = "0.2.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff44108c7925d082f2861e683a88618b68235ad9cdc60d64d9d1188efc951cdb" +checksum = "4a1c03e9011a8c59716ad13115550469e081e2e9892656b0ba6a47c907921894" dependencies = [ "anyhow", "async-trait", "http", "reqwest", - "serde 1.0.183", + "serde 1.0.149", "task-local-extensions", "thiserror", ] [[package]] name = "reqwest-retry" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d0fd6ef4c6d23790399fe15efc8d12cd9f3d4133958f9bd7801ee5cbaec6c4" +checksum = "db161043fcfae3bdf30768bb1fa833853cd55ddf2411b1acb03e0c72bf86a9ea" dependencies = [ "anyhow", "async-trait", "chrono", "futures", - "getrandom 0.2.10", "http", "hyper", - "parking_lot 0.11.2", "reqwest", "reqwest-middleware", "retry-policies", "task-local-extensions", "tokio", "tracing", - "wasm-timer", ] [[package]] @@ -11731,9 +11630,9 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "retry-policies" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09bbcb5003282bcb688f0bae741b278e9c7e8f378f561522c9806c58e075d9b" +checksum = "47f9e19b18c6cdd796cc70aea8a9ea5ee7b813be611c6589e3624fcdbfd05f9d" dependencies = [ "anyhow", "chrono", @@ -11808,9 +11707,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -11834,7 +11733,7 @@ dependencies = [ "num-bigint-dig", "num-integer", "num-iter", - "num-traits 0.2.16", + "num-traits 0.2.15", "pkcs1", "pkcs8 0.8.0", "rand_core 0.6.4", @@ -11862,10 +11761,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5015e68a0685a95ade3eee617ff7101ab6a3fc689203101ca16ebc16f2b89c66" dependencies = [ "cfg-if", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "rustc_version", - "syn 1.0.109", + "syn 1.0.105", ] [[package]] @@ -11876,9 +11775,9 @@ checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc-hash" @@ -11903,50 +11802,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.15" +version = "0.35.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" +checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" dependencies = [ "bitflags 1.3.2", "errno", - "io-lifetimes", + "io-lifetimes 0.7.3", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "linux-raw-sys 0.0.46", + "windows-sys 0.36.1", ] [[package]] name = "rustix" -version = "0.37.23" +version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ "bitflags 1.3.2", "errno", - "io-lifetimes", + "io-lifetimes 1.0.9", "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" -dependencies = [ - "bitflags 2.3.3", - "errno", - "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" dependencies = [ "log", "ring", @@ -11956,24 +11842,24 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "log", "ring", - "rustls-webpki 0.101.3", + "rustls-webpki 0.101.1", "sct", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.1", "schannel", "security-framework", ] @@ -11984,7 +11870,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", ] [[package]] @@ -11993,16 +11879,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" dependencies = [ - "base64 0.21.2", + "base64 0.13.0", ] [[package]] @@ -12017,9 +11903,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.3" +version = "0.101.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" dependencies = [ "ring", "untrusted", @@ -12027,9 +11913,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "rusty-fork" @@ -12038,16 +11924,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error", + "quick-error 1.2.3", "tempfile", "wait-timeout", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "safe_arch" @@ -12087,40 +11973,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ - "windows-sys 0.48.0", + "lazy_static 1.4.0", + "windows-sys 0.36.1", ] [[package]] name = "scheduled-thread-pool" -version = "0.2.7" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" +checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" dependencies = [ "parking_lot 0.12.1", ] [[package]] name = "scoped-tls" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" [[package]] name = "scopeguard" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" @@ -12155,9 +12048,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -12168,9 +12061,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -12183,7 +12076,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b28d58e73c427061f46c801176f54349be3c1a2818cf549e1d9bcac37eef7bca" dependencies = [ "hyper", - "indicatif 0.17.6", + "indicatif 0.17.3", "log", "quick-xml 0.22.0", "regex", @@ -12196,16 +12089,16 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" [[package]] name = "sender" version = "0.1.0" dependencies = [ "bytes", - "clap 4.3.21", + "clap 4.3.5", "event-listener", "quanta", "tokio", @@ -12219,9 +12112,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] @@ -12236,7 +12129,7 @@ dependencies = [ "heck 0.3.3", "include_dir 0.6.2", "maplit", - "serde 1.0.183", + "serde 1.0.149", "serde-reflection", "serde_bytes", "serde_yaml 0.8.26", @@ -12262,7 +12155,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12c47087018ec281d1cdab673d36aea22d816b54d498264029c05d5fa1910da6" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -12272,7 +12165,7 @@ version = "0.3.5" source = "git+https://github.com/aptos-labs/serde-reflection?rev=839aed62a20ddccf043c08961cfe74875741ccba#839aed62a20ddccf043c08961cfe74875741ccba" dependencies = [ "once_cell", - "serde 1.0.183", + "serde 1.0.149", "thiserror", ] @@ -12283,16 +12176,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" dependencies = [ "ordered-float", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "cfc50e8183eeeb6178dcb167ae34a8051d63535023ae38b5d8d12beae193d37b" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -12302,30 +12195,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ "half 1.8.2", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ - "indexmap 2.0.0", + "indexmap", "itoa", "ryu", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -12334,7 +12227,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "606e91878516232ac3b16c12e063d4468d762f16d77e7aef14a1f2326c5f409b" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "serde_json", "thiserror", ] @@ -12346,27 +12239,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" dependencies = [ "regex", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -12378,7 +12271,7 @@ dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -12387,22 +12280,22 @@ version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "indexmap 1.9.3", + "indexmap", "ryu", - "serde 1.0.183", + "serde 1.0.149", "yaml-rust", ] [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "7a09f551ccc8210268ef848f0bab37b306e87b85b2e017b899e7fb815f5aed62" dependencies = [ - "indexmap 2.0.0", + "indexmap", "itoa", "ryu", - "serde 1.0.183", + "serde 1.0.149", "unsafe-libyaml", ] @@ -12413,7 +12306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" dependencies = [ "base16ct", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -12428,9 +12321,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if", "cpufeatures", @@ -12469,9 +12362,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", @@ -12505,9 +12398,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.8" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ "digest 0.10.7", "keccak", @@ -12522,7 +12415,7 @@ dependencies = [ "const_format", "git2 0.15.0", "is_debug", - "time 0.3.25", + "time 0.3.24", "tzdb", ] @@ -12549,9 +12442,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.17" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" dependencies = [ "libc", "signal-hook-registry", @@ -12570,18 +12463,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] [[package]] name = "signature" -version = "1.6.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "f0ea32af43239f0d353a7dd75a22d94c329c8cdaafdcb4c1c1335aa10c298a4a" [[package]] name = "signature" @@ -12600,25 +12493,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" dependencies = [ "approx", - "num-complex 0.4.3", - "num-traits 0.2.16", + "num-complex 0.4.2", + "num-traits 0.2.15", "paste", "wide", ] [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" [[package]] name = "similar" -version = "2.2.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" dependencies = [ - "bstr 0.2.17", + "bstr", "unicode-segmentation", ] @@ -12640,7 +12533,7 @@ checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b" dependencies = [ "chrono", "num-bigint 0.2.6", - "num-traits 0.2.16", + "num-traits 0.2.15", ] [[package]] @@ -12650,9 +12543,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.3", - "num-traits 0.2.16", + "num-traits 0.2.15", "thiserror", - "time 0.3.25", + "time 0.3.24", ] [[package]] @@ -12684,9 +12577,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ "autocfg", ] @@ -12713,9 +12606,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "smawk" @@ -12760,7 +12653,7 @@ dependencies = [ "aptos-vm-genesis", "aptos-writeset-generator", "async-trait", - "base64 0.13.1", + "base64 0.13.0", "bcs 0.1.4", "diesel", "futures", @@ -12793,9 +12686,9 @@ dependencies = [ [[package]] name = "snafu" -version = "0.7.5" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" +checksum = "cb0656e7e3ffb70f6c39b3c2a86332bb74aa3c679da781642590f3c1118c5045" dependencies = [ "doc-comment", "snafu-derive", @@ -12803,14 +12696,14 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.7.5" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" +checksum = "475b3bbe5245c26f2d8a6f62d67c1f30eb9fffeccee721c45d162c3ebbdf81b2" dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "heck 0.4.0", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -12831,9 +12724,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.8" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" dependencies = [ "lock_api", ] @@ -12894,9 +12787,9 @@ checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" [[package]] name = "string_cache" -version = "0.8.7" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" dependencies = [ "new_debug_unreachable", "once_cell", @@ -12936,9 +12829,9 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck 0.3.3", "proc-macro-error", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -12953,11 +12846,11 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.66", - "quote 1.0.32", + "heck 0.4.0", + "proc-macro2 1.0.64", + "quote 1.0.29", "rustversion", - "syn 1.0.109", + "syn 1.0.105", ] [[package]] @@ -12985,31 +12878,43 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.109" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.28" +version = "2.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.64", + "quote 1.0.29", "unicode-ident", ] [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", + "unicode-xid 0.2.3", +] [[package]] name = "sysinfo" @@ -13034,31 +12939,32 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "task-local-extensions" -version = "0.1.4" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" +checksum = "36794203e10c86e5998179e260869d156e0674f02d5451b4a3fb9fd86d02aaab" dependencies = [ - "pin-utils", + "tokio", ] [[package]] name = "tempfile" -version = "3.7.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", - "fastrand 2.0.0", - "redox_syscall 0.3.5", - "rustix 0.38.7", - "windows-sys 0.48.0", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.9", ] [[package]] name = "tera" -version = "1.17.1" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df578c295f9ec044ff1c829daf31bb7581d5b3c2a7a3d87419afe1f2531438c" +checksum = "1d4685e72cb35f0eb74319c8fe2d3b61e93da5609841cde2cb87fcc3bea56d20" dependencies = [ "chrono", "chrono-tz", @@ -13070,7 +12976,7 @@ dependencies = [ "pest_derive", "rand 0.8.5", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "slug", "unic-segment", @@ -13096,19 +13002,29 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "termtree" -version = "0.4.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" [[package]] name = "test-generation" version = "0.1.0" dependencies = [ - "clap 4.3.21", + "clap 4.3.5", "crossbeam-channel", - "getrandom 0.2.10", + "getrandom 0.2.7", "hex", "itertools", "module-generation", @@ -13148,9 +13064,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" dependencies = [ "smawk", "unicode-linebreak", @@ -13165,31 +13081,30 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ - "cfg-if", "once_cell", ] @@ -13204,9 +13119,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.9.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471" dependencies = [ "flate2", "jpeg-decoder", @@ -13215,25 +13130,26 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] [[package]] name = "time" -version = "0.3.25" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "b79eabcd964882a646b3584543ccabeae7869e9ac32a46f6f22b7a5bd405308b" dependencies = [ "deranged", "itoa", "libc", "num_threads", - "serde 1.0.183", + "serde 1.0.149", "time-core", "time-macros", ] @@ -13296,7 +13212,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "serde_json", ] @@ -13311,20 +13227,20 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.29.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", - "backtrace", "bytes", "libc", + "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -13333,7 +13249,7 @@ dependencies = [ "socket2", "tokio-macros", "tracing", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] @@ -13348,13 +13264,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -13370,9 +13286,9 @@ dependencies = [ [[package]] name = "tokio-native-tls" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", "tokio", @@ -13395,7 +13311,7 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.8", + "rustls 0.20.6", "tokio", "webpki", ] @@ -13406,15 +13322,15 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.6", + "rustls 0.21.5", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" dependencies = [ "futures-core", "pin-project-lite", @@ -13462,9 +13378,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" dependencies = [ "bytes", "futures-core", @@ -13477,32 +13393,32 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "toml" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "serde_spanned", "toml_datetime", - "toml_edit 0.19.14", + "toml_edit 0.19.10", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", ] [[package]] @@ -13512,19 +13428,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f" dependencies = [ "combine", - "indexmap 1.9.3", + "indexmap", "itertools", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ - "indexmap 2.0.0", - "serde 1.0.183", + "indexmap", + "serde 1.0.149", "serde_spanned", "toml_datetime", "winnow", @@ -13538,8 +13454,8 @@ checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", - "axum 0.6.20", - "base64 0.13.1", + "axum 0.6.18", + "base64 0.13.0", "bytes", "flate2", "futures-core", @@ -13554,11 +13470,11 @@ dependencies = [ "prost", "prost-derive", "rustls-native-certs", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.1", "tokio", "tokio-rustls 0.23.4", "tokio-stream", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "tower", "tower-layer", "tower-service", @@ -13574,7 +13490,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-stream", "async-trait", - "axum 0.6.20", + "axum 0.6.18", "base64 0.21.2", "bytes", "flate2", @@ -13588,7 +13504,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.1", "tokio", "tokio-rustls 0.24.1", "tokio-stream", @@ -13621,13 +13537,13 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.3", + "indexmap", "pin-project", "pin-project-lite", "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "tower-layer", "tower-service", "tracing", @@ -13639,7 +13555,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aba3f3efabf7fb41fae8534fc20a817013dd1c12cb45441efb6c82e6556b4cd8" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "bitflags 1.3.2", "bytes", "futures-core", @@ -13655,9 +13571,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" dependencies = [ "bitflags 1.3.2", "bytes", @@ -13690,16 +13606,16 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ad0c048e114d19d1140662762bfdb10682f3bc806d8be18af846600214dd9af" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", "log", @@ -13710,13 +13626,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -13756,7 +13672,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ - "serde 1.0.183", + "serde 1.0.149", "tracing-core", ] @@ -13770,7 +13686,7 @@ dependencies = [ "nu-ansi-term", "once_cell", "regex", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "sharded-slab", "smallvec", @@ -13802,20 +13718,20 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "trybuild" -version = "1.0.82" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84e0202ea606ba5ebee8507ab2bfbe89b98551ed9b8f0be198109275cff284b" +checksum = "501dbdbb99861e4ab6b60eb6a7493956a9defb644fd034bc4a5ef27c693c8a3a" dependencies = [ "basic-toml", "glob", "once_cell", - "serde 1.0.183", + "serde 1.0.149", "serde_derive", "serde_json", "termcolor", @@ -13840,7 +13756,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "byteorder", "bytes", "http", @@ -13861,9 +13777,9 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.16.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "tz-rs" @@ -13876,20 +13792,22 @@ dependencies = [ [[package]] name = "tzdb" -version = "0.4.11" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f48b62818c5967d8ae198fc6fb794bb65cd82ab5edb86bc25bc64f97102765" +checksum = "a87d58ddb21cda9e2236e99f1f27e7094334aae4cd580dd8f5ffa137580de61a" dependencies = [ "iana-time-zone", + "phf", + "phf_shared 0.11.1", "tz-rs", "utcnow", ] [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c" [[package]] name = "uint" @@ -13903,17 +13821,11 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - [[package]] name = "uncased" -version = "0.9.9" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68" +checksum = "09b01702b0fd0b3fadcf98e098780badda8742d4f4a7676615cad90e8ac73622" dependencies = [ "version_check", ] @@ -13985,15 +13897,18 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-linebreak" -version = "0.1.5" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" +checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" +dependencies = [ + "regex", +] [[package]] name = "unicode-normalization" @@ -14006,15 +13921,15 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -14024,25 +13939,25 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "universal-hash" -version = "0.5.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "crypto-common", + "generic-array 0.14.7", "subtle", ] [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "931179334a56395bcf64ba5e0ff56781381c1a5832178280c7d7f91d1679aeb0" [[package]] name = "untrusted" @@ -14052,17 +13967,17 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "1.5.5" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8b063c2d59218ae09f22b53c42eaad0d53516457905f5235ca4bc9e99daa71" +checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" dependencies = [ - "base64 0.13.1", + "base64 0.13.0", "chunked_transfer", "log", "native-tls", "once_cell", "qstring", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "url", ] @@ -14076,27 +13991,26 @@ dependencies = [ "form_urlencoded", "idna 0.4.0", "percent-encoding", - "serde 1.0.183", + "serde 1.0.149", ] [[package]] name = "urlencoding" -version = "2.1.3" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" [[package]] name = "utcnow" -version = "0.2.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b546786c9425e6f3b43b2e28c58a7432fb81c5426e290f691d478a90db3c3f" +checksum = "80b49db848e09c50db9e7d15aee89030b6ebb8c55e77aff2cef22aeb6844c8b5" dependencies = [ - "autocfg", "const_fn", "errno", "js-sys", "libc", - "rustix 0.37.23", + "rustix 0.35.9", "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", "winapi 0.3.9", @@ -14116,12 +14030,12 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f" dependencies = [ - "getrandom 0.2.10", - "serde 1.0.183", + "getrandom 0.2.7", + "serde 1.0.149", ] [[package]] @@ -14132,9 +14046,13 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.1" +version = "1.0.0-alpha.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] [[package]] name = "variant_count" @@ -14142,8 +14060,8 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae2faf80ac463422992abf4de234731279c058aaf33171ca70277c98406b124" dependencies = [ - "quote 1.0.32", - "syn 1.0.109", + "quote 1.0.29", + "syn 1.0.105", ] [[package]] @@ -14191,10 +14109,11 @@ dependencies = [ [[package]] name = "want" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ + "log", "try-lock", ] @@ -14216,16 +14135,16 @@ dependencies = [ "multer", "percent-encoding", "pin-project", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.1", "scoped-tls", - "serde 1.0.183", + "serde 1.0.149", "serde_json", "serde_urlencoded", "tokio", "tokio-rustls 0.23.4", "tokio-stream", "tokio-tungstenite", - "tokio-util 0.7.8", + "tokio-util 0.7.3", "tower-service", "tracing", ] @@ -14252,9 +14171,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasi" @@ -14264,9 +14183,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -14274,24 +14193,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ "cfg-if", "js-sys", @@ -14301,45 +14220,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ - "quote 1.0.32", + "quote 1.0.29", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "wasm-streams" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "wasm-timer" @@ -14358,9 +14264,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", @@ -14378,9 +14284,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" dependencies = [ "webpki", ] @@ -14400,22 +14306,31 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "which" -version = "4.4.0" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" dependencies = [ "either", + "lazy_static 1.4.0", "libc", - "once_cell", ] [[package]] name = "whoami" -version = "1.4.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "524b58fa5a20a2fb3014dd6358b70e6579692a56ef6fce928834e488f42f65e8" dependencies = [ "wasm-bindgen", "web-sys", @@ -14475,12 +14390,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-sys" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows-targets 0.48.1", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] [[package]] @@ -14498,7 +14417,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.0", ] [[package]] @@ -14518,9 +14437,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", @@ -14543,6 +14462,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -14555,6 +14480,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -14567,6 +14498,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -14579,6 +14516,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -14603,6 +14546,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -14617,9 +14566,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" dependencies = [ "memchr", ] @@ -14667,12 +14616,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "yup-oauth2" version = "7.0.1" @@ -14681,20 +14624,20 @@ checksum = "98748970d2ddf05253e6525810d989740334aa7509457864048a829902db76f3" dependencies = [ "anyhow", "async-trait", - "base64 0.13.1", + "base64 0.13.0", "futures", "http", "hyper", - "hyper-rustls 0.23.2", + "hyper-rustls", "itertools", "log", "percent-encoding", - "rustls 0.20.8", + "rustls 0.20.6", "rustls-pemfile 0.3.0", "seahash", - "serde 1.0.183", + "serde 1.0.149", "serde_json", - "time 0.3.25", + "time 0.3.24", "tokio", "tower-service", "url", @@ -14722,37 +14665,37 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.4.2" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.64", + "quote 1.0.29", + "syn 1.0.105", + "synstructure", ] [[package]] name = "zip" -version = "0.6.6" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "0445d0fbc924bb93539b4316c11afb121ea39296f99a3c4c9edad09e3658cdef" dependencies = [ "byteorder", "crc32fast", "crossbeam-utils", "flate2", - "time 0.3.25", + "time 0.3.24", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", "libc", - "pkg-config", ] [[package]] From 9ab417045a8a44cf6e9ec58ff67067833c3da209 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Fri, 11 Aug 2023 09:06:58 -0500 Subject: [PATCH 17/37] small edits --- Cargo.lock | 16 ---------------- Cargo.toml | 2 +- crates/aptos-crypto/Cargo.toml | 2 -- .../unit_tests/p256_test.txt | 14 ++++++++++++++ crates/aptos-crypto/src/p256/p256_keys.rs | 2 +- types/src/transaction/authenticator.rs | 5 ----- 6 files changed, 16 insertions(+), 25 deletions(-) create mode 100644 crates/aptos-crypto/proptest-regressions/unit_tests/p256_test.txt diff --git a/Cargo.lock b/Cargo.lock index 062aeafab558b..dd9583a68b44c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -828,7 +828,6 @@ dependencies = [ "rand 0.7.3", "rand_core 0.5.1", "ring", - "sec1", "serde 1.0.149", "serde-name", "serde_bytes", @@ -6116,7 +6115,6 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "serdect", "signature 2.1.0", "spki 0.7.2", ] @@ -6180,7 +6178,6 @@ dependencies = [ "pkcs8 0.10.2", "rand_core 0.6.4", "sec1", - "serdect", "subtle", "zeroize", ] @@ -10237,7 +10234,6 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "serdect", "sha2 0.10.6", ] @@ -10904,7 +10900,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" dependencies = [ "elliptic-curve", - "serdect", ] [[package]] @@ -12041,7 +12036,6 @@ dependencies = [ "der 0.7.8", "generic-array 0.14.7", "pkcs8 0.10.2", - "serdect", "subtle", "zeroize", ] @@ -12299,16 +12293,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde 1.0.149", -] - [[package]] name = "serializer-tests" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index d70a455c46145..790f63016ca31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -536,7 +536,7 @@ once_cell = "1.10.0" ouroboros = "0.15.6" owo-colors = "3.5.0" # TODO: Do we actually use serde? -p256 = { version = "0.13.2", features = ["serde"] } +p256 = { version = "0.13.2" } #, features = ["serde"] } signature = "2.1.0" sec1 = "0.7.0" parking_lot = "0.12.0" diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index d7759ee9404c2..21017519087f1 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -47,8 +47,6 @@ thiserror = { workspace = true } tiny-keccak = { workspace = true } x25519-dalek = { workspace = true } p256 = { workspace = true } -# TODO: Remove this? -sec1 = {workspace = true } signature = { workspace = true } [dev-dependencies] diff --git a/crates/aptos-crypto/proptest-regressions/unit_tests/p256_test.txt b/crates/aptos-crypto/proptest-regressions/unit_tests/p256_test.txt new file mode 100644 index 0000000000000..b6550c3d61793 --- /dev/null +++ b/crates/aptos-crypto/proptest-regressions/unit_tests/p256_test.txt @@ -0,0 +1,14 @@ +# Seeds for failure cases proptest has generated in the past. It is +# automatically read and these particular cases re-run before any +# novel cases are generated. +# +# It is recommended to check this file in to source control so that +# everyone who runs the test benefits from these saved cases. +cc 539e60874bc331d8b4664a1cc6cc906579f5fb3547428adbc6cbeea2a28e31ea # shrinks to keypair = 2023e235b5da887e01fab303e0cfffc959952c02d787bb2dfca7163fd05e0205ca41046a6b82adba722f31d51689afba24566a94ec37fc32d0ff520a5e6287fe75cd8271ea1489a22ee93b8568526fa93589ece0301fb9312cde1ef2778feaeb5c9168 +cc 84b533dd1f5cd9430aa1d8428646fbb73e1ee314be8317faa448117c680c1606 # shrinks to keypair = 2071a0cbcf6abcc57ac335c7b93ba478ed6b3eec8fb2c03761ef5f872696b38d334104cd791851816b4d18c8da299442a924fd8a7b86a5093b026d0052820560ece21df8149f42fed9460a04aeedc55630f4fcc08744fee4eaf9a3b6025ffc2b5cd73a +cc 1f0606f82d939fa43037a1ae1e104a6af5fcb17495a60acb727bc4d434c7ebc5 # shrinks to message = TestAptosCrypto("𐛚"), keypair = 20fca559cbb362e02384a4b09da66e5704131fcae30f0d4c4f7280bd7b6dc0f1ae4104ffa0b95e042e600449c5512db882b8698038149b3774254b2f554a289a99fe913c4a16bde282e3c27303597a9f63f7a6741efba82535cc42f65e7377224e71a9 +cc aa831748c8a3c9291a059cf7f146c8953a6d40ca772d417bc048a56d113ef947 # shrinks to x = 2114806089028681516, keypair = 200c125a0ee13b47d0248b551ad5a60bfd282d7c3189f9c411bc403765cad0c9ef4104dd6ad49f1f4162d22aba9c60f06ed68318f6538247b7fdfa99f05bd91ebf98daad39422a5d438ede4f0425acf20066a7aa53a2f171e885cf5365047ec4dbd09b +cc 482c9720ccab5338952c69ef05921d0a515c4cc1b412940383104cb580160fcf # shrinks to message = TestAptosCrypto(""), keypairs = [208b5526f3f5713933435a7cf9845720731661a848a100e35c90e0b39bf2b5951841040fd99726d76fae26119a5944808f344c2a78827b191b4762a8da4c4af78a1e2c39dfbb0cd47daf67781fd4844b706ffafc661fc9754a626b5820db299b6d7bce, 20afea7aa686b48be0949edc4eeffdaaac21d809a6b4bc2b04ea3ef289baf2b0d441041640a5468342d07b90246e2e3dc7b0c42c040f72e43dfc23e56531e3605190e1744632e74189d926f753801ae7df2951f4980e1bb8991c2cc9bdde48a79bcb3c, 205362b2d8ee3e3a45610b6d6827be860cef542fa6cfd04c5a3179742acb44201e4104a7c5b9892202dedbbc0c62da87ddf87bc353f6d8fc504c32aaab0475906165864edc3172aae096255787c8cd771a7b0a9a50cf00ffe6983271cdd7f55e209283, 20dc03d77ece8f3c465eee9251debed8caacf085c1d9db798f180dbf3ad2cb466741045b10ee95d307da8855743c537f9220caa1b9c46fa38dd1cea04bb376e034e3a4a68d227dbd81529cb794cf518ab45e64bb03bf4ad17fba5b5895ad463f91432b, 20bf72e06870b080ecb993f582b890e1622e0d74e675f5e861b5fa4678f3d520624104d6524bfb7ef7d0537b8430a923e6ce0d0c601725b611a9c845a4144e522a45079da32127ad93903c2243219458f61d4faa84165e936e9a1e9e3eb197a5f8cbc3, 200117adf8da18d89d85920057dfe74b8fc984aae97f77b98f721473c3ebbcc63e4104d24e193cd8507b68295dd68df185c4ebac4b976f43dd9af8bd31bc2290211bd9ab455c8ba1d9d0760ff4d896e90399ff175bb731d355084e01901805caae397b, 204771b8a594584e6bc2d74fdd0889c50074efdcb9db77ec3868736cda0244ab984104683ec98cd47981a6c9fd4dff14d834aff1e6d670f0de4c622ba6d2a733f1970b296fac0d03ab9afc1e11d6667259199705897befd74b4307d32fe7615c234582, 201a01076284a879796d503e73e8865b0aea6cb3d41d3189b121ab84933a86166b41045b59bc55ab9f39404c59692b0f37bbf856c26959c1b9d3265ae2d585eb9aebae950f39d0ae1a0811cc8bc04782d53ee3cb12ab4511576b58a12a689a3780e303, 20829bcb79633ec7a761110499bb6f1b100880e489a27bb2e2e10a3771dbbc35294104cfa6f78c73a5026508819797d2e725c045eef7ee8217b95dbca078e46bc624024fb8287c5e23a8da0e1bc7c42d54323f69c1fd98e80310287f98642af2917dbe, 2088336ef311e8adc58a77bf41dbe24a1cd3a6a125302aa6f7ef4a489e12dc6622410450cf7c8ee6778b6e92ab0e520f1c4cb6ff7df86772e8c1c9f33066193caed9bc305bac4fa8e3b6c187975608d3ccdbaaa95dc1baa732e89e848e2b049dd3e6e3] +cc 19487dcfe0f0e04e72c2065fb69c14ebd14adb8ea6ff9d70e1985ea325538fa1 # shrinks to msg = [65, 247, 56, 10, 230, 149, 73, 158, 144, 90, 166, 195, 70, 177, 6, 252, 86, 41, 56, 120, 40, 240, 224, 40, 127, 4, 219, 180, 253, 43, 93, 10, 217, 145, 155, 191, 132, 87, 87, 14, 169, 89, 206, 34, 39, 231, 149, 131, 204, 89, 79, 195, 9, 42, 62, 54, 63, 153, 183, 218, 198, 40, 131, 184, 228, 171, 68, 78, 46, 247, 38, 61, 109, 181, 46, 231, 174, 225, 187, 185, 71, 11, 197, 236, 239], keypair = 208f6aa70033d75374c9a898a184676eea8aa68060bdd01b889f2e046ee96d8cbb4104fe66b01f689f42071baf915ae70e75f75349b78fa320abe6c8109a88f678f04de9f5570372371d88dba0d377b37f663f2338aa63f21ca865d7e9ba56d71e66c6 +cc c0d5a00a2bfb7c18d4188babea8347983ad0b3027e5e4fd3c512ca1bab1bf417 # shrinks to message = TestAptosCrypto("&\"��9&𑥕\u{1d1ac}�₡"), keypair = 20f2ec360701a1027c67f237a8ced9e21d6ae058096435ee0032d5433c9997fca1410406928fcae4da8fbc63dcea3d60f4951fda1a9e17bc59ffde55e0d65de32684d75aeed4177885916e48713179a656e50a5b107372b53d10d25c885bbac1c270be +cc 8b646e2a1ab153933cafb58c017e87f0151c4f7c8438ca74ff34b0b3192f33aa # shrinks to message = TestAptosCrypto("Iೲೀ𑤷ລ\\<\u{1ac1}𖮈¥𞺧?xÁ𛅕T.$s:ዃ/?Ὅ\\<*יּ𐭜𐠈"), keypair = 20e83972f72633e4acce41281cd87c99267966dd0bae421dde66f5e1e8ffdfc78d4104af06935d9a454ed97a0471a2338a2273619cb094774a696bc9faeabcbd067f46cdf3ea6fd7e31375a779c54053c3b111ed5ebd3ae719b3611141b5c97b8033d5 diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index 8ae38cea10f07..7c833a629fff9 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -1,7 +1,7 @@ // Copyright © Aptos Foundation // SPDX-License-Identifier: Apache-2.0 -//! This file implements traits for Ed25519 private keys and public keys. +//! This file implements traits for P256 private keys and public keys. #[cfg(any(test, feature = "fuzzing"))] use crate::test_utils::{self, KeyPair}; diff --git a/types/src/transaction/authenticator.rs b/types/src/transaction/authenticator.rs index 5fd8ec6db5ac6..400ca8a90360e 100644 --- a/types/src/transaction/authenticator.rs +++ b/types/src/transaction/authenticator.rs @@ -46,11 +46,6 @@ pub enum TransactionAuthenticator { public_key: Ed25519PublicKey, signature: Ed25519Signature, }, - /// Single signature - /*P256 { - public_key: P256PublicKey, - signature: P256PublicKey, - },*/ /// K-of-N multisignature MultiEd25519 { public_key: MultiEd25519PublicKey, From e9e1846c268d42ef73c0c4c1cdd407b0c398e108 Mon Sep 17 00:00:00 2001 From: Gerardo Di Giacomo Date: Mon, 14 Aug 2023 12:53:24 -0700 Subject: [PATCH 18/37] Update workflows (#9650) * Update semgrep.yaml to also run daily * update semgrep rule * fix workflows * Update .github/workflows/semgrep.yaml Co-authored-by: Balaji Arun --------- Co-authored-by: Balaji Arun --- .../semgrep/pull-request-target-code-checkout.yaml | 9 +++++++++ .github/workflows/docker-build-test.yaml | 1 + .github/workflows/semgrep.yaml | 2 ++ .github/workflows/ts-sdk-e2e-tests.yaml | 1 + 4 files changed, 13 insertions(+) diff --git a/.github/linters/semgrep/pull-request-target-code-checkout.yaml b/.github/linters/semgrep/pull-request-target-code-checkout.yaml index 1348d505f6c36..a6186a753ab37 100644 --- a/.github/linters/semgrep/pull-request-target-code-checkout.yaml +++ b/.github/linters/semgrep/pull-request-target-code-checkout.yaml @@ -47,6 +47,15 @@ rules: ... $JOBNAME: ... + - pattern-not-inside: | + needs: [..., permission-check, ...] + ... + - pattern-not-inside: | + needs: + ... + - permission-check + ... + ... - pattern-not-inside: | needs: [permission-check] ... diff --git a/.github/workflows/docker-build-test.yaml b/.github/workflows/docker-build-test.yaml index 7240ca7a97a49..82a2a7d900412 100644 --- a/.github/workflows/docker-build-test.yaml +++ b/.github/workflows/docker-build-test.yaml @@ -111,6 +111,7 @@ jobs: # This job determines which files were changed file_change_determinator: + needs: [permission-check] runs-on: ubuntu-latest outputs: only_docs_changed: ${{ steps.determine_file_changes.outputs.only_docs_changed }} diff --git a/.github/workflows/semgrep.yaml b/.github/workflows/semgrep.yaml index 320f35904f60e..9505c7b3b2b9c 100644 --- a/.github/workflows/semgrep.yaml +++ b/.github/workflows/semgrep.yaml @@ -4,6 +4,8 @@ on: workflow_dispatch: pull_request: types: [labeled, opened, synchronize, reopened, auto_merge_enabled] + schedule: + - cron: '0 * * * *' jobs: semgrep: diff --git a/.github/workflows/ts-sdk-e2e-tests.yaml b/.github/workflows/ts-sdk-e2e-tests.yaml index 8a4b53419af29..1a9c168e5dbbf 100644 --- a/.github/workflows/ts-sdk-e2e-tests.yaml +++ b/.github/workflows/ts-sdk-e2e-tests.yaml @@ -34,6 +34,7 @@ jobs: # This job determines which files were changed file_change_determinator: + needs: [permission-check] runs-on: ubuntu-latest outputs: only_docs_changed: ${{ steps.determine_file_changes.outputs.only_docs_changed }} From a397f508c8be30745f4ff9f1a7e37beaaafc05a3 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 13:50:39 -0500 Subject: [PATCH 19/37] fix malleability test --- .../aptos-crypto/src/unit_tests/p256_test.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index f196e7db74577..259d9db8b427c 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -144,42 +144,42 @@ proptest! { // NIST-P256 signing ensures a canonical S value. let s = NonZeroScalar::try_from(&s_bytes[..]).unwrap(); - let order_half = NonZeroScalar::try_from(&ORDER_HALF[..]).unwrap(); - // adding ORDER_HALF (half the order of the base point) so that S + ORDER_HALF > ORDER_HALF - let malleable_s = NonZeroScalar::new(*s + *order_half).unwrap(); + // computing s' = n - s to obtain the non-canonical valid signature over `message` + let malleable_s = NonZeroScalar::new(-*s).unwrap(); let malleable_s_bytes = malleable_s.to_bytes(); // Update the signature (the S part). serialized[32..].copy_from_slice(&malleable_s_bytes); prop_assert_ne!(serialized_old, serialized); - // Check that malleable signatures will pass verification and deserialization in the RustCrypto + // Check that valid non-canonical signatures will pass verification and deserialization in the RustCrypto // p256 crate. // Construct the corresponding RustCrypto p256 public key. let rustcrypto_public_key = p256::ecdsa::VerifyingKey::from_sec1_bytes( &keypair.public_key.to_bytes() ).unwrap(); - // Construct the corresponding RustCrypto p256 Signature. This signature is malleable. + // Construct the corresponding RustCrypto p256 Signature. This signature is valid but + // non-canonical. let rustcrypto_sig = p256::ecdsa::Signature::try_from(&serialized[..]); - // RustCrypto p256 will deserialize the malleable + // RustCrypto p256 will deserialize the non-canonical // signature. It does not detect it. prop_assert!(rustcrypto_sig.is_ok()); - let msg_bytes = bcs::to_bytes(&message); + let msg_bytes = signing_message(&message); prop_assert!(msg_bytes.is_ok()); let rustcrypto_sig = rustcrypto_sig.unwrap(); - // RustCrypto p256 verify will NOT accept the mauled signature - prop_assert!(rustcrypto_public_key.verify(msg_bytes.as_ref().unwrap(), &rustcrypto_sig).is_err()); - // ...therefore, neither will our own P256Signature::verify + // RustCrypto p256 verify WILL accept the mauled signature + prop_assert!(rustcrypto_public_key.verify(msg_bytes.as_ref().unwrap(), &rustcrypto_sig).is_ok()); + // ...however, our own P256Signature::verify will not let sig = P256Signature::from_bytes_unchecked(&serialized).unwrap(); prop_assert!(sig.verify(&message, &keypair.public_key).is_err()); let serialized_malleable: &[u8] = &serialized; - // try_from will fail on malleable signatures. We detect malleable signatures + // try_from will fail on non-canonical signatures. We detect non-canonical signatures // early during deserialization. prop_assert_eq!( P256Signature::try_from(serialized_malleable), @@ -187,7 +187,7 @@ proptest! { ); // We expect from_bytes_unchecked deserialization to succeed, as RustCrypto p256 - // does not check for signature malleability. This method is pub(crate) + // does not check for non-canonical signatures. This method is pub(crate) // and only used for test purposes. let sig_unchecked = P256Signature::from_bytes_unchecked(&serialized); prop_assert!(sig_unchecked.is_ok()); From 718a1628f04484cfa00db8a0f8de17b54fbafb9d Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 13:56:11 -0500 Subject: [PATCH 20/37] edit --- crates/aptos-crypto/src/p256/p256_sigs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index f583217cca0ad..419433cafef49 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -129,7 +129,8 @@ impl Signature for P256Signature { /// Outside of this crate, this particular function should only be used for native signature /// verification in Move. /// - /// This function will check both the signature and `public_key` for small subgroup attacks. + /// Checks for and rejects non-canonical signatures (r,s) where s > (n/2), where n is the group + /// order fn verify_arbitrary_msg(&self, message: &[u8], public_key: &P256PublicKey) -> Result<()> { P256Signature::check_s_malleability(&self.to_bytes())?; From 47f391a3f008f7dd808c3110982beb3fcb9a92a9 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 16:21:00 -0500 Subject: [PATCH 21/37] edits --- crates/aptos-crypto/src/p256/p256_keys.rs | 2 +- crates/aptos-crypto/src/p256/p256_sigs.rs | 2 +- crates/aptos-crypto/src/unit_tests/p256_test.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/p256/p256_keys.rs index 7c833a629fff9..e6b8cac4eef13 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256/p256_keys.rs @@ -64,7 +64,7 @@ impl P256PrivateKey { /// Private function aimed at minimizing code duplication between sign /// methods of the SigningKey implementation. This should remain private. fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { - let secret_key: &p256::ecdsa::SigningKey = &self.0; + let secret_key = &self.0; let sig = P256Signature(secret_key.sign(message.as_ref())); let canonical_sig = P256Signature::make_canonical(&sig); diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/p256/p256_sigs.rs index 419433cafef49..1f1806738c7ab 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256/p256_sigs.rs @@ -82,7 +82,7 @@ impl P256Signature { _ => {}, } } - // As this stage S == ORDER_HALF which implies a non canonical S. + // At this stage S == ORDER_HALF which implies a non canonical S. false } diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/p256_test.rs index 259d9db8b427c..a8bd47707f61a 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/p256_test.rs @@ -56,16 +56,16 @@ proptest! { message in random_serializable_struct(), keypairs in proptest::array::uniform10(uniform_keypair_strategy::()) ) { - let mut signatures: Vec<(P256PublicKey, P256Signature)> = keypairs.iter().map(|keypair| { + let mut pks_and_sigs: Vec<(P256PublicKey, P256Signature)> = keypairs.iter().map(|keypair| { (keypair.public_key.clone(), keypair.private_key.sign(&message).unwrap()) }).collect(); - prop_assert!(P256Signature::batch_verify(&message, signatures.clone()).is_ok()); + prop_assert!(P256Signature::batch_verify(&message, pks_and_sigs.clone()).is_ok()); // We swap message and signature for the last element, // resulting in an incorrect signature - let (key, _sig) = signatures.pop().unwrap(); - let other_sig = signatures.last().unwrap().clone().1; - signatures.push((key, other_sig)); - prop_assert!(P256Signature::batch_verify(&message, signatures).is_err()); + let (pk, _sig) = pks_and_sigs.pop().unwrap(); + let other_sig = pks_and_sigs.last().unwrap().clone().1; + pks_and_sigs.push((pk, other_sig)); + prop_assert!(P256Signature::batch_verify(&message, pks_and_sigs).is_err()); } #[test] From f5430fd564a0e3f93548ac22c0365ac7c726ed62 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 16:25:16 -0500 Subject: [PATCH 22/37] change p256 to ecdsa_p256 --- crates/aptos-crypto/src/{p256 => ecdsa_p256}/mod.rs | 0 crates/aptos-crypto/src/{p256 => ecdsa_p256}/p256_keys.rs | 2 +- crates/aptos-crypto/src/{p256 => ecdsa_p256}/p256_sigs.rs | 2 +- crates/aptos-crypto/src/lib.rs | 2 +- .../src/unit_tests/{p256_test.rs => ecdsa_p256_test.rs} | 2 +- crates/aptos-crypto/src/unit_tests/mod.rs | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename crates/aptos-crypto/src/{p256 => ecdsa_p256}/mod.rs (100%) rename crates/aptos-crypto/src/{p256 => ecdsa_p256}/p256_keys.rs (99%) rename crates/aptos-crypto/src/{p256 => ecdsa_p256}/p256_sigs.rs (98%) rename crates/aptos-crypto/src/unit_tests/{p256_test.rs => ecdsa_p256_test.rs} (98%) diff --git a/crates/aptos-crypto/src/p256/mod.rs b/crates/aptos-crypto/src/ecdsa_p256/mod.rs similarity index 100% rename from crates/aptos-crypto/src/p256/mod.rs rename to crates/aptos-crypto/src/ecdsa_p256/mod.rs diff --git a/crates/aptos-crypto/src/p256/p256_keys.rs b/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs similarity index 99% rename from crates/aptos-crypto/src/p256/p256_keys.rs rename to crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs index e6b8cac4eef13..091e00f878826 100644 --- a/crates/aptos-crypto/src/p256/p256_keys.rs +++ b/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs @@ -6,7 +6,7 @@ #[cfg(any(test, feature = "fuzzing"))] use crate::test_utils::{self, KeyPair}; use crate::{ - p256::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, + ecdsa_p256::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, hash::CryptoHash, traits::*, }; diff --git a/crates/aptos-crypto/src/p256/p256_sigs.rs b/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs similarity index 98% rename from crates/aptos-crypto/src/p256/p256_sigs.rs rename to crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs index 1f1806738c7ab..23616919fa515 100644 --- a/crates/aptos-crypto/src/p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs @@ -4,7 +4,7 @@ //! This file implements traits for ECDSA signatures over NIST-P256. use crate::{ - p256::{P256PrivateKey, P256PublicKey, ORDER_HALF, ORDER_MINUS_ONE}, + ecdsa_p256::{P256PrivateKey, P256PublicKey, ORDER_HALF, ORDER_MINUS_ONE}, hash::CryptoHash, traits::*, }; diff --git a/crates/aptos-crypto/src/lib.rs b/crates/aptos-crypto/src/lib.rs index 03be9ec5cf72e..4722326d3906a 100644 --- a/crates/aptos-crypto/src/lib.rs +++ b/crates/aptos-crypto/src/lib.rs @@ -19,7 +19,7 @@ pub mod test_utils; pub mod traits; pub mod validatable; pub mod x25519; -pub mod p256; +pub mod ecdsa_p256; #[cfg(test)] mod unit_tests; diff --git a/crates/aptos-crypto/src/unit_tests/p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs similarity index 98% rename from crates/aptos-crypto/src/unit_tests/p256_test.rs rename to crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index a8bd47707f61a..0d6087444634b 100644 --- a/crates/aptos-crypto/src/unit_tests/p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -5,7 +5,7 @@ use crate as aptos_crypto; use crate::{ - p256::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, + ecdsa_p256::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, test_utils::{ random_serializable_struct, uniform_keypair_strategy, diff --git a/crates/aptos-crypto/src/unit_tests/mod.rs b/crates/aptos-crypto/src/unit_tests/mod.rs index abe7a7ed5aa95..2e0e2ed702f9e 100644 --- a/crates/aptos-crypto/src/unit_tests/mod.rs +++ b/crates/aptos-crypto/src/unit_tests/mod.rs @@ -8,7 +8,7 @@ mod compat_test; mod cross_test; mod cryptohasher; mod ed25519_test; -mod p256_test; +mod ecdsa_p256_test; mod hash_test; mod hkdf_test; mod multi_ed25519_test; From b1c8a9dd53a9bd4beb4f7b1477c19136dc0eecda Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 16:39:57 -0500 Subject: [PATCH 23/37] add comment for encoding --- crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index 0d6087444634b..b098524ecd4ac 100644 --- a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -37,14 +37,14 @@ proptest! { fn test_keys_encode(keypair in uniform_keypair_strategy::()) { { let encoded = keypair.private_key.to_encoded_string().unwrap(); - // Hex encoding of a 64-bytes key is 128 (2 x 64) characters. + // Hex encoding of a 64-bytes key is 128 (2 x 64) characters + 2 for the prepended '0x' prop_assert_eq!(2 + 2 * P256_PRIVATE_KEY_LENGTH, encoded.len()); let decoded = P256PrivateKey::from_encoded_string(&encoded); prop_assert_eq!(Some(keypair.private_key), decoded.ok()); } { let encoded = keypair.public_key.to_encoded_string().unwrap(); - // Hex encoding of a 65-bytes key is 130 (2 x 65) characters. + // Hex encoding of a 65-bytes key is 130 (2 x 65) characters + 2 for the prepended '0x' prop_assert_eq!(2 + 2 * P256_PUBLIC_KEY_LENGTH, encoded.len()); let decoded = P256PublicKey::from_encoded_string(&encoded); prop_assert_eq!(Some(keypair.public_key), decoded.ok()); From b26882339da06944b37b184d6e3a14526bf9896e Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 17:23:12 -0500 Subject: [PATCH 24/37] move Sealed --- crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs | 4 ---- crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs | 2 -- crates/aptos-crypto/src/traits.rs | 4 ++++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs b/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs index 091e00f878826..2fae79b0d6fb1 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs +++ b/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs @@ -23,8 +23,6 @@ use std::fmt; #[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] pub struct P256PrivateKey(pub(crate) p256::ecdsa::SigningKey); -impl private::Sealed for P256PrivateKey {} - #[cfg(feature = "assert-private-keys-not-cloneable")] static_assertions::assert_not_impl_any!(P256PrivateKey: Clone); @@ -40,8 +38,6 @@ impl Clone for P256PrivateKey { #[derive(DeserializeKey, Clone, SerializeKey)] pub struct P256PublicKey(pub(crate) p256::ecdsa::VerifyingKey); -impl private::Sealed for P256PublicKey {} - impl P256PrivateKey { /// The length of the P256PrivateKey pub const LENGTH: usize = P256_PRIVATE_KEY_LENGTH; diff --git a/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs b/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs index 23616919fa515..200a57446e372 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs @@ -24,8 +24,6 @@ use super::P256_SIGNATURE_LENGTH; #[derive(DeserializeKey, Clone, SerializeKey)] pub struct P256Signature(pub(crate) p256::ecdsa::Signature); -impl private::Sealed for P256Signature {} - impl P256Signature { /// The length of the P256Signature pub const LENGTH: usize = P256_SIGNATURE_LENGTH; diff --git a/crates/aptos-crypto/src/traits.rs b/crates/aptos-crypto/src/traits.rs index a16c8b35371bb..8b838672bab7d 100644 --- a/crates/aptos-crypto/src/traits.rs +++ b/crates/aptos-crypto/src/traits.rs @@ -318,4 +318,8 @@ pub(crate) mod private { impl Sealed for crate::bls12381::PublicKey {} impl Sealed for crate::bls12381::Signature {} impl Sealed for crate::bls12381::ProofOfPossession {} + + impl Sealed for crate::ecdsa_p256::P256PrivateKey {} + impl Sealed for crate::ecdsa_p256::P256PublicKey {} + impl Sealed for crate::ecdsa_p256::P256Signature {} } From f42969fb408a131272aa03624ae3e67e577157e6 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Thu, 28 Sep 2023 17:29:44 -0500 Subject: [PATCH 25/37] improve making signatures cannoical, fix mod.rs example --- crates/aptos-crypto/src/ecdsa_p256/mod.rs | 7 +------ crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs | 10 ++++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/crates/aptos-crypto/src/ecdsa_p256/mod.rs b/crates/aptos-crypto/src/ecdsa_p256/mod.rs index 0caae73fae0da..59c86c02a79c6 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/mod.rs +++ b/crates/aptos-crypto/src/ecdsa_p256/mod.rs @@ -10,7 +10,7 @@ //! ``` //! use aptos_crypto_derive::{CryptoHasher, BCSCryptoHash}; //! use aptos_crypto::{ -//! p256::*, +//! ecdsa_p256::*, //! traits::{Signature, SigningKey, Uniform}, //! test_utils::KeyPair //! }; @@ -36,11 +36,6 @@ pub const P256_PUBLIC_KEY_LENGTH: usize = 65; /// The length in bytes of the P256Signature pub const P256_SIGNATURE_LENGTH: usize = 64; -/// The order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final), minus one. -const ORDER_MINUS_ONE: [u8; 32] = [ - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x50, -]; - /// The value (q-1)/2, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). /// Computed with the following SageMath code: /// diff --git a/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs b/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs index 200a57446e372..75e0ccdcec07a 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs @@ -4,7 +4,7 @@ //! This file implements traits for ECDSA signatures over NIST-P256. use crate::{ - ecdsa_p256::{P256PrivateKey, P256PublicKey, ORDER_HALF, ORDER_MINUS_ONE}, + ecdsa_p256::{P256PrivateKey, P256PublicKey, ORDER_HALF}, hash::CryptoHash, traits::*, }; @@ -15,8 +15,6 @@ use serde::Serialize; use std::{cmp::Ordering, fmt}; use signature::Verifier; use p256::NonZeroScalar; -use p256::NistP256; -use p256::elliptic_curve::Curve; use super::P256_SIGNATURE_LENGTH; @@ -95,10 +93,10 @@ impl P256Signature { let r = self.0.r(); // NonZeroScalar::try_from throws an error on being passed the curve order, so we use the // order minus one, then add one later to compute (n-1) - s + 1 = n-s - let order_minus_one = NonZeroScalar::try_from(&ORDER_MINUS_ONE[..]).unwrap(); - let one = NonZeroScalar::from_uint(::Uint::ONE).unwrap(); + //let order_minus_one = NonZeroScalar::try_from(&ORDER_MINUS_ONE[..]).unwrap(); + //let one = NonZeroScalar::from_uint(::Uint::ONE).unwrap(); // Dereferencing a NonZeroScalar makes it a Scalar, which implements subtraction - let new_s = *order_minus_one - *s + *one; + let new_s = -*s; //*order_minus_one - *s + *one; let new_s_nonzero = NonZeroScalar::new(new_s).unwrap(); let new_sig = p256::ecdsa::Signature::from_scalars(&r, &new_s_nonzero).unwrap(); P256Signature(new_sig) From f2a6a45aaf32f32c1dba0cb46d6d0c85ba820b96 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Mon, 2 Oct 2023 13:18:21 -0500 Subject: [PATCH 26/37] small edits --- crates/aptos-crypto/src/lib.rs | 2 +- crates/aptos-crypto/src/{ecdsa_p256 => p256_ecdsa}/mod.rs | 2 +- .../src/{ecdsa_p256 => p256_ecdsa}/p256_keys.rs | 6 +++--- .../src/{ecdsa_p256 => p256_ecdsa}/p256_sigs.rs | 2 +- crates/aptos-crypto/src/traits.rs | 6 +++--- crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename crates/aptos-crypto/src/{ecdsa_p256 => p256_ecdsa}/mod.rs (99%) rename crates/aptos-crypto/src/{ecdsa_p256 => p256_ecdsa}/p256_keys.rs (97%) rename crates/aptos-crypto/src/{ecdsa_p256 => p256_ecdsa}/p256_sigs.rs (99%) diff --git a/crates/aptos-crypto/src/lib.rs b/crates/aptos-crypto/src/lib.rs index ac4e2c4d3f580..ea779c0d73c2b 100644 --- a/crates/aptos-crypto/src/lib.rs +++ b/crates/aptos-crypto/src/lib.rs @@ -20,7 +20,7 @@ pub mod test_utils; pub mod traits; pub mod validatable; pub mod x25519; -pub mod ecdsa_p256; +pub mod p256_ecdsa; #[cfg(test)] mod unit_tests; diff --git a/crates/aptos-crypto/src/ecdsa_p256/mod.rs b/crates/aptos-crypto/src/p256_ecdsa/mod.rs similarity index 99% rename from crates/aptos-crypto/src/ecdsa_p256/mod.rs rename to crates/aptos-crypto/src/p256_ecdsa/mod.rs index 59c86c02a79c6..7fcf7a5b24245 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/mod.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/mod.rs @@ -10,7 +10,7 @@ //! ``` //! use aptos_crypto_derive::{CryptoHasher, BCSCryptoHash}; //! use aptos_crypto::{ -//! ecdsa_p256::*, +//! p256_ecdsa::*, //! traits::{Signature, SigningKey, Uniform}, //! test_utils::KeyPair //! }; diff --git a/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs similarity index 97% rename from crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs rename to crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index 2fae79b0d6fb1..26347ecd94bd9 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -6,7 +6,7 @@ #[cfg(any(test, feature = "fuzzing"))] use crate::test_utils::{self, KeyPair}; use crate::{ - ecdsa_p256::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, + p256_ecdsa::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, hash::CryptoHash, traits::*, }; @@ -120,7 +120,7 @@ impl Uniform for P256PrivateKey { where R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, { - let mut bytes: [u8; P256_PRIVATE_KEY_LENGTH] = Default::default(); + let mut bytes = [0u8; P256_PRIVATE_KEY_LENGTH]; rng.fill_bytes(&mut bytes); P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&bytes[..]).unwrap()) } @@ -238,7 +238,7 @@ impl Length for P256PublicKey { impl ValidCryptoMaterial for P256PublicKey { fn to_bytes(&self) -> Vec { - self.0.to_sec1_bytes().to_vec() + self.to_bytes().to_vec() } } diff --git a/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs similarity index 99% rename from crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs rename to crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs index 75e0ccdcec07a..1281c6db6c305 100644 --- a/crates/aptos-crypto/src/ecdsa_p256/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs @@ -4,7 +4,7 @@ //! This file implements traits for ECDSA signatures over NIST-P256. use crate::{ - ecdsa_p256::{P256PrivateKey, P256PublicKey, ORDER_HALF}, + p256_ecdsa::{P256PrivateKey, P256PublicKey, ORDER_HALF}, hash::CryptoHash, traits::*, }; diff --git a/crates/aptos-crypto/src/traits.rs b/crates/aptos-crypto/src/traits.rs index 6e0a00f852329..9f2c2b46ee4b7 100644 --- a/crates/aptos-crypto/src/traits.rs +++ b/crates/aptos-crypto/src/traits.rs @@ -318,9 +318,9 @@ pub(crate) mod private { impl Sealed for crate::multi_ed25519::MultiEd25519PublicKey {} impl Sealed for crate::multi_ed25519::MultiEd25519Signature {} - impl Sealed for crate::ecdsa_p256::P256PrivateKey {} - impl Sealed for crate::ecdsa_p256::P256PublicKey {} - impl Sealed for crate::ecdsa_p256::P256Signature {} + impl Sealed for crate::p256_ecdsa::P256PrivateKey {} + impl Sealed for crate::p256_ecdsa::P256PublicKey {} + impl Sealed for crate::p256_ecdsa::P256Signature {} impl Sealed for crate::secp256k1_ecdsa::PrivateKey {} impl Sealed for crate::secp256k1_ecdsa::PublicKey {} diff --git a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index b098524ecd4ac..abeac83f670d0 100644 --- a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -5,7 +5,7 @@ use crate as aptos_crypto; use crate::{ - ecdsa_p256::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, + p256_ecdsa::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, test_utils::{ random_serializable_struct, uniform_keypair_strategy, From 0236ee0196173c0e7430ca5a7c43f1481cdde986 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 17 Oct 2023 16:04:06 -0500 Subject: [PATCH 27/37] comment edit --- Cargo.lock | 2 +- Cargo.toml | 5 ++--- crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 536228054adb6..9075e76268791 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15516,7 +15516,7 @@ dependencies = [ [[package]] name = "x25519-dalek" version = "1.2.0" -source = "git+https://github.com/aptos-labs/x25519-dalek#b9cdbaf36bf2a83438d9f660e5a708c82ed60d8e" +source = "git+https://github.com/aptos-labs/x25519-dalek?rev=b9cdbaf36bf2a83438d9f660e5a708c82ed60d8e#b9cdbaf36bf2a83438d9f660e5a708c82ed60d8e" dependencies = [ "curve25519-dalek", "rand_core 0.5.1", diff --git a/Cargo.toml b/Cargo.toml index fbc0044e0e407..fcc75f94168ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -548,8 +548,7 @@ once_cell = "1.10.0" ordered-float = "3.9.1" ouroboros = "0.15.6" owo-colors = "3.5.0" -# TODO: Do we actually use serde? -p256 = { version = "0.13.2" } #, features = ["serde"] } +p256 = { version = "0.13.2" } signature = "2.1.0" sec1 = "0.7.0" parking_lot = "0.12.0" @@ -659,7 +658,7 @@ walkdir = "2.3.3" warp = { version = "0.3.5", features = ["tls"] } warp-reverse-proxy = "1.0.0" which = "4.2.5" -x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek" } +x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek", rev = "b9cdbaf36bf2a83438d9f660e5a708c82ed60d8e" } # MOVE DEPENDENCIES move-abigen = { path = "third_party/move/move-prover/move-abigen" } diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index 26347ecd94bd9..c21b8f30fb06d 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -59,6 +59,8 @@ impl P256PrivateKey { /// Private function aimed at minimizing code duplication between sign /// methods of the SigningKey implementation. This should remain private. + /// This function uses the `RustCrypto` P256 signing library, which uses, + /// as of version 0.13.2, SHA2-256 as its hashing algorithm fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { let secret_key = &self.0; let sig = P256Signature(secret_key.sign(message.as_ref())); From bddb158323d5e61592eaa2c0b6ee6d8b71de5864 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 17 Oct 2023 16:10:00 -0500 Subject: [PATCH 28/37] serialization comments --- crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 6 ++++-- crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index c21b8f30fb06d..0c119581d9c57 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -42,12 +42,13 @@ impl P256PrivateKey { /// The length of the P256PrivateKey pub const LENGTH: usize = P256_PRIVATE_KEY_LENGTH; - /// Serialize a P256PrivateKey. + /// Serialize a P256PrivateKey. Uses the SEC1 serialization format. pub fn to_bytes(&self) -> [u8; P256_PRIVATE_KEY_LENGTH] { self.0.to_bytes().into() } /// Deserialize an P256PrivateKey without any validation checks apart from expected key size. + /// Uses the SEC1 serialization format. fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { @@ -71,7 +72,7 @@ impl P256PrivateKey { } impl P256PublicKey { - /// Serialize a P256PublicKey. + /// Serialize a P256PublicKey. Uses the SEC1 serialization format. pub fn to_bytes(&self) -> [u8; P256_PUBLIC_KEY_LENGTH] { // The RustCrypto P256 `to_sec1_bytes` call here should never return an array of the wrong length and cause a panic (*self.0.to_sec1_bytes()).try_into().unwrap() @@ -79,6 +80,7 @@ impl P256PublicKey { /// Deserialize a P256PublicKey, checking expected key size /// and that it is a valid curve point. + /// Uses the SEC1 serialization format. pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs index 1281c6db6c305..c4166c215bbb3 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs @@ -26,13 +26,14 @@ impl P256Signature { /// The length of the P256Signature pub const LENGTH: usize = P256_SIGNATURE_LENGTH; - /// Serialize an P256Signature. + /// Serialize an P256Signature. Uses the SEC1 serialization format. pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { // The RustCrypto P256 `to_bytes` call here should never return a byte array of the wrong length self.0.to_bytes().try_into().unwrap() } /// Deserialize an P256Signature, without checking for malleability + /// Uses the SEC1 serialization format. pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { From 18f23f63920397e2fd237844250e39a18e84f73d Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 17 Oct 2023 16:54:28 -0500 Subject: [PATCH 29/37] linter --- crates/aptos-crypto/src/lib.rs | 2 +- crates/aptos-crypto/src/p256_ecdsa/mod.rs | 8 ++--- .../aptos-crypto/src/p256_ecdsa/p256_keys.rs | 17 ++++------ .../aptos-crypto/src/p256_ecdsa/p256_sigs.rs | 32 +++++++++---------- .../src/unit_tests/ecdsa_p256_test.rs | 12 +++---- crates/aptos-crypto/src/unit_tests/mod.rs | 2 +- 6 files changed, 34 insertions(+), 39 deletions(-) diff --git a/crates/aptos-crypto/src/lib.rs b/crates/aptos-crypto/src/lib.rs index 2ff125112e17e..913690b2ef6f0 100644 --- a/crates/aptos-crypto/src/lib.rs +++ b/crates/aptos-crypto/src/lib.rs @@ -16,12 +16,12 @@ pub mod hash; pub mod hkdf; pub mod multi_ed25519; pub mod noise; +pub mod p256_ecdsa; pub mod secp256k1_ecdsa; pub mod test_utils; pub mod traits; pub mod validatable; pub mod x25519; -pub mod p256_ecdsa; #[cfg(test)] mod unit_tests; diff --git a/crates/aptos-crypto/src/p256_ecdsa/mod.rs b/crates/aptos-crypto/src/p256_ecdsa/mod.rs index 7fcf7a5b24245..0f3e4ba5e9173 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/mod.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/mod.rs @@ -3,7 +3,7 @@ //! This module provides an API for the ECDSA signature scheme over the NIST-P256 curve as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). //! //! Signature verification also checks and rejects non-canonical signatures. Signing is guaranteed -//! to output the canonical signature which passes this module's verification. +//! to output the canonical signature which passes this module's verification. //! //! # Examples //! @@ -43,7 +43,8 @@ pub const P256_SIGNATURE_LENGTH: usize = 64; /// qq = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551 /// q_half = (qq-1)/2 pub const ORDER_HALF: [u8; 32] = [ - 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x73, 0x7D, 0x56, 0xD3, 0x8B, 0xCF, 0x42, 0x79, 0xDC, 0xE5, 0x61, 0x7E, 0x31, 0x92, 0xA8, + 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDE, 0x73, 0x7D, 0x56, 0xD3, 0x8B, 0xCF, 0x42, 0x79, 0xDC, 0xE5, 0x61, 0x7E, 0x31, 0x92, 0xA8, ]; pub mod p256_keys; @@ -52,7 +53,6 @@ pub mod p256_sigs; #[cfg(any(test, feature = "fuzzing"))] pub use p256_keys::keypair_strategy; pub use p256_keys::{ - P256PrivateKey, P256PrivateKey as PrivateKey, P256PublicKey, - P256PublicKey as PublicKey, + P256PrivateKey, P256PrivateKey as PrivateKey, P256PublicKey, P256PublicKey as PublicKey, }; pub use p256_sigs::{P256Signature, P256Signature as Signature}; diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index 0c119581d9c57..4d9aa39e3bbef 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -6,14 +6,13 @@ #[cfg(any(test, feature = "fuzzing"))] use crate::test_utils::{self, KeyPair}; use crate::{ - p256_ecdsa::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, hash::CryptoHash, + p256_ecdsa::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, traits::*, }; -use p256::ecdsa::signature::Signer; -use p256; use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; use core::convert::TryFrom; +use p256::{self, ecdsa::signature::Signer}; #[cfg(any(test, feature = "fuzzing"))] use proptest::prelude::*; use serde::Serialize; @@ -42,13 +41,13 @@ impl P256PrivateKey { /// The length of the P256PrivateKey pub const LENGTH: usize = P256_PRIVATE_KEY_LENGTH; - /// Serialize a P256PrivateKey. Uses the SEC1 serialization format. + /// Serialize a P256PrivateKey. Uses the SEC1 serialization format. pub fn to_bytes(&self) -> [u8; P256_PRIVATE_KEY_LENGTH] { self.0.to_bytes().into() } /// Deserialize an P256PrivateKey without any validation checks apart from expected key size. - /// Uses the SEC1 serialization format. + /// Uses the SEC1 serialization format. fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { @@ -65,9 +64,7 @@ impl P256PrivateKey { fn sign_arbitrary_message(&self, message: &[u8]) -> P256Signature { let secret_key = &self.0; let sig = P256Signature(secret_key.sign(message.as_ref())); - let canonical_sig = P256Signature::make_canonical(&sig); - - canonical_sig + P256Signature::make_canonical(&sig) } } @@ -80,7 +77,7 @@ impl P256PublicKey { /// Deserialize a P256PublicKey, checking expected key size /// and that it is a valid curve point. - /// Uses the SEC1 serialization format. + /// Uses the SEC1 serialization format. pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { @@ -122,7 +119,7 @@ impl SigningKey for P256PrivateKey { impl Uniform for P256PrivateKey { fn generate(rng: &mut R) -> Self where - R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, + R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, { let mut bytes = [0u8; P256_PRIVATE_KEY_LENGTH]; rng.fill_bytes(&mut bytes); diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs index c4166c215bbb3..14a1eccc759cc 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_sigs.rs @@ -3,20 +3,19 @@ //! This file implements traits for ECDSA signatures over NIST-P256. +use super::P256_SIGNATURE_LENGTH; use crate::{ - p256_ecdsa::{P256PrivateKey, P256PublicKey, ORDER_HALF}, hash::CryptoHash, + p256_ecdsa::{P256PrivateKey, P256PublicKey, ORDER_HALF}, traits::*, }; use anyhow::{anyhow, Result}; use aptos_crypto_derive::{DeserializeKey, SerializeKey}; use core::convert::TryFrom; +use p256::NonZeroScalar; use serde::Serialize; -use std::{cmp::Ordering, fmt}; use signature::Verifier; -use p256::NonZeroScalar; - -use super::P256_SIGNATURE_LENGTH; +use std::{cmp::Ordering, fmt}; /// A P256 signature #[derive(DeserializeKey, Clone, SerializeKey)] @@ -26,14 +25,14 @@ impl P256Signature { /// The length of the P256Signature pub const LENGTH: usize = P256_SIGNATURE_LENGTH; - /// Serialize an P256Signature. Uses the SEC1 serialization format. + /// Serialize an P256Signature. Uses the SEC1 serialization format. pub fn to_bytes(&self) -> [u8; P256_SIGNATURE_LENGTH] { // The RustCrypto P256 `to_bytes` call here should never return a byte array of the wrong length self.0.to_bytes().try_into().unwrap() } /// Deserialize an P256Signature, without checking for malleability - /// Uses the SEC1 serialization format. + /// Uses the SEC1 serialization format. pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { @@ -85,21 +84,16 @@ impl P256Signature { /// If the signature {R,S} does not have S < n/2 where n is the Ristretto255 order, return /// {R,n-S} as the canonical encoding of this signature to prevent malleability attacks. See - /// `check_s_malleability` for more detail + /// `check_s_malleability` for more detail pub fn make_canonical(&self) -> P256Signature { if P256Signature::check_s_malleability(&self.to_bytes()[..]).is_ok() { - return self.clone() + return self.clone(); }; let s = self.0.s(); let r = self.0.r(); - // NonZeroScalar::try_from throws an error on being passed the curve order, so we use the - // order minus one, then add one later to compute (n-1) - s + 1 = n-s - //let order_minus_one = NonZeroScalar::try_from(&ORDER_MINUS_ONE[..]).unwrap(); - //let one = NonZeroScalar::from_uint(::Uint::ONE).unwrap(); - // Dereferencing a NonZeroScalar makes it a Scalar, which implements subtraction - let new_s = -*s; //*order_minus_one - *s + *one; + let new_s = -*s; let new_s_nonzero = NonZeroScalar::new(new_s).unwrap(); - let new_sig = p256::ecdsa::Signature::from_scalars(&r, &new_s_nonzero).unwrap(); + let new_sig = p256::ecdsa::Signature::from_scalars(r, new_s_nonzero).unwrap(); P256Signature(new_sig) } } @@ -131,7 +125,11 @@ impl Signature for P256Signature { fn verify_arbitrary_msg(&self, message: &[u8], public_key: &P256PublicKey) -> Result<()> { P256Signature::check_s_malleability(&self.to_bytes())?; - public_key.0.verify(message, &self.0).map_err(|e| anyhow!("{}", e)).and(Ok(())) + public_key + .0 + .verify(message, &self.0) + .map_err(|e| anyhow!("{}", e)) + .and(Ok(())) } fn to_bytes(&self) -> Vec { diff --git a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index abeac83f670d0..6c3f9b2344230 100644 --- a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -5,19 +5,19 @@ use crate as aptos_crypto; use crate::{ - p256_ecdsa::{P256_SIGNATURE_LENGTH, P256PublicKey, P256_PUBLIC_KEY_LENGTH, P256_PRIVATE_KEY_LENGTH, P256PrivateKey, P256Signature, ORDER_HALF}, - test_utils::{ - random_serializable_struct, - uniform_keypair_strategy, + p256_ecdsa::{ + P256PrivateKey, P256PublicKey, P256Signature, ORDER_HALF, P256_PRIVATE_KEY_LENGTH, + P256_PUBLIC_KEY_LENGTH, P256_SIGNATURE_LENGTH, }, + test_utils::{random_serializable_struct, uniform_keypair_strategy}, traits::*, }; -use signature::Verifier; -use p256::{EncodedPoint, NonZeroScalar}; use aptos_crypto_derive::{BCSCryptoHash, CryptoHasher}; use core::convert::TryFrom; +use p256::{EncodedPoint, NonZeroScalar}; use proptest::{collection::vec, prelude::*}; use serde::{Deserialize, Serialize}; +use signature::Verifier; #[derive(CryptoHasher, BCSCryptoHash, Serialize, Deserialize)] struct CryptoHashable(pub usize); diff --git a/crates/aptos-crypto/src/unit_tests/mod.rs b/crates/aptos-crypto/src/unit_tests/mod.rs index 6aa7a19b46568..4eca36b1b9b75 100644 --- a/crates/aptos-crypto/src/unit_tests/mod.rs +++ b/crates/aptos-crypto/src/unit_tests/mod.rs @@ -7,8 +7,8 @@ mod bulletproofs_test; mod compat_test; mod cross_test; mod cryptohasher; -mod ed25519_test; mod ecdsa_p256_test; +mod ed25519_test; mod hash_test; mod hkdf_test; mod multi_ed25519_test; From 8875827e5703b0d470c86136c717f2a2be7432f5 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 17 Oct 2023 18:38:07 -0500 Subject: [PATCH 30/37] edits --- Cargo.lock | 2 ++ Cargo.toml | 1 + crates/aptos-crypto/Cargo.toml | 1 + crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 6 +++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 446fc0f7e35b1..e8c0196e8c4c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -890,6 +890,7 @@ dependencies = [ "libsecp256k1", "merlin", "more-asserts", + "num-bigint 0.3.3", "once_cell", "p256", "proptest", @@ -10446,6 +10447,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "rand 0.7.3", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fcc75f94168ee..1e6ece909d952 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -540,6 +540,7 @@ mockall = "0.11.4" more-asserts = "0.3.0" native-tls = "0.2.10" ntest = "0.9.0" +num-bigint = { version = "0.3.2", features = ["rand"] } num_cpus = "1.13.1" num-derive = "0.3.3" num-traits = "0.2.15" diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index 7e03265192708..2b06adc573105 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -32,6 +32,7 @@ hkdf = { workspace = true } libsecp256k1 = { workspace = true } merlin = { workspace = true } more-asserts = { workspace = true } +num-bigint = { workspace = true } once_cell = { workspace = true } proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index 4d9aa39e3bbef..be98b3e6f6ed4 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -17,6 +17,7 @@ use p256::{self, ecdsa::signature::Signer}; use proptest::prelude::*; use serde::Serialize; use std::fmt; +use num_bigint::BigUint; /// A P256 private key #[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] @@ -116,13 +117,16 @@ impl SigningKey for P256PrivateKey { } } +// TODO: This is broken and will panic if the random bytes are greater than the field modulus impl Uniform for P256PrivateKey { fn generate(rng: &mut R) -> Self where R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, { - let mut bytes = [0u8; P256_PRIVATE_KEY_LENGTH]; + let mut bytes = [0u8; P256_PRIVATE_KEY_LENGTH * 2]; rng.fill_bytes(&mut bytes); + let bignum = BigUint::from_bytes_le(&bytes[..]); + let remainder = bignum.mod_floor(&SCALAR_FIELD_ORDER); P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&bytes[..]).unwrap()) } } From f93f0f41e7a927066591f09e1ac117a52e51daff Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Tue, 17 Oct 2023 19:06:04 -0500 Subject: [PATCH 31/37] fix random private key --- Cargo.lock | 1 + Cargo.toml | 1 + crates/aptos-crypto/Cargo.toml | 1 + crates/aptos-crypto/src/p256_ecdsa/mod.rs | 6 ++++++ crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 16 ++++++++++------ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e8c0196e8c4c4..66a30767c47af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -891,6 +891,7 @@ dependencies = [ "merlin", "more-asserts", "num-bigint 0.3.3", + "num-integer", "once_cell", "p256", "proptest", diff --git a/Cargo.toml b/Cargo.toml index 1e6ece909d952..91a05b45e6b2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -543,6 +543,7 @@ ntest = "0.9.0" num-bigint = { version = "0.3.2", features = ["rand"] } num_cpus = "1.13.1" num-derive = "0.3.3" +num-integer = "0.1.42" num-traits = "0.2.15" number_range = "0.3.2" once_cell = "1.10.0" diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index 2b06adc573105..e9e8c9497addc 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -33,6 +33,7 @@ libsecp256k1 = { workspace = true } merlin = { workspace = true } more-asserts = { workspace = true } num-bigint = { workspace = true } +num-integer = { workspace = true } once_cell = { workspace = true } proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } diff --git a/crates/aptos-crypto/src/p256_ecdsa/mod.rs b/crates/aptos-crypto/src/p256_ecdsa/mod.rs index 0f3e4ba5e9173..e2c4f35506f4d 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/mod.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/mod.rs @@ -36,6 +36,12 @@ pub const P256_PUBLIC_KEY_LENGTH: usize = 65; /// The length in bytes of the P256Signature pub const P256_SIGNATURE_LENGTH: usize = 64; +/// The order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final) +const ORDER: [u8; 32] = [ + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51, +]; + /// The value (q-1)/2, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). /// Computed with the following SageMath code: /// diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index be98b3e6f6ed4..b098b70f9c2ee 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -7,17 +7,18 @@ use crate::test_utils::{self, KeyPair}; use crate::{ hash::CryptoHash, - p256_ecdsa::{P256Signature, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, + p256_ecdsa::{P256Signature, ORDER, P256_PRIVATE_KEY_LENGTH, P256_PUBLIC_KEY_LENGTH}, traits::*, }; use aptos_crypto_derive::{DeserializeKey, SerializeKey, SilentDebug, SilentDisplay}; use core::convert::TryFrom; +use num_bigint::BigUint; +use num_integer::Integer; use p256::{self, ecdsa::signature::Signer}; #[cfg(any(test, feature = "fuzzing"))] use proptest::prelude::*; use serde::Serialize; use std::fmt; -use num_bigint::BigUint; /// A P256 private key #[derive(DeserializeKey, SerializeKey, SilentDebug, SilentDisplay)] @@ -117,17 +118,20 @@ impl SigningKey for P256PrivateKey { } } -// TODO: This is broken and will panic if the random bytes are greater than the field modulus impl Uniform for P256PrivateKey { + // Returns a random field element as a private key indistinguishable from uniformly random. + // Uses a hack to get around the incompatability of the `aptos-crypto` RngCore trait and the + // `RustCrypto` RngCore trait fn generate(rng: &mut R) -> Self where R: ::rand::RngCore + ::rand::CryptoRng + ::rand_core::CryptoRng + ::rand_core::RngCore, { let mut bytes = [0u8; P256_PRIVATE_KEY_LENGTH * 2]; rng.fill_bytes(&mut bytes); - let bignum = BigUint::from_bytes_le(&bytes[..]); - let remainder = bignum.mod_floor(&SCALAR_FIELD_ORDER); - P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&bytes[..]).unwrap()) + let bignum = BigUint::from_bytes_be(&bytes[..]); + let order = BigUint::from_bytes_be(&ORDER); + let remainder = bignum.mod_floor(&order); + P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&remainder.to_bytes_le()).unwrap()) } } From 26dafbfbd53d4faa23c2064b04d44eb225c4e996 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 18 Oct 2023 11:12:25 -0700 Subject: [PATCH 32/37] endianness comments --- crates/aptos-crypto/src/p256_ecdsa/mod.rs | 3 ++- crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/aptos-crypto/src/p256_ecdsa/mod.rs b/crates/aptos-crypto/src/p256_ecdsa/mod.rs index e2c4f35506f4d..5cc7476c3f23a 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/mod.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/mod.rs @@ -37,12 +37,13 @@ pub const P256_PUBLIC_KEY_LENGTH: usize = 65; pub const P256_SIGNATURE_LENGTH: usize = 64; /// The order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final) +/// In big-endian form const ORDER: [u8; 32] = [ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51, ]; -/// The value (q-1)/2, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). +/// The value (q-1)/2 in big-endian form, where q is the order of P256 as defined in [NIST SP 800-186](https://csrc.nist.gov/publications/detail/sp/800-186/final). /// Computed with the following SageMath code: /// /// # Curve order diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index b098b70f9c2ee..ec59bcd142626 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -131,6 +131,7 @@ impl Uniform for P256PrivateKey { let bignum = BigUint::from_bytes_be(&bytes[..]); let order = BigUint::from_bytes_be(&ORDER); let remainder = bignum.mod_floor(&order); + // TODO: Make sure _le is the right endianness here P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&remainder.to_bytes_le()).unwrap()) } } From f89a60e9c9884371987a0a246c10fef2051533be Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 18 Oct 2023 12:12:42 -0700 Subject: [PATCH 33/37] change endianness of private key generation --- crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 3 +-- crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index ec59bcd142626..e4195f9ec9578 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -131,8 +131,7 @@ impl Uniform for P256PrivateKey { let bignum = BigUint::from_bytes_be(&bytes[..]); let order = BigUint::from_bytes_be(&ORDER); let remainder = bignum.mod_floor(&order); - // TODO: Make sure _le is the right endianness here - P256PrivateKey(p256::ecdsa::SigningKey::from_slice(&remainder.to_bytes_le()).unwrap()) + P256PrivateKey::from_bytes_unchecked(&remainder.to_bytes_be()).unwrap() } } diff --git a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index 6c3f9b2344230..a4efda7dd5524 100644 --- a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -124,7 +124,6 @@ proptest! { prop_assert!(deserialized.verify(&hashable, &keypair.public_key).is_ok()); } - // Check for canonical S. #[test] fn test_signature_malleability( From 689783f372a8b8f1d18364731fa8d135485a0d60 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 18 Oct 2023 13:00:43 -0700 Subject: [PATCH 34/37] comment removed --- crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index e4195f9ec9578..8026ecc89b24d 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -143,8 +143,6 @@ impl PartialEq for P256PrivateKey { impl Eq for P256PrivateKey {} -// We could have a distinct kind of validation for the PrivateKey: e.g., checking the derived -// PublicKey is valid? impl TryFrom<&[u8]> for P256PrivateKey { type Error = CryptoMaterialError; From a1506e2dfccaab44c7e1930c1e11b336d7f3e767 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 18 Oct 2023 13:45:00 -0700 Subject: [PATCH 35/37] added unit test for private key endianness --- crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs | 4 ++-- .../aptos-crypto/src/unit_tests/ecdsa_p256_test.rs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs index 8026ecc89b24d..b3ce34867908f 100644 --- a/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs +++ b/crates/aptos-crypto/src/p256_ecdsa/p256_keys.rs @@ -49,8 +49,8 @@ impl P256PrivateKey { } /// Deserialize an P256PrivateKey without any validation checks apart from expected key size. - /// Uses the SEC1 serialization format. - fn from_bytes_unchecked( + /// Uses the SEC1 serialization format. Bytes are expected to be in big-endian form. + pub(crate) fn from_bytes_unchecked( bytes: &[u8], ) -> std::result::Result { match p256::ecdsa::SigningKey::from_slice(bytes) { diff --git a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index a4efda7dd5524..302eaeebdf24a 100644 --- a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -21,6 +21,17 @@ use signature::Verifier; #[derive(CryptoHasher, BCSCryptoHash, Serialize, Deserialize)] struct CryptoHashable(pub usize); + +#[test] +fn test_private_key_deserialization_endianness() { + let more_than_order_be: [u8; 32] = [0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0xFF,]; + // If this assert passes, we know `from_bytes_unchecked` expects big-endian inputs + assert_eq!( + P256Signature::from_bytes_unchecked(&more_than_order_be), + Err(CryptoMaterialError::DeserializationError), + ); +} + proptest! { #[test] fn test_pub_key_deserialization(bits in any::<[u8; 32]>()){ @@ -33,6 +44,7 @@ proptest! { prop_assert!(check); } + #[test] fn test_keys_encode(keypair in uniform_keypair_strategy::()) { { @@ -124,6 +136,7 @@ proptest! { prop_assert!(deserialized.verify(&hashable, &keypair.public_key).is_ok()); } + // Check for canonical S. #[test] fn test_signature_malleability( From 0f53a2d056db216cc521bef7b01ecb6da39a3185 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 18 Oct 2023 13:49:40 -0700 Subject: [PATCH 36/37] linter --- crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs index 302eaeebdf24a..c57bf011ebfc2 100644 --- a/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs +++ b/crates/aptos-crypto/src/unit_tests/ecdsa_p256_test.rs @@ -24,7 +24,11 @@ struct CryptoHashable(pub usize); #[test] fn test_private_key_deserialization_endianness() { - let more_than_order_be: [u8; 32] = [0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0xFF,]; + let more_than_order_be: [u8; 32] = [ + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, + 0x25, 0xFF, + ]; // If this assert passes, we know `from_bytes_unchecked` expects big-endian inputs assert_eq!( P256Signature::from_bytes_unchecked(&more_than_order_be), From 50fca74831dcfffad88389af55484c3bb3d94218 Mon Sep 17 00:00:00 2001 From: Michael Straka Date: Wed, 18 Oct 2023 14:34:53 -0700 Subject: [PATCH 37/37] sort dependencies --- crates/aptos-crypto/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/aptos-crypto/Cargo.toml b/crates/aptos-crypto/Cargo.toml index e9e8c9497addc..ab45c4a24b312 100644 --- a/crates/aptos-crypto/Cargo.toml +++ b/crates/aptos-crypto/Cargo.toml @@ -35,6 +35,7 @@ more-asserts = { workspace = true } num-bigint = { workspace = true } num-integer = { workspace = true } once_cell = { workspace = true } +p256 = { workspace = true } proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } rand = { workspace = true } @@ -45,12 +46,11 @@ serde-name = { workspace = true } serde_bytes = { workspace = true } sha2 = { workspace = true } sha2_0_10_6 = { workspace = true } +signature = { workspace = true } static_assertions = { workspace = true } thiserror = { workspace = true } tiny-keccak = { workspace = true } x25519-dalek = { workspace = true } -p256 = { workspace = true } -signature = { workspace = true } [dev-dependencies] ark-bls12-381 = { workspace = true }