Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyathakur44 committed Dec 16, 2024
1 parent aed2e35 commit 99538af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/tables/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ impl IOTable {
challenge: FieldElement,
) -> Vec<FieldElement> {
let mut ea = FieldElement::new(rand_field_elem, self.table.field); // take rand_field_elem as zero if no random secret implementation
self.table.matrix[0][1] = ea;
let mut terminal: Vec<FieldElement> = Vec::new();
if(self.table.matrix.len()>0){
self.table.matrix[0][1] = ea;
for i in 0..self.table.length - 1 {
ea = self.table.matrix[i as usize][1] * challenge
+ self.table.matrix[(i + 1) as usize][0];
self.table.matrix[(i + 1) as usize][1] = ea;
//Tea = IOTable.matrix[length-1][1]
}
let mut terminal: Vec<FieldElement> = Vec::new();
terminal.push(ea);
}
terminal
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/univariate_polynomial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ impl Mul for Polynomial {

impl MulAssign for Polynomial {
fn mul_assign(&mut self, other: Polynomial) {
let field = self.coefficients[0].modulus();
if(self.coefficients.len()>0){
let field = self.coefficients[0].modulus();
let mut result = vec![
FieldElement::new(0, Field::new(field));
self.coefficients.len() + other.coefficients.len() - 1
Expand All @@ -308,8 +309,8 @@ impl MulAssign for Polynomial {
result[i + j] += self.coefficients[i] * other.coefficients[j];
}
}

self.coefficients = result;
self.coefficients = result
}
}
}

Expand Down

0 comments on commit 99538af

Please sign in to comment.