Skip to content

Commit

Permalink
Port ProtoGalaxy from https://github.com/arnaucube/protogalaxy-poc ad…
Browse files Browse the repository at this point in the history
…apting it to the current folding-schemes lib (#37)

Port ProtoGalaxy initial version from
https://github.com/arnaucube/protogalaxy-poc adapting it to the current
folding-schemes lib, which is a first iteration that implements the
Lagrange-basis version from
[ProtoGalaxy](https://eprint.iacr.org/2023/1106) folding scheme.  There
are some pending optimizations, but is a first step towards integrating
ProtoGalaxy in the library.
  • Loading branch information
arnaucube authored Dec 18, 2023
1 parent b4f42e7 commit b9af318
Show file tree
Hide file tree
Showing 11 changed files with 755 additions and 14 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ tracing = { version = "0.1", default-features = false, features = [ "attributes"
tracing-subscriber = { version = "0.2" }

[features]
default = ["parallel", "nova", "hypernova"]
hypernova=[]
nova=[]
default = ["parallel"]

parallel = [
"ark-std/parallel",
Expand Down
14 changes: 12 additions & 2 deletions src/decider/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ pub fn vec_add<F: PrimeField>(
b: &Vec<FpVar<F>>,
) -> Result<Vec<FpVar<F>>, Error> {
if a.len() != b.len() {
return Err(Error::NotSameLength(a.len(), b.len()));
return Err(Error::NotSameLength(
"a.len()".to_string(),
a.len(),
"b.len()".to_string(),
b.len(),
));
}
let mut r: Vec<FpVar<F>> = vec![FpVar::<F>::zero(); a.len()];
for i in 0..a.len() {
Expand All @@ -68,7 +73,12 @@ pub fn hadamard<F: PrimeField>(
b: &Vec<FpVar<F>>,
) -> Result<Vec<FpVar<F>>, Error> {
if a.len() != b.len() {
return Err(Error::NotSameLength(a.len(), b.len()));
return Err(Error::NotSameLength(
"a.len()".to_string(),
a.len(),
"b.len()".to_string(),
b.len(),
));
}
let mut r: Vec<FpVar<F>> = vec![FpVar::<F>::zero(); a.len()];
for i in 0..a.len() {
Expand Down
3 changes: 1 addition & 2 deletions src/folding/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod circuits;
#[cfg(feature = "hypernova")]
pub mod hypernova;
#[cfg(feature = "nova")]
pub mod nova;
pub mod protogalaxy;
Loading

0 comments on commit b9af318

Please sign in to comment.