symm/gcm-*.S (mul256): Label the partial-product terms correctly.
[catacomb] / symm / gcm-x86ish-pclmul.S
index 5edf56e..d56cfd1 100644 (file)
        //      u v = SUM_{0<=i,j<n} u_i v_j t^{i+j}
        //
        // Suppose instead that we're given ũ = SUM_{0<=i<n} u_{n-i-1} t^i
-       // and  = SUM_{0<=j<n} v_{n-j-1} t^j, so the bits are backwards.
+       // and  = SUM_{0<=j<n} v_{n-j-1} t^j, so the bits are backwards.
        // Then
        //
-       //      ũ  = SUM_{0<=i,j<n} u_{n-i-1} v_{n-j-1} t^{i+j}
+       //      ũ  = SUM_{0<=i,j<n} u_{n-i-1} v_{n-j-1} t^{i+j}
        //          = SUM_{0<=i,j<n} u_i v_j t^{2n-2-(i+j)}
        //
        // which is almost the bit-reversal of u v, only it's shifted right
        //
        //      q = r s = (u_0 + u_1) (v_0 + v_1)
        //        = (u_0 v_0) + (u1 v_1) + (u_0 v_1 + u_1 v_0)
-       //        = a + d + c
+       //        = a + c + b
        //
        // The first two terms we've already calculated; the last is the
        // remaining one we want.  We'll set B = t^128.  We know how to do