operator * method
- BinaryPolynomial other
Multiplies two polynomials over GF(2).
Implementation
BinaryPolynomial operator *(BinaryPolynomial other) {
var multiplier = other.coefficients;
var shiftedMultiplicand = coefficients;
var product = BigInt.zero;
while (multiplier != BigInt.zero) {
if (multiplier.isOdd) {
product ^= shiftedMultiplicand;
}
multiplier >>= 1;
shiftedMultiplicand <<= 1;
}
return BinaryPolynomial(product);
}