Skip to content

Commit

Permalink
Upgrade bulletproofs to 5.0.0 (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stentonian authored Jul 6, 2024
2 parents 244c252 + 46b764c commit e7270f1
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## v0.4.0 (2024-07-06)

- Upgraded Bulletproofs library to 5.0 [PR 167](https://github.com/silversixpence-crypto/dapol/pull/167)

## v0.3.2 (2024-05-28)

- Added a spec [PR 153](https://github.com/silversixpence-crypto/dapol/pull/153)
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dapol"
version = "0.3.2"
version = "0.4.0"
authors = ["Stenton Mayne <stentonian@protonmail.com>"]
edition = "2021"
description = "DAPOL+ Proof of Liabilities protocol"
Expand Down Expand Up @@ -39,8 +39,8 @@ sha2 = "0.10.8"
blake3 = "1.5.0"
digest = "0.10.7"
merlin = "3.0.0" # Transcript is required by bulletproofs library
bulletproofs = "4.0.0"
curve25519-dalek-ng = "4.1.1"
bulletproofs = "5.0.0"
curve25519-dalek = "4.1.3"

# concurrency
displaydoc = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion src/accumulators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! types of accumulators, which can all be found under this module.

use clap::ValueEnum;
use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
use primitive_types::H256;
use serde::{Deserialize, Serialize};
use std::fmt;
Expand Down
2 changes: 1 addition & 1 deletion src/accumulators/ndm_smt.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashMap;

use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
use primitive_types::H256;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion src/binary_tree/node_content/full_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::hasher::Hasher;
use crate::secret::Secret;

use bulletproofs::PedersenGens;
use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
use primitive_types::H256;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion src/binary_tree/node_content/hidden_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! fields in the struct.

use bulletproofs::PedersenGens;
use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
use primitive_types::H256;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion src/dapol_tree.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bulletproofs::PedersenGens;
use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
use log::{debug, info};
use primitive_types::H256;
use serde::{Deserialize, Serialize};
Expand Down
6 changes: 3 additions & 3 deletions src/inclusion_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl InclusionProof {
path_nodes: &Vec<Node<HiddenNodeContent>>,
) -> Result<(), InclusionProofError> {
use bulletproofs::PedersenGens;
use curve25519_dalek_ng::scalar::Scalar;
use curve25519_dalek::scalar::Scalar;

// PartialEq for HiddenNodeContent does not depend on the commitment so we can
// make this whatever we like
Expand Down Expand Up @@ -235,7 +235,7 @@ impl InclusionProof {
tree_height: Height,
path_nodes: &Vec<Node<HiddenNodeContent>>,
) -> Result<(), InclusionProofError> {
use curve25519_dalek_ng::ristretto::CompressedRistretto;
use curve25519_dalek::ristretto::CompressedRistretto;

let aggregation_index = self.aggregation_factor.apply_to(&tree_height) as usize;

Expand Down Expand Up @@ -432,7 +432,7 @@ mod tests {
use crate::hasher::Hasher;

use bulletproofs::PedersenGens;
use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};
use primitive_types::H256;

// The tree that is built, with path highlighted.
Expand Down
4 changes: 2 additions & 2 deletions src/inclusion_proof/aggregated_range_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
//! more efficient, but for $n=255$ padding would win.

use bulletproofs::{BulletproofGens, PedersenGens, RangeProof};
use curve25519_dalek_ng::{ristretto::CompressedRistretto, scalar::Scalar};
use curve25519_dalek::{ristretto::CompressedRistretto, scalar::Scalar};
use merlin::Transcript;
use serde::{Deserialize, Serialize};

Expand All @@ -63,7 +63,7 @@ pub enum AggregatedRangeProof {
// TODO are these the best option for the pad? Maybe there is another option
// that gives efficiency guarantees
fn padding_tuple() -> (u64, Scalar) {
(0, Scalar::one())
(0, Scalar::ONE)
}

/// The transcript initial state must be the same for proof generation and
Expand Down
2 changes: 1 addition & 1 deletion src/inclusion_proof/individual_range_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// transcript maybe

use bulletproofs::{BulletproofGens, PedersenGens, RangeProof};
use curve25519_dalek_ng::{ristretto::CompressedRistretto, scalar::Scalar};
use curve25519_dalek::{ristretto::CompressedRistretto, scalar::Scalar};
use merlin::Transcript;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub use dapol_tree::{
SERIALIZED_ROOT_PVT_FILE_PREFIX, SERIALIZED_TREE_EXTENSION, SERIALIZED_TREE_FILE_PREFIX,
};

pub use curve25519_dalek_ng::{ristretto::RistrettoPoint, scalar::Scalar};
pub use curve25519_dalek::{ristretto::RistrettoPoint, scalar::Scalar};

mod dapol_config;
pub use dapol_config::{
Expand Down

0 comments on commit e7270f1

Please sign in to comment.