Lines Matching +full:128 +full:b
1 /* gf128mul.h - GF(2^128) multiplication functions
46 An implementation of field multiplication in Galois Field GF(2^128)
58 * For some background on GF(2^128) see for example:
61 * The elements of GF(2^128) := GF(2)[X]/(X^128-X^7-X^2-X^1-1) can
66 * are left and the lsb's are right. char b[16] is an array and b[0] is
70 * b[0] b[1] b[2] b[3] b[13] b[14] b[15]
83 * b[15] = 0x87 and the rest is 0. LRW uses this convention and bbe
92 * primitive polynomial is b[0] = 0x87.
94 * The common machine word-size is smaller than 128 bits, so to make
123 * Multiplications in GF(2^128) are mostly bit-shifts, so you see why
129 * to keep elements of GF(2^128) in type u64[2]. On 32-bit wordsize
133 /* Multiply a GF(2^128) field element by x. Field elements are
162 * It multiplies a and b and puts the result in a */
163 void gf128mul_lle(be128 *a, const be128 *b);
165 void gf128mul_bbe(be128 *a, const be128 *b);
185 u64 b = be64_to_cpu(x->b); in gf128mul_x_lle() local
187 /* equivalent to gf128mul_table_le[(b << 7) & 0xff] << 48 in gf128mul_x_lle()
189 u64 _tt = gf128mul_mask_from_bit(b, 0) & ((u64)0xe1 << 56); in gf128mul_x_lle()
191 r->b = cpu_to_be64((b >> 1) | (a << 63)); in gf128mul_x_lle()
198 u64 b = be64_to_cpu(x->b); in gf128mul_x_bbe() local
203 r->a = cpu_to_be64((a << 1) | (b >> 63)); in gf128mul_x_bbe()
204 r->b = cpu_to_be64((b << 1) ^ _tt); in gf128mul_x_bbe()
211 u64 b = le64_to_cpu(x->b); in gf128mul_x_ble() local
213 /* equivalent to gf128mul_table_be[b >> 63] (see crypto/gf128mul.c): */ in gf128mul_x_ble()
216 r->a = cpu_to_le64((a << 1) | (b >> 63)); in gf128mul_x_ble()
217 r->b = cpu_to_le64((b << 1) ^ _tt); in gf128mul_x_ble()