diff --git a/Cargo.toml b/Cargo.toml index 90a5618b..b1d185a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,9 @@ version = "0.20.3" edition = "2018" [dependencies] -tari_utilities = { version = "0.7", default-features = false, features = ["zero"] } +tari_utilities = { version = "0.8", default-features = false } blake2 = { version = "0.10", default-features = false } -borsh = { version = "1.2" , optional = true , default-features = false, features = ["derive"]} +borsh = { version = "1.5" , optional = true , default-features = false, features = ["derive"]} bulletproofs_plus = { package = "tari_bulletproofs_plus", version = "0.4", optional = true } curve25519-dalek = { version = "4", default-features = false, features = [ "alloc", "rand_core", "precomputed-tables", "zeroize"] } digest = { version = "0.10", default-features = false } @@ -29,7 +29,7 @@ subtle = { version = "2.5.0", default-features = false } zeroize = {version = "1" , default-features = false} [dev-dependencies] -tari_utilities = { version = "0.7", features = ["std"] } +tari_utilities = { version = "0.8", features = ["std"] } serde = { version = "1.0"} bincode = { version = "1.1" } criterion = { version = "0.5", default-features = false } diff --git a/benches/commitment.rs b/benches/commitment.rs index d7f0d89e..abc40d19 100644 --- a/benches/commitment.rs +++ b/benches/commitment.rs @@ -1,6 +1,6 @@ // Copyright 2019. The Tari Project // SPDX-License-Identifier: BSD-3-Clause - +#![allow(missing_docs)] use std::time::Duration; use criterion::{criterion_group, Criterion}; diff --git a/benches/signatures.rs b/benches/signatures.rs index 8ab2d9e9..af9f0a4e 100644 --- a/benches/signatures.rs +++ b/benches/signatures.rs @@ -1,6 +1,6 @@ // Copyright 2022. The Tari Project // SPDX-License-Identifier: BSD-3-Clause - +#![allow(missing_docs)] use std::time::Duration; use criterion::{criterion_group, BatchSize, Criterion}; diff --git a/changelog.md b/changelog.md index 25ee0f5a..1899ed46 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,15 @@ # Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [0.21.0](https://github.com/tari-project/tari-crypto/compare/v0.20.3...v0.21.0) (2024-10-10) + + +### Features + +* use constant-time equality checking for DHKE ([#232](https://github.com/tari-project/tari-crypto/issues/232)) ([2a1715a](https://github.com/tari-project/tari-crypto/commit/2a1715a588953b2d21030f4019bf5565272a51d8)) +* upgrade dependencies tari utilities to 0.8 and borsh to 1.5 + ### [0.20.3](https://github.com/tari-project/tari-crypto/compare/v0.20.1...v0.20.3) (2024-07-02) diff --git a/lints.toml b/lints.toml index 14733107..2fd875bf 100644 --- a/lints.toml +++ b/lints.toml @@ -49,4 +49,8 @@ deny = [ warn = [ 'clippy::uninlined_format_args', 'clippy::too_many_arguments', +] + +allow = [ + 'clippy::too_long_first_doc_paragraph', ] \ No newline at end of file diff --git a/src/ristretto/ristretto_keys.rs b/src/ristretto/ristretto_keys.rs index 23c6ea78..2ec08a96 100644 --- a/src/ristretto/ristretto_keys.rs +++ b/src/ristretto/ristretto_keys.rs @@ -176,13 +176,13 @@ impl RistrettoSecretKey { } } -impl<'a> fmt::Display for RevealedSecretKey<'a> { +impl fmt::Display for RevealedSecretKey<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.secret.to_hex()) } } -impl<'a> fmt::Debug for RevealedSecretKey<'a> { +impl fmt::Debug for RevealedSecretKey<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("RistrettoSecretKey") .field(&self.secret.to_hex()) @@ -192,7 +192,7 @@ impl<'a> fmt::Debug for RevealedSecretKey<'a> { //---------------------------------- RistrettoSecretKey Mul / Add / Sub --------------------------------------------// -impl<'a, 'b> Mul<&'b RistrettoPublicKey> for &'a RistrettoSecretKey { +impl<'b> Mul<&'b RistrettoPublicKey> for &RistrettoSecretKey { type Output = RistrettoPublicKey; fn mul(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey { @@ -201,7 +201,7 @@ impl<'a, 'b> Mul<&'b RistrettoPublicKey> for &'a RistrettoSecretKey { } } -impl<'a, 'b> Add<&'b RistrettoSecretKey> for &'a RistrettoSecretKey { +impl<'b> Add<&'b RistrettoSecretKey> for &RistrettoSecretKey { type Output = RistrettoSecretKey; fn add(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey { @@ -210,7 +210,7 @@ impl<'a, 'b> Add<&'b RistrettoSecretKey> for &'a RistrettoSecretKey { } } -impl<'a, 'b> Sub<&'b RistrettoSecretKey> for &'a RistrettoSecretKey { +impl<'b> Sub<&'b RistrettoSecretKey> for &RistrettoSecretKey { type Output = RistrettoSecretKey; fn sub(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey { @@ -245,7 +245,7 @@ impl From for RistrettoSecretKey { //--------------------------------------------- Borrow impl -------------------------------------------------// -impl<'a> Borrow for &'a RistrettoSecretKey { +impl Borrow for &RistrettoSecretKey { fn borrow(&self) -> &Scalar { &self.0 } @@ -536,16 +536,16 @@ impl ByteArray for RistrettoPublicKey { //---------------------------------- PublicKey Add / Sub / Mul ---------------------------------------------// -impl<'a, 'b> Add<&'b RistrettoPublicKey> for &'a RistrettoPublicKey { +impl<'a> Add<&'a RistrettoPublicKey> for &RistrettoPublicKey { type Output = RistrettoPublicKey; - fn add(self, rhs: &'b RistrettoPublicKey) -> RistrettoPublicKey { + fn add(self, rhs: &'a RistrettoPublicKey) -> RistrettoPublicKey { let p_sum = self.point + rhs.point; RistrettoPublicKey::new_from_pk(p_sum) } } -impl<'a, 'b> Sub<&'b RistrettoPublicKey> for &'a RistrettoPublicKey { +impl Sub<&RistrettoPublicKey> for &RistrettoPublicKey { type Output = RistrettoPublicKey; fn sub(self, rhs: &RistrettoPublicKey) -> RistrettoPublicKey { @@ -554,19 +554,19 @@ impl<'a, 'b> Sub<&'b RistrettoPublicKey> for &'a RistrettoPublicKey { } } -impl<'a, 'b> Mul<&'b RistrettoSecretKey> for &'a RistrettoPublicKey { +impl<'a> Mul<&'a RistrettoSecretKey> for &RistrettoPublicKey { type Output = RistrettoPublicKey; - fn mul(self, rhs: &'b RistrettoSecretKey) -> RistrettoPublicKey { + fn mul(self, rhs: &'a RistrettoSecretKey) -> RistrettoPublicKey { let p = rhs.0 * self.point; RistrettoPublicKey::new_from_pk(p) } } -impl<'a, 'b> Mul<&'b RistrettoSecretKey> for &'a RistrettoSecretKey { +impl<'a> Mul<&'a RistrettoSecretKey> for &RistrettoSecretKey { type Output = RistrettoSecretKey; - fn mul(self, rhs: &'b RistrettoSecretKey) -> RistrettoSecretKey { + fn mul(self, rhs: &'a RistrettoSecretKey) -> RistrettoSecretKey { let p = &rhs.0 * &self.0; RistrettoSecretKey(p) } diff --git a/src/ristretto/serialize.rs b/src/ristretto/serialize.rs index b213322b..86c1f509 100644 --- a/src/ristretto/serialize.rs +++ b/src/ristretto/serialize.rs @@ -42,7 +42,7 @@ impl<'de> Deserialize<'de> for RistrettoPublicKey { where D: Deserializer<'de> { struct RistrettoPubKeyVisitor; - impl<'de> Visitor<'de> for RistrettoPubKeyVisitor { + impl Visitor<'_> for RistrettoPubKeyVisitor { type Value = RistrettoPublicKey; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -80,7 +80,7 @@ impl<'de> Deserialize<'de> for RistrettoSecretKey { where D: Deserializer<'de> { struct RistrettoVisitor; - impl<'de> Visitor<'de> for RistrettoVisitor { + impl Visitor<'_> for RistrettoVisitor { type Value = RistrettoSecretKey; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/signatures/commitment_signature.rs b/src/signatures/commitment_signature.rs index 412b3580..ae4118fd 100644 --- a/src/signatures/commitment_signature.rs +++ b/src/signatures/commitment_signature.rs @@ -45,7 +45,6 @@ pub enum CommitmentSignatureError { /// Verification of the Commitment Signature (R, u, v) entails the following: /// S = v*H + u*G ... (Pedersen commitment of the publicly known private signature keys) /// S =? R + e.C ... (final verification) - #[allow(non_snake_case)] #[derive(Debug, Clone)] #[cfg_attr(feature = "borsh", derive(borsh::BorshDeserialize, borsh::BorshSerialize))]