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 Nov 24, 2023
1 parent fdaace6 commit 0c2232b
Show file tree
Hide file tree
Showing 5 changed files with 672 additions and 584 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 0c2232b

Please sign in to comment.