Skip to content

Commit

Permalink
protogalaxy: small refactor and add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaucube committed Dec 10, 2023
1 parent e0d225a commit 02ec77c
Show file tree
Hide file tree
Showing 6 changed files with 672 additions and 585 deletions.
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
Loading

0 comments on commit 02ec77c

Please sign in to comment.