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

Implemented sumcheck protocol using the field elements and a custom built implementation of a multivariate polynomial #148

Closed
wants to merge 2 commits into from
Closed
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ cgt* # ignore instatiations of my test template
# don't leak secret env vars
.env

.history/*

# exclude compiled files and binaries
debug/
target/
Expand Down
110 changes: 110 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ description="""ronkathon"""
edition ="2021"
license ="Apache2.0 OR MIT"
name ="ronkathon"
repository ="https://github.com/pluto/ronkathon"

repository ="https://github.com/wu-s-john/ronkathon"
version ="0.1.0"

[dependencies]
rand ="0.8.5"
itertools="0.13.0"
hex ="0.4.3"
nalgebra = "0.29"

[dev-dependencies]
rstest ="0.22.0"
Expand Down
9 changes: 8 additions & 1 deletion src/algebra/field/prime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{fmt, str::FromStr};
use rand::{distributions::Standard, prelude::Distribution, Rng};

use super::*;
use crate::algebra::Finite;
use crate::{algebra::Finite, random::Random};

mod arithmetic;

Expand Down Expand Up @@ -41,6 +41,13 @@ pub struct PrimeField<const P: usize> {
pub(crate) value: usize,
}

impl Random for PlutoBaseField {
fn random<R: Rng + ?Sized>(rng: &mut R) -> Self {
let value = rng.gen_range(0..PlutoPrime::Base as usize);
PlutoBaseField::new(value)
}
}

impl<const P: usize> PrimeField<P> {
/// Creates a new element of the [`PrimeField`] and will automatically compute the modulus and
/// return a congruent element between 0 and `P`. Given the `const fn is_prime`, a program that
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pub mod encryption;
pub mod hashes;
pub mod kzg;
pub mod polynomial;
pub mod random;
pub mod sumcheck;
pub mod tree;

use core::{
Expand Down
1 change: 1 addition & 0 deletions src/polynomial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use super::*;
use crate::algebra::field::FiniteField;

pub mod arithmetic;
pub mod multivariate_polynomial;
#[cfg(test)] mod tests;

// https://people.inf.ethz.ch/gander/papers/changing.pdf
Expand Down
Loading
Loading