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

crypto: gf128mul - constify 4k and 64k multiplication tables

Constify the multiplication tables passed to the 4k and 64k
multiplication functions, as they are not modified by these functions.

Cc: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
3ea996dd f33fd647

+6 -6
+3 -3
crypto/gf128mul.c
··· 329 329 } 330 330 EXPORT_SYMBOL(gf128mul_free_64k); 331 331 332 - void gf128mul_64k_bbe(be128 *a, struct gf128mul_64k *t) 332 + void gf128mul_64k_bbe(be128 *a, const struct gf128mul_64k *t) 333 333 { 334 334 u8 *ap = (u8 *)a; 335 335 be128 r[1]; ··· 402 402 } 403 403 EXPORT_SYMBOL(gf128mul_init_4k_bbe); 404 404 405 - void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t) 405 + void gf128mul_4k_lle(be128 *a, const struct gf128mul_4k *t) 406 406 { 407 407 u8 *ap = (u8 *)a; 408 408 be128 r[1]; ··· 417 417 } 418 418 EXPORT_SYMBOL(gf128mul_4k_lle); 419 419 420 - void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t) 420 + void gf128mul_4k_bbe(be128 *a, const struct gf128mul_4k *t) 421 421 { 422 422 u8 *ap = (u8 *)a; 423 423 be128 r[1];
+3 -3
include/crypto/gf128mul.h
··· 174 174 175 175 struct gf128mul_4k *gf128mul_init_4k_lle(const be128 *g); 176 176 struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g); 177 - void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t); 178 - void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t); 177 + void gf128mul_4k_lle(be128 *a, const struct gf128mul_4k *t); 178 + void gf128mul_4k_bbe(be128 *a, const struct gf128mul_4k *t); 179 179 180 180 static inline void gf128mul_free_4k(struct gf128mul_4k *t) 181 181 { ··· 196 196 */ 197 197 struct gf128mul_64k *gf128mul_init_64k_bbe(const be128 *g); 198 198 void gf128mul_free_64k(struct gf128mul_64k *t); 199 - void gf128mul_64k_bbe(be128 *a, struct gf128mul_64k *t); 199 + void gf128mul_64k_bbe(be128 *a, const struct gf128mul_64k *t); 200 200 201 201 #endif /* _CRYPTO_GF128MUL_H */