Skip to content

Commit

Permalink
feat: update dependancies (#236)
Browse files Browse the repository at this point in the history
update tari utilities to 0.8
update borsh to 1.5

Release new version
  • Loading branch information
SWvheerden authored Oct 10, 2024
1 parent 2a1715a commit 9f0507c
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion benches/commitment.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 1 addition & 1 deletion benches/signatures.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
4 changes: 4 additions & 0 deletions lints.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ deny = [
warn = [
'clippy::uninlined_format_args',
'clippy::too_many_arguments',
]

allow = [
'clippy::too_long_first_doc_paragraph',
]
26 changes: 13 additions & 13 deletions src/ristretto/ristretto_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -245,7 +245,7 @@ impl From<u64> for RistrettoSecretKey {

//--------------------------------------------- Borrow impl -------------------------------------------------//

impl<'a> Borrow<Scalar> for &'a RistrettoSecretKey {
impl Borrow<Scalar> for &RistrettoSecretKey {
fn borrow(&self) -> &Scalar {
&self.0
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions src/ristretto/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/signatures/commitment_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down

0 comments on commit 9f0507c

Please sign in to comment.