• Home
  • Raw
  • Download

Lines Matching +full:p +full:- +full:256

1 /* gf128mul.c - GF(2^128) multiplication functions
17 ---------------------------------------------------------------------------
44 ---------------------------------------------------------------------------
94 * 16-bit value that must be XOR-ed into the low-degree end of the
98 * the "be" convention where the highest-order bit is the coefficient of
99 * the highest-degree polynomial term, and one for the "le" convention
100 * where the highest-order bit is the coefficient of the lowest-degree
129 static const u16 gf128mul_table_le[256] = gf128mul_dat(xda_le);
130 static const u16 gf128mul_table_be[256] = gf128mul_dat(xda_be);
134 * the polynomial field representation. They use 64-bit word operations
141 u64 a = be64_to_cpu(x->a); in gf128mul_x8_lle()
142 u64 b = be64_to_cpu(x->b); in gf128mul_x8_lle()
145 x->b = cpu_to_be64((b >> 8) | (a << 56)); in gf128mul_x8_lle()
146 x->a = cpu_to_be64((a >> 8) ^ (_tt << 48)); in gf128mul_x8_lle()
151 u64 a = be64_to_cpu(x->a); in gf128mul_x8_bbe()
152 u64 b = be64_to_cpu(x->b); in gf128mul_x8_bbe()
155 x->a = cpu_to_be64((a << 8) | (b >> 56)); in gf128mul_x8_bbe()
156 x->b = cpu_to_be64((b << 8) ^ _tt); in gf128mul_x8_bbe()
161 u64 a = le64_to_cpu(x->a); in gf128mul_x8_ble()
162 u64 b = le64_to_cpu(x->b); in gf128mul_x8_ble()
165 r->a = cpu_to_le64((a << 8) | (b >> 56)); in gf128mul_x8_ble()
166 r->b = cpu_to_le64((b << 8) ^ _tt); in gf128mul_x8_ble()
172 be128 p[8]; in gf128mul_lle() local
175 p[0] = *r; in gf128mul_lle()
177 gf128mul_x_lle(&p[i + 1], &p[i]); in gf128mul_lle()
181 u8 ch = ((u8 *)b)[15 - i]; in gf128mul_lle()
184 be128_xor(r, r, &p[0]); in gf128mul_lle()
186 be128_xor(r, r, &p[1]); in gf128mul_lle()
188 be128_xor(r, r, &p[2]); in gf128mul_lle()
190 be128_xor(r, r, &p[3]); in gf128mul_lle()
192 be128_xor(r, r, &p[4]); in gf128mul_lle()
194 be128_xor(r, r, &p[5]); in gf128mul_lle()
196 be128_xor(r, r, &p[6]); in gf128mul_lle()
198 be128_xor(r, r, &p[7]); in gf128mul_lle()
210 be128 p[8]; in gf128mul_bbe() local
213 p[0] = *r; in gf128mul_bbe()
215 gf128mul_x_bbe(&p[i + 1], &p[i]); in gf128mul_bbe()
222 be128_xor(r, r, &p[7]); in gf128mul_bbe()
224 be128_xor(r, r, &p[6]); in gf128mul_bbe()
226 be128_xor(r, r, &p[5]); in gf128mul_bbe()
228 be128_xor(r, r, &p[4]); in gf128mul_bbe()
230 be128_xor(r, r, &p[3]); in gf128mul_bbe()
232 be128_xor(r, r, &p[2]); in gf128mul_bbe()
234 be128_xor(r, r, &p[1]); in gf128mul_bbe()
236 be128_xor(r, r, &p[0]); in gf128mul_bbe()
250 the 256 16 byte values that result from the 256 values
270 t->t[i] = kzalloc(sizeof(*t->t[i]), GFP_KERNEL); in gf128mul_init_64k_bbe()
271 if (!t->t[i]) { in gf128mul_init_64k_bbe()
278 t->t[0]->t[1] = *g; in gf128mul_init_64k_bbe()
280 gf128mul_x_bbe(&t->t[0]->t[j + j], &t->t[0]->t[j]); in gf128mul_init_64k_bbe()
283 for (j = 2; j < 256; j += j) in gf128mul_init_64k_bbe()
285 be128_xor(&t->t[i]->t[j + k], in gf128mul_init_64k_bbe()
286 &t->t[i]->t[j], &t->t[i]->t[k]); in gf128mul_init_64k_bbe()
292 t->t[i]->t[j] = t->t[i - 1]->t[j]; in gf128mul_init_64k_bbe()
293 gf128mul_x8_bbe(&t->t[i]->t[j]); in gf128mul_init_64k_bbe()
307 kfree_sensitive(t->t[i]); in gf128mul_free_64k()
318 *r = t->t[0]->t[ap[15]]; in gf128mul_64k_bbe()
320 be128_xor(r, r, &t->t[i]->t[ap[15 - i]]); in gf128mul_64k_bbe()
328 single byte, we can construct a table of the 256 16 byte
329 values that result from the 256 values of this byte.
350 t->t[128] = *g; in gf128mul_init_4k_lle()
352 gf128mul_x_lle(&t->t[j], &t->t[j+j]); in gf128mul_init_4k_lle()
354 for (j = 2; j < 256; j += j) in gf128mul_init_4k_lle()
356 be128_xor(&t->t[j + k], &t->t[j], &t->t[k]); in gf128mul_init_4k_lle()
372 t->t[1] = *g; in gf128mul_init_4k_bbe()
374 gf128mul_x_bbe(&t->t[j + j], &t->t[j]); in gf128mul_init_4k_bbe()
376 for (j = 2; j < 256; j += j) in gf128mul_init_4k_bbe()
378 be128_xor(&t->t[j + k], &t->t[j], &t->t[k]); in gf128mul_init_4k_bbe()
391 *r = t->t[ap[15]]; in gf128mul_4k_lle()
392 while (i--) { in gf128mul_4k_lle()
394 be128_xor(r, r, &t->t[ap[i]]); in gf128mul_4k_lle()
406 *r = t->t[ap[0]]; in gf128mul_4k_bbe()
409 be128_xor(r, r, &t->t[ap[i]]); in gf128mul_4k_bbe()