diff --git a/p256/src/arithmetic/scalar/scalar32.rs b/p256/src/arithmetic/scalar/scalar32.rs index d72367df0..ebc5e874a 100644 --- a/p256/src/arithmetic/scalar/scalar32.rs +++ b/p256/src/arithmetic/scalar/scalar32.rs @@ -25,13 +25,13 @@ const MU: [Limb; 9] = [ /// The general algorithm is: /// ```text /// p = n = order of group -/// b = 2^64 = 64bit machine word -/// k = 4 +/// b = 2^32 = 32bit machine word +/// k = 8 /// a \in [0, 2^512] /// mu := floor(b^{2k} / p) /// q1 := floor(a / b^{k - 1}) /// q2 := q1 * mu -/// q3 := <- floor(a / b^{k - 1}) +/// q3 := floor(q2 / b^{k + 1}) /// r1 := a mod b^{k + 1} /// r2 := q3 * m mod b^{k + 1} /// r := r1 - r2 diff --git a/p256/src/arithmetic/scalar/scalar64.rs b/p256/src/arithmetic/scalar/scalar64.rs index f29587214..532ffed3a 100644 --- a/p256/src/arithmetic/scalar/scalar64.rs +++ b/p256/src/arithmetic/scalar/scalar64.rs @@ -27,7 +27,7 @@ const MU: [Limb; 5] = [ /// mu := floor(b^{2k} / p) /// q1 := floor(a / b^{k - 1}) /// q2 := q1 * mu -/// q3 := <- floor(a / b^{k - 1}) +/// q3 := floor(q2 / b^{k + 1}) /// r1 := a mod b^{k + 1} /// r2 := q3 * m mod b^{k + 1} /// r := r1 - r2