mirror of
https://github.com/arnaucube/testudo.git
synced 2026-01-12 16:51:28 +01:00
migrate codebase to arkworks and change curve to bls12-377
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
//! `(Z3 + 5) * 1 - I0 = 0`
|
||||
//!
|
||||
//! [here]: https://medium.com/@VitalikButerin/quadratic-arithmetic-programs-from-zero-to-hero-f6d558cea649
|
||||
use ark_bls12_377::Fr as Scalar;
|
||||
use ark_ff::{BigInteger, PrimeField};
|
||||
use ark_std::{One, UniformRand, Zero};
|
||||
use libspartan::{InputsAssignment, Instance, SNARKGens, VarsAssignment, SNARK};
|
||||
use merlin::Transcript;
|
||||
|
||||
@@ -7,7 +7,12 @@ use lazy_static::lazy_static;
|
||||
use num_bigint::BigInt;
|
||||
use crate::errors::ProofVerifyError;
|
||||
|
||||
use super::scalar::{Scalar};
|
||||
use lazy_static::lazy_static;
|
||||
use num_bigint::BigInt;
|
||||
|
||||
use super::scalar::Scalar;
|
||||
use ark_ec::{AffineCurve, ProjectiveCurve};
|
||||
use ark_serialize::*;
|
||||
use core::borrow::Borrow;
|
||||
use core::ops::{Mul, MulAssign};
|
||||
use ark_ec::{ProjectiveCurve, AffineCurve};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#![allow(non_snake_case)]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![deny(missing_docs)]
|
||||
#![feature(test)]
|
||||
#![allow(clippy::assertions_on_result_states)]
|
||||
|
||||
extern crate ark_std;
|
||||
@@ -120,7 +121,6 @@ pub type VarsAssignment = Assignment;
|
||||
/// `InputsAssignment` holds an assignment of values to variables in an `Instance`
|
||||
pub type InputsAssignment = Assignment;
|
||||
|
||||
/// `Instance` holds the description of R1CS matrices
|
||||
/// `Instance` holds the description of R1CS matrices and a hash of the matrices
|
||||
#[derive(Debug)]
|
||||
pub struct Instance {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
use crate::math::Math;
|
||||
|
||||
use super::super::errors::ProofVerifyError;
|
||||
use super::super::group::{
|
||||
CompressGroupElement, CompressedGroup, DecompressGroupElement, GroupElement,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
use crate::math::Math;
|
||||
|
||||
use super::commitments::{Commitments, MultiCommitGens};
|
||||
use super::errors::ProofVerifyError;
|
||||
use super::group::{
|
||||
|
||||
@@ -147,9 +147,9 @@ impl R1CSInstance {
|
||||
}
|
||||
|
||||
pub fn get_digest(&self) -> Vec<u8> {
|
||||
let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default());
|
||||
bincode::serialize_into(&mut encoder, &self).unwrap();
|
||||
encoder.finish().unwrap()
|
||||
let mut bytes = Vec::new();
|
||||
self.serialize(&mut bytes).unwrap();
|
||||
bytes
|
||||
}
|
||||
|
||||
pub fn produce_synthetic_r1cs(
|
||||
|
||||
@@ -830,6 +830,7 @@ impl ZKSumcheckInstanceProof {
|
||||
comm_claim_per_round.append_to_transcript(b"comm_claim_per_round", transcript);
|
||||
comm_eval.append_to_transcript(b"comm_eval", transcript);
|
||||
|
||||
|
||||
// produce two weights
|
||||
let w = transcript.challenge_vector(b"combine_two_claims_to_one", 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user