multi-commiting/opening (#34)

This commit is contained in:
zhenfei
2022-06-30 12:48:10 -04:00
committed by GitHub
parent a8c73783a2
commit d41a0cf623
10 changed files with 1050 additions and 35 deletions

View File

@@ -16,6 +16,8 @@ pub use perm_check::{
PermutationCheck,
};
pub use sum_check::SumCheck;
pub use transcript::IOPTranscript;
pub use utils::*;
pub use virtual_poly::{VPAuxInfo, VirtualPolynomial};
pub use zero_check::ZeroCheck;

View File

@@ -28,7 +28,7 @@ pub struct IOPTranscript<F: PrimeField> {
impl<F: PrimeField> IOPTranscript<F> {
/// Create a new IOP transcript.
pub(crate) fn new(label: &'static [u8]) -> Self {
pub fn new(label: &'static [u8]) -> Self {
Self {
transcript: Transcript::new(label),
is_empty: true,
@@ -59,7 +59,7 @@ impl<F: PrimeField> IOPTranscript<F> {
}
// Append the message to the transcript.
pub(crate) fn append_field_element(
pub fn append_field_element(
&mut self,
label: &'static [u8],
field_elem: &F,
@@ -83,10 +83,7 @@ impl<F: PrimeField> IOPTranscript<F> {
//
// The output field element is statistical uniform as long
// as the field has a size less than 2^384.
pub(crate) fn get_and_append_challenge(
&mut self,
label: &'static [u8],
) -> Result<F, PolyIOPErrors> {
pub fn get_and_append_challenge(&mut self, label: &'static [u8]) -> Result<F, PolyIOPErrors> {
// we need to reject when transcript is empty
if self.is_empty {
return Err(PolyIOPErrors::InvalidTranscript(

View File

@@ -13,7 +13,7 @@ macro_rules! to_bytes {
/// Decompose an integer into a binary vector in little endian.
#[allow(dead_code)]
pub(crate) fn bit_decompose(input: u64, num_var: usize) -> Vec<bool> {
pub fn bit_decompose(input: u64, num_var: usize) -> Vec<bool> {
let mut res = Vec::with_capacity(num_var);
let mut i = input;
for _ in 0..num_var {