Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: lib/gf128mul - Remove some bbe deadcode

gf128mul_4k_bbe(), gf128mul_bbe() and gf128mul_init_4k_bbe()
are part of the library originally added in 2006 by
commit c494e0705d67 ("[CRYPTO] lib: table driven multiplications in
GF(2^128)")

but have never been used.

Remove them.
(BBE is Big endian Byte/Big endian bits
Note the 64k table version is used and I've left that in)

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Dr. David Alan Gilbert and committed by
Herbert Xu
b9b89464 e1d3422c

+1 -80
+1 -5
include/crypto/gf128mul.h
··· 158 158 64...71 72...79 80...87 88...95 96..103 104.111 112.119 120.127 159 159 */ 160 160 161 - /* A slow generic version of gf_mul, implemented for lle and bbe 161 + /* A slow generic version of gf_mul, implemented for lle 162 162 * It multiplies a and b and puts the result in a */ 163 163 void gf128mul_lle(be128 *a, const be128 *b); 164 - 165 - void gf128mul_bbe(be128 *a, const be128 *b); 166 164 167 165 /* 168 166 * The following functions multiply a field element by x in ··· 222 224 }; 223 225 224 226 struct gf128mul_4k *gf128mul_init_4k_lle(const be128 *g); 225 - struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g); 226 227 void gf128mul_4k_lle(be128 *a, const struct gf128mul_4k *t); 227 - void gf128mul_4k_bbe(be128 *a, const struct gf128mul_4k *t); 228 228 void gf128mul_x8_ble(le128 *r, const le128 *x); 229 229 static inline void gf128mul_free_4k(struct gf128mul_4k *t) 230 230 {
-75
lib/crypto/gf128mul.c
··· 225 225 } 226 226 EXPORT_SYMBOL(gf128mul_lle); 227 227 228 - void gf128mul_bbe(be128 *r, const be128 *b) 229 - { 230 - be128 p[8]; 231 - int i; 232 - 233 - p[0] = *r; 234 - for (i = 0; i < 7; ++i) 235 - gf128mul_x_bbe(&p[i + 1], &p[i]); 236 - 237 - memset(r, 0, sizeof(*r)); 238 - for (i = 0;;) { 239 - u8 ch = ((u8 *)b)[i]; 240 - 241 - if (ch & 0x80) 242 - be128_xor(r, r, &p[7]); 243 - if (ch & 0x40) 244 - be128_xor(r, r, &p[6]); 245 - if (ch & 0x20) 246 - be128_xor(r, r, &p[5]); 247 - if (ch & 0x10) 248 - be128_xor(r, r, &p[4]); 249 - if (ch & 0x08) 250 - be128_xor(r, r, &p[3]); 251 - if (ch & 0x04) 252 - be128_xor(r, r, &p[2]); 253 - if (ch & 0x02) 254 - be128_xor(r, r, &p[1]); 255 - if (ch & 0x01) 256 - be128_xor(r, r, &p[0]); 257 - 258 - if (++i >= 16) 259 - break; 260 - 261 - gf128mul_x8_bbe(r); 262 - } 263 - } 264 - EXPORT_SYMBOL(gf128mul_bbe); 265 - 266 228 /* This version uses 64k bytes of table space. 267 229 A 16 byte buffer has to be multiplied by a 16 byte key 268 230 value in GF(2^128). If we consider a GF(2^128) value in ··· 342 380 } 343 381 EXPORT_SYMBOL(gf128mul_init_4k_lle); 344 382 345 - struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g) 346 - { 347 - struct gf128mul_4k *t; 348 - int j, k; 349 - 350 - t = kzalloc(sizeof(*t), GFP_KERNEL); 351 - if (!t) 352 - goto out; 353 - 354 - t->t[1] = *g; 355 - for (j = 1; j <= 64; j <<= 1) 356 - gf128mul_x_bbe(&t->t[j + j], &t->t[j]); 357 - 358 - for (j = 2; j < 256; j += j) 359 - for (k = 1; k < j; ++k) 360 - be128_xor(&t->t[j + k], &t->t[j], &t->t[k]); 361 - 362 - out: 363 - return t; 364 - } 365 - EXPORT_SYMBOL(gf128mul_init_4k_bbe); 366 - 367 383 void gf128mul_4k_lle(be128 *a, const struct gf128mul_4k *t) 368 384 { 369 385 u8 *ap = (u8 *)a; ··· 356 416 *a = *r; 357 417 } 358 418 EXPORT_SYMBOL(gf128mul_4k_lle); 359 - 360 - void gf128mul_4k_bbe(be128 *a, const struct gf128mul_4k *t) 361 - { 362 - u8 *ap = (u8 *)a; 363 - be128 r[1]; 364 - int i = 0; 365 - 366 - *r = t->t[ap[0]]; 367 - while (++i < 16) { 368 - gf128mul_x8_bbe(r); 369 - be128_xor(r, r, &t->t[ap[i]]); 370 - } 371 - *a = *r; 372 - } 373 - EXPORT_SYMBOL(gf128mul_4k_bbe); 374 419 375 420 MODULE_LICENSE("GPL"); 376 421 MODULE_DESCRIPTION("Functions for multiplying elements of GF(2^128)");