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

SOT-155: Nova #17

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

SOT-155: Nova #17

wants to merge 18 commits into from

Conversation

VanhGer
Copy link
Contributor

@VanhGer VanhGer commented Jul 22, 2024

No description provided.

Copy link

linear bot commented Jul 22, 2024

/// # Returns
///
/// The commitment to the polynomial.
pub fn commit_vector(&self, coeffs: &Vec<ScalarField>) -> KzgCommitment {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
/// # Returns
///
/// The opening at the specified point.
pub fn open_vector(&self, coeffs: &Vec<ScalarField>, z: impl Into<Fr>) -> KzgOpening {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
r: ScalarField,
fw1: &FWitness,
fw2: &FWitness,
t: &Vec<ScalarField>,

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
}
#[allow(dead_code)]
impl FWitness {
pub fn new(w: &Vec<ScalarField>, len: usize) -> Self {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
}

/// Commit a witness into its corresponding instance.
pub fn commit(&self, scheme: &KzgScheme, x: &Vec<ScalarField>) -> FInstance {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
///
/// A vector resulting from subtracting `b` from `a`.
#[allow(dead_code)]
pub fn vec_sub<F: PrimeField>(a: &Vec<F>, b: &Vec<F>) -> Vec<F> {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
///
/// A vector resulting from adding `a` and `b`.
#[allow(dead_code)]
pub fn vec_add<F: PrimeField>(a: &Vec<F>, b: &Vec<F>) -> Vec<F> {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
///
/// A vector resulting from adding `a` and `b`.
#[allow(dead_code)]
pub fn vec_add<F: PrimeField>(a: &Vec<F>, b: &Vec<F>) -> Vec<F> {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
///
/// `true` if `a` and `b` are equal, `false` otherwise.
#[allow(dead_code)]
pub fn vec_equal<F: PrimeField>(a: &Vec<F>, b: &Vec<F>) -> bool {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
///
/// `true` if `a` and `b` are equal, `false` otherwise.
#[allow(dead_code)]
pub fn vec_equal<F: PrimeField>(a: &Vec<F>, b: &Vec<F>) -> bool {

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
@VanhGer VanhGer force-pushed the sot-155-nova branch 2 times, most recently from 363e046 to 492c750 Compare July 22, 2024 08:27
///
/// The commitment to the polynomial.
pub fn commit_vector(&self, coeffs: &[ScalarField]) -> KzgCommitment {
let new_poly = DensePolynomial::from_coefficients_vec(coeffs.clone().into());

Check warning

Code scanning / clippy

call to .clone() on a reference in this situation does nothing Warning

call to .clone() on a reference in this situation does nothing
/// The opening at the specified point.
pub fn open_vector(&self, coeffs: &[ScalarField], z: impl Into<Fr>) -> KzgOpening {
let z = z.into();
let mut polynomial = DensePolynomial::from_coefficients_vec(coeffs.clone().into());

Check warning

Code scanning / clippy

call to .clone() on a reference in this situation does nothing Warning

call to .clone() on a reference in this situation does nothing
r1cs: &R1CS<ScalarField>,
u1: ScalarField,
u2: ScalarField,
z1: &Vec<ScalarField>,

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
u1: ScalarField,
u2: ScalarField,
z1: &Vec<ScalarField>,
z2: &Vec<ScalarField>,

Check warning

Code scanning / clippy

writing &Vec instead of &[_] involves a new object where a slice will do Warning

writing &Vec instead of &[\_] involves a new object where a slice will do
Comment on lines 102 to 107
let a = to_f_matrix::<F>(&vec![
vec![1, 0, 0, 0, 0, 0],
vec![0, 1, 0, 0, 0, 0],
vec![1, 0, 1, 0, 0, 0],
vec![0, 0, 0, 1, 0, 5],
]);

Check warning

Code scanning / clippy

useless use of vec! Warning

useless use of vec!
Comment on lines 108 to 113
let b = to_f_matrix::<F>(&vec![
vec![1, 0, 0, 0, 0, 0],
vec![1, 0, 0, 0, 0, 0],
vec![0, 0, 0, 0, 0, 1],
vec![0, 0, 0, 0, 0, 1],
]);

Check warning

Code scanning / clippy

useless use of vec! Warning

useless use of vec!
Comment on lines 114 to 119
let c = to_f_matrix::<F>(&vec![
vec![0, 1, 0, 0, 0, 0],
vec![0, 0, 1, 0, 0, 0],
vec![0, 0, 0, 1, 0, 0],
vec![0, 0, 0, 0, 1, 0],
]);

Check warning

Code scanning / clippy

useless use of vec! Warning

useless use of vec!
FWitness {
e: vec![ScalarField::zero(); len],
// rE: ScalarField::rand(&mut rand::thread_rng()),
w: w.clone().into(),

Check warning

Code scanning / clippy

call to .clone() on a reference in this situation does nothing Warning

call to .clone() on a reference in this situation does nothing
com_e,
u: ScalarField::one(),
com_w,
x: x.clone().into(),

Check warning

Code scanning / clippy

call to .clone() on a reference in this situation does nothing Warning

call to .clone() on a reference in this situation does nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants