public static unsafe void MultiplyMod2p32pmod (uint [] x, int xOffset, int xLen, uint [] y, int yOffest, int yLen, uint [] d, int dOffset, int mod)
{
fixed (uint* xx = x, yy = y, dd = d) {
uint* xP = xx + xOffset,
xE = xP + xLen,
yB = yy + yOffest,
yE = yB + yLen,
dB = dd + dOffset,
dE = dB + mod;
for (; xP < xE; xP++, dB++) {
if (*xP == 0) continue;
ulong mcarry = 0;
uint* dP = dB;
for (uint* yP = yB; yP < yE && dP < dE; yP++, dP++) {
mcarry += ((ulong)*xP * (ulong)*yP) + (ulong)*dP;
*dP = (uint)mcarry;
mcarry >>= 32;
}
if (mcarry != 0 && dP < dE)
*dP = (uint)mcarry;
}
}
}