@@ -170,12 +170,12 @@ impl<F: FftField> DensePolynomial<F> {
170
170
pub fn divide_by_vanishing_poly < D : EvaluationDomain < F > > (
171
171
& self ,
172
172
domain : D ,
173
- ) -> Option < ( DensePolynomial < F > , DensePolynomial < F > ) > {
173
+ ) -> ( DensePolynomial < F > , DensePolynomial < F > ) {
174
174
let domain_size = domain. size ( ) ;
175
175
176
176
if self . coeffs . len ( ) < domain_size {
177
177
// If degree(self) < len(Domain), then the quotient is zero, and the entire polynomial is the remainder
178
- Some ( ( DensePolynomial :: < F > :: zero ( ) , self . clone ( ) ) )
178
+ ( DensePolynomial :: < F > :: zero ( ) , self . clone ( ) )
179
179
} else {
180
180
// Compute the quotient
181
181
//
@@ -211,7 +211,7 @@ impl<F: FftField> DensePolynomial<F> {
211
211
212
212
let quotient = DensePolynomial :: < F > :: from_coefficients_vec ( quotient_vec) ;
213
213
let remainder = DensePolynomial :: < F > :: from_coefficients_vec ( remainder_vec) ;
214
- Some ( ( quotient, remainder) )
214
+ ( quotient, remainder)
215
215
}
216
216
}
217
217
}
@@ -936,7 +936,7 @@ mod tests {
936
936
let domain = GeneralEvaluationDomain :: new ( 1 << size) . unwrap ( ) ;
937
937
for degree in 0 ..12 {
938
938
let p = DensePolynomial :: < Fr > :: rand ( degree * 100 , rng) ;
939
- let ( quotient, remainder) = p. divide_by_vanishing_poly ( domain) . unwrap ( ) ;
939
+ let ( quotient, remainder) = p. divide_by_vanishing_poly ( domain) ;
940
940
let p_recovered = quotient. mul_by_vanishing_poly ( domain) + remainder;
941
941
assert_eq ! ( p, p_recovered) ;
942
942
}
0 commit comments