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

crypto: lrw - use blocksize constant

LRW has fixed blocksize of 16. Define LRW_BLOCK_SIZE and use in place of
crypto_cipher_blocksize().

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Jussi Kivilinna and committed by
Herbert Xu
4660720d b884f8b9

+5 -3
+5 -3
crypto/lrw.c
··· 27 27 #include <crypto/b128ops.h> 28 28 #include <crypto/gf128mul.h> 29 29 30 + #define LRW_BLOCK_SIZE 16 31 + 30 32 struct priv { 31 33 struct crypto_cipher *child; 32 34 /* optimizes multiplying a random (non incrementing, as at the ··· 63 61 struct crypto_cipher *child = ctx->child; 64 62 int err, i; 65 63 be128 tmp = { 0 }; 66 - int bsize = crypto_cipher_blocksize(child); 64 + int bsize = LRW_BLOCK_SIZE; 67 65 68 66 crypto_cipher_clear_flags(child, CRYPTO_TFM_REQ_MASK); 69 67 crypto_cipher_set_flags(child, crypto_tfm_get_flags(parent) & ··· 136 134 { 137 135 int err; 138 136 unsigned int avail; 139 - const int bs = crypto_cipher_blocksize(ctx->child); 137 + const int bs = LRW_BLOCK_SIZE; 140 138 struct sinfo s = { 141 139 .tfm = crypto_cipher_tfm(ctx->child), 142 140 .fn = fn ··· 220 218 if (IS_ERR(cipher)) 221 219 return PTR_ERR(cipher); 222 220 223 - if (crypto_cipher_blocksize(cipher) != 16) { 221 + if (crypto_cipher_blocksize(cipher) != LRW_BLOCK_SIZE) { 224 222 *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; 225 223 crypto_free_cipher(cipher); 226 224 return -EINVAL;