GF128.multiply

Multiplies x by y using schoolbook multiplication. Result stored in x.

struct GF128
static nothrow @nogc
void
multiply
(
T[] x
,
in T[] y
)

Examples

test multiplication by one

t {
		immutable block x0 = cast(immutable block) x"66e94bd4ef8a2c3b884cfa59ca342b2e";
		block x1 = x0;

		block one;
		one[0] = ONE;
		
		multiply(x1, one);
		
		assert(x1 == x0, "GCM multiplication by ONE failed!")

test multiplication

t {

		immutable block H = cast(immutable block)x"66e94bd4ef8a2c3b884cfa59ca342b2e";

		block x1 = cast(immutable block) x"0388dace60b6a392f328c2b971b2fe78";

		multiply(x1, H);
		
		assert(x1 == x"5e2ec746917062882c85b0685353deb7", "GCM multiplication failed!")

Meta