Merge pull request #677 from mir-protocol/u160_comments

Tweak comments
This commit is contained in:
Daniel Lubarov 2022-08-19 18:28:49 -07:00 committed by GitHub
commit 3a6bbd825c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,14 +112,14 @@ impl Mul for QuinticExtension<GoldilocksField> {
* result coefficient is necessary.
*/
/// Return a, b such that a + b*2^128 = 3*x with a < 2^128 and b < 2^32.
/// Return `a`, `b` such that `a + b*2^128 = 3*(x + y*2^128)` with `a < 2^128` and `b < 2^32`.
#[inline(always)]
fn u160_times_3(x: u128, y: u32) -> (u128, u32) {
let (s, cy) = x.overflowing_add(x << 1);
(s, 3 * y + (x >> 127) as u32 + cy as u32)
}
/// Return a, b such that a + b*2^128 = 7*x with a < 2^128 and b < 2^32.
/// Return `a`, `b` such that `a + b*2^128 = 7*(x + y*2^128)` with `a < 2^128` and `b < 2^32`.
#[inline(always)]
fn u160_times_7(x: u128, y: u32) -> (u128, u32) {
let (d, br) = (x << 3).overflowing_sub(x);