From 517c75abe2f442613d6d260ea21b294e8f0d8bcc Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Wed, 23 Jun 2021 11:51:16 +0200 Subject: [PATCH] Add comment for `ReducingFactor` --- src/util/scaling.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/scaling.rs b/src/util/scaling.rs index 25da24c7..cea86195 100644 --- a/src/util/scaling.rs +++ b/src/util/scaling.rs @@ -4,6 +4,13 @@ use crate::field::extension_field::Frobenius; use crate::field::field::Field; use crate::polynomial::polynomial::PolynomialCoeffs; +/// When verifying the composition polynomial in FRI we have to compute sums of the form +/// `(sum_0^k a^i * x_i)/d_0 + (sum_k^r a^i * y_i)/d_1` +/// The most efficient way to do this is to compute both quotient separately using Horner's method, +/// scale the second one by `a^(r-1-k)`, and add them up. +/// This struct abstract away these operations by implementing Horner's method and keeping track +/// of the number of multiplications by `a` to compute the scaling factor. +/// See https://github.com/mir-protocol/plonky2/pull/69 for more details and discussions. #[derive(Debug, Copy, Clone)] pub struct ReducingFactor { base: F,