Skip to content

Commit

Permalink
Revert "Reject secret polynomial evaluation at zero (#9)"
Browse files Browse the repository at this point in the history
This reverts commit 1bca2dd.
  • Loading branch information
asta-li committed Aug 10, 2023
1 parent 1bca2dd commit fd5d3a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function interpolatePolynomial(xSamples: Uint8Array, ySamples: Uint8Array, x: nu
// Evaluates a polynomial with the given x using Horner's method.
function evaluate(coefficients: Uint8Array, x: number, degree: number) {
if (x === 0) {
throw new Error('cannot evaluate secret polynomial at zero')
return coefficients[0]!;
}

let result = coefficients[degree]!;
Expand Down

0 comments on commit fd5d3a0

Please sign in to comment.