From 778a88a6ea9bacf244d43b4d20fc504902f5a20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Wed, 8 Nov 2023 13:53:57 -0500 Subject: [PATCH 1/2] fix: remove deprecated items --- src/circuit.rs | 28 ---------------------------- src/circuit2.rs | 28 ---------------------------- src/mds.rs | 9 --------- 3 files changed, 65 deletions(-) diff --git a/src/circuit.rs b/src/circuit.rs index 45347068..af613bf1 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -539,34 +539,6 @@ pub fn mul_sum, Scalar: PrimeField>( Ok(res) } -/// Calculates a * (b + to_add) — and enforces that constraint. -#[deprecated(since = "12.1.0", note = "use mul_sum instead")] -pub fn mul_pre_sum, Scalar: PrimeField>( - mut cs: CS, - a: &AllocatedNum, - b: &AllocatedNum, - to_add: Scalar, - enforce: bool, -) -> Result, SynthesisError> { - let res = AllocatedNum::alloc(cs.namespace(|| "mul_sum"), || { - let mut tmp = b.get_value().ok_or(SynthesisError::AssignmentMissing)?; - tmp.add_assign(&to_add); - tmp.mul_assign(&a.get_value().ok_or(SynthesisError::AssignmentMissing)?); - - Ok(tmp) - })?; - - if enforce { - cs.enforce( - || "mul sum constraint", - |lc| lc + b.get_variable() + (to_add, CS::one()), - |lc| lc + a.get_variable(), - |lc| lc + res.get_variable(), - ); - } - Ok(res) -} - fn scalar_product_with_add>( elts: &[Elt], scalars: &[Scalar], diff --git a/src/circuit2.rs b/src/circuit2.rs index ccda382d..a6ac3f02 100644 --- a/src/circuit2.rs +++ b/src/circuit2.rs @@ -636,34 +636,6 @@ pub fn mul_sum, Scalar: PrimeField>( Ok(res) } -/// Calculates a * (b + to_add) — and enforces that constraint. -#[deprecated(since = "12.1.0", note = "use mul_sum instead")] -pub fn mul_pre_sum, Scalar: PrimeField>( - mut cs: CS, - a: &AllocatedNum, - b: &AllocatedNum, - to_add: Scalar, - enforce: bool, -) -> Result, SynthesisError> { - let res = AllocatedNum::alloc(cs.namespace(|| "mul_sum"), || { - let mut tmp = b.get_value().ok_or(SynthesisError::AssignmentMissing)?; - tmp.add_assign(&to_add); - tmp.mul_assign(&a.get_value().ok_or(SynthesisError::AssignmentMissing)?); - - Ok(tmp) - })?; - - if enforce { - cs.enforce( - || "mul sum constraint", - |lc| lc + b.get_variable() + (to_add, CS::one()), - |lc| lc + a.get_variable(), - |lc| lc + res.get_variable(), - ); - } - Ok(res) -} - fn scalar_product_with_add>( elts: &[Elt], scalars: &[Scalar], diff --git a/src/mds.rs b/src/mds.rs index 1f1cd593..fbbdb5d2 100644 --- a/src/mds.rs +++ b/src/mds.rs @@ -71,15 +71,6 @@ pub struct SparseMatrix { } impl SparseMatrix { - #[allow(clippy::needless_pass_by_value)] - #[deprecated( - since = "12.1.0", - note = "Please use `SparseMatrix::new_from_ref` instead." - )] - pub fn new(m_double_prime: Matrix) -> Self { - Self::new_from_ref(&m_double_prime) - } - pub fn new_from_ref(m_double_prime: &Matrix) -> Self { assert!(Self::is_sparse_matrix(m_double_prime)); let size = matrix::rows(m_double_prime); From bba4dc99e53e8a36b808afa8c2a80ffd4f7520b6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 8 Nov 2023 18:41:25 +0000 Subject: [PATCH 2/2] chore: Release neptune version 13.0.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 95795606..34084f1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "neptune" description = "Poseidon hashing over BLS12-381 for Filecoin." -version = "12.0.0" +version = "13.0.0" authors = ["porcuquine "] edition = "2021" license = "MIT OR Apache-2.0"