aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/lrw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c
index fca3246a953f..bee60226f723 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -27,6 +27,8 @@
27#include <crypto/b128ops.h> 27#include <crypto/b128ops.h>
28#include <crypto/gf128mul.h> 28#include <crypto/gf128mul.h>
29 29
30#define LRW_BLOCK_SIZE 16
31
30struct priv { 32struct priv {
31 struct crypto_cipher *child; 33 struct crypto_cipher *child;
32 /* optimizes multiplying a random (non incrementing, as at the 34 /* optimizes multiplying a random (non incrementing, as at the
@@ -61,7 +63,7 @@ static int setkey(struct crypto_tfm *parent, const u8 *key,
61 struct crypto_cipher *child = ctx->child; 63 struct crypto_cipher *child = ctx->child;
62 int err, i; 64 int err, i;
63 be128 tmp = { 0 }; 65 be128 tmp = { 0 };
64 int bsize = crypto_cipher_blocksize(child); 66 int bsize = LRW_BLOCK_SIZE;
65 67
66 crypto_cipher_clear_flags(child, CRYPTO_TFM_REQ_MASK); 68 crypto_cipher_clear_flags(child, CRYPTO_TFM_REQ_MASK);
67 crypto_cipher_set_flags(child, crypto_tfm_get_flags(parent) & 69 crypto_cipher_set_flags(child, crypto_tfm_get_flags(parent) &
@@ -134,7 +136,7 @@ static int crypt(struct blkcipher_desc *d,
134{ 136{
135 int err; 137 int err;
136 unsigned int avail; 138 unsigned int avail;
137 const int bs = crypto_cipher_blocksize(ctx->child); 139 const int bs = LRW_BLOCK_SIZE;
138 struct sinfo s = { 140 struct sinfo s = {
139 .tfm = crypto_cipher_tfm(ctx->child), 141 .tfm = crypto_cipher_tfm(ctx->child),
140 .fn = fn 142 .fn = fn
@@ -218,7 +220,7 @@ static int init_tfm(struct crypto_tfm *tfm)
218 if (IS_ERR(cipher)) 220 if (IS_ERR(cipher))
219 return PTR_ERR(cipher); 221 return PTR_ERR(cipher);
220 222
221 if (crypto_cipher_blocksize(cipher) != 16) { 223 if (crypto_cipher_blocksize(cipher) != LRW_BLOCK_SIZE) {
222 *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN; 224 *flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN;
223 crypto_free_cipher(cipher); 225 crypto_free_cipher(cipher);
224 return -EINVAL; 226 return -EINVAL;