Add csub variant taking offset parameters
@@ -269,6 +269,19 @@ public static int csub(int len, int mask, int[] x, int[] y, int[] z)
return (int)c;
}
+ public static int csub(int len, int mask, int[] x, int xOff, int[] y, int yOff, int[] z, int zOff)
+ {
+ long MASK = -(mask & 1) & M;
+ long c = 0;
+ for (int i = 0; i < len; ++i)
+ {
+ c += (x[xOff + i] & M) - (y[yOff + i] & MASK);
+ z[zOff + i] = (int)c;
+ c >>= 32;
+ }
+ return (int)c;
+ }
+
public static int dec(int len, int[] z)
{
for (int i = 0; i < len; ++i)
