diff options
Diffstat (limited to 'crypto/xcbc.c')
-rw-r--r-- | crypto/xcbc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/xcbc.c b/crypto/xcbc.c index 317e9f08fc04..d7b4be0a057d 100644 --- a/crypto/xcbc.c +++ b/crypto/xcbc.c | |||
@@ -254,14 +254,15 @@ static int crypto_xcbc_digest(struct hash_desc *pdesc, | |||
254 | 254 | ||
255 | static int xcbc_init_tfm(struct crypto_tfm *tfm) | 255 | static int xcbc_init_tfm(struct crypto_tfm *tfm) |
256 | { | 256 | { |
257 | struct crypto_cipher *cipher; | ||
257 | struct crypto_instance *inst = (void *)tfm->__crt_alg; | 258 | struct crypto_instance *inst = (void *)tfm->__crt_alg; |
258 | struct crypto_spawn *spawn = crypto_instance_ctx(inst); | 259 | struct crypto_spawn *spawn = crypto_instance_ctx(inst); |
259 | struct crypto_xcbc_ctx *ctx = crypto_hash_ctx_aligned(__crypto_hash_cast(tfm)); | 260 | struct crypto_xcbc_ctx *ctx = crypto_hash_ctx_aligned(__crypto_hash_cast(tfm)); |
260 | int bs = crypto_hash_blocksize(__crypto_hash_cast(tfm)); | 261 | int bs = crypto_hash_blocksize(__crypto_hash_cast(tfm)); |
261 | 262 | ||
262 | tfm = crypto_spawn_tfm(spawn); | 263 | cipher = crypto_spawn_cipher(spawn); |
263 | if (IS_ERR(tfm)) | 264 | if (IS_ERR(cipher)) |
264 | return PTR_ERR(tfm); | 265 | return PTR_ERR(cipher); |
265 | 266 | ||
266 | switch(bs) { | 267 | switch(bs) { |
267 | case 16: | 268 | case 16: |
@@ -271,7 +272,7 @@ static int xcbc_init_tfm(struct crypto_tfm *tfm) | |||
271 | return -EINVAL; | 272 | return -EINVAL; |
272 | } | 273 | } |
273 | 274 | ||
274 | ctx->child = crypto_cipher_cast(tfm); | 275 | ctx->child = cipher; |
275 | ctx->odds = (u8*)(ctx+1); | 276 | ctx->odds = (u8*)(ctx+1); |
276 | ctx->prev = ctx->odds + bs; | 277 | ctx->prev = ctx->odds + bs; |
277 | ctx->key = ctx->prev + bs; | 278 | ctx->key = ctx->prev + bs; |