Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: neptune v13.0.0 #252

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
28 changes: 0 additions & 28 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,34 +539,6 @@ pub fn mul_sum<CS: ConstraintSystem<Scalar>, 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<CS: ConstraintSystem<Scalar>, Scalar: PrimeField>(
mut cs: CS,
a: &AllocatedNum<Scalar>,
b: &AllocatedNum<Scalar>,
to_add: Scalar,
enforce: bool,
) -> Result<AllocatedNum<Scalar>, 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<Scalar: PrimeField, CS: ConstraintSystem<Scalar>>(
elts: &[Elt<Scalar>],
scalars: &[Scalar],
Expand Down
28 changes: 0 additions & 28 deletions src/circuit2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,34 +636,6 @@ pub fn mul_sum<CS: ConstraintSystem<Scalar>, 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<CS: ConstraintSystem<Scalar>, Scalar: PrimeField>(
mut cs: CS,
a: &AllocatedNum<Scalar>,
b: &AllocatedNum<Scalar>,
to_add: Scalar,
enforce: bool,
) -> Result<AllocatedNum<Scalar>, 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<Scalar: PrimeField, CS: ConstraintSystem<Scalar>>(
elts: &[Elt<Scalar>],
scalars: &[Scalar],
Expand Down
9 changes: 0 additions & 9 deletions src/mds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@ pub struct SparseMatrix<F: PrimeField> {
}

impl<F: PrimeField> SparseMatrix<F> {
#[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<F>) -> Self {
Self::new_from_ref(&m_double_prime)
}

pub fn new_from_ref(m_double_prime: &Matrix<F>) -> Self {
assert!(Self::is_sparse_matrix(m_double_prime));
let size = matrix::rows(m_double_prime);
Expand Down
Loading