aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/crypto/amcc/crypto4xx_alg.c12
-rw-r--r--drivers/crypto/amcc/crypto4xx_core.c11
-rw-r--r--drivers/crypto/amcc/crypto4xx_core.h2
3 files changed, 10 insertions, 15 deletions
diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/crypto4xx_alg.c
index 3458c5a085d9..307f5cfa9ba4 100644
--- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -264,10 +264,10 @@ crypto4xx_ctr_crypt(struct skcipher_request *req, bool encrypt)
264 * overlow. 264 * overlow.
265 */ 265 */
266 if (counter + nblks < counter) { 266 if (counter + nblks < counter) {
267 struct skcipher_request *subreq = skcipher_request_ctx(req); 267 SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->sw_cipher.cipher);
268 int ret; 268 int ret;
269 269
270 skcipher_request_set_tfm(subreq, ctx->sw_cipher.cipher); 270 skcipher_request_set_sync_tfm(subreq, ctx->sw_cipher.cipher);
271 skcipher_request_set_callback(subreq, req->base.flags, 271 skcipher_request_set_callback(subreq, req->base.flags,
272 NULL, NULL); 272 NULL, NULL);
273 skcipher_request_set_crypt(subreq, req->src, req->dst, 273 skcipher_request_set_crypt(subreq, req->src, req->dst,
@@ -289,14 +289,14 @@ static int crypto4xx_sk_setup_fallback(struct crypto4xx_ctx *ctx,
289{ 289{
290 int rc; 290 int rc;
291 291
292 crypto_skcipher_clear_flags(ctx->sw_cipher.cipher, 292 crypto_sync_skcipher_clear_flags(ctx->sw_cipher.cipher,
293 CRYPTO_TFM_REQ_MASK); 293 CRYPTO_TFM_REQ_MASK);
294 crypto_skcipher_set_flags(ctx->sw_cipher.cipher, 294 crypto_sync_skcipher_set_flags(ctx->sw_cipher.cipher,
295 crypto_skcipher_get_flags(cipher) & CRYPTO_TFM_REQ_MASK); 295 crypto_skcipher_get_flags(cipher) & CRYPTO_TFM_REQ_MASK);
296 rc = crypto_skcipher_setkey(ctx->sw_cipher.cipher, key, keylen); 296 rc = crypto_sync_skcipher_setkey(ctx->sw_cipher.cipher, key, keylen);
297 crypto_skcipher_clear_flags(cipher, CRYPTO_TFM_RES_MASK); 297 crypto_skcipher_clear_flags(cipher, CRYPTO_TFM_RES_MASK);
298 crypto_skcipher_set_flags(cipher, 298 crypto_skcipher_set_flags(cipher,
299 crypto_skcipher_get_flags(ctx->sw_cipher.cipher) & 299 crypto_sync_skcipher_get_flags(ctx->sw_cipher.cipher) &
300 CRYPTO_TFM_RES_MASK); 300 CRYPTO_TFM_RES_MASK);
301 301
302 return rc; 302 return rc;
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 920bd5e720b2..3e7d24ff3fa6 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -965,15 +965,10 @@ static int crypto4xx_sk_init(struct crypto_skcipher *sk)
965 965
966 if (alg->base.cra_flags & CRYPTO_ALG_NEED_FALLBACK) { 966 if (alg->base.cra_flags & CRYPTO_ALG_NEED_FALLBACK) {
967 ctx->sw_cipher.cipher = 967 ctx->sw_cipher.cipher =
968 crypto_alloc_skcipher(alg->base.cra_name, 0, 968 crypto_alloc_sync_skcipher(alg->base.cra_name, 0,
969 CRYPTO_ALG_NEED_FALLBACK | 969 CRYPTO_ALG_NEED_FALLBACK);
970 CRYPTO_ALG_ASYNC);
971 if (IS_ERR(ctx->sw_cipher.cipher)) 970 if (IS_ERR(ctx->sw_cipher.cipher))
972 return PTR_ERR(ctx->sw_cipher.cipher); 971 return PTR_ERR(ctx->sw_cipher.cipher);
973
974 crypto_skcipher_set_reqsize(sk,
975 sizeof(struct skcipher_request) + 32 +
976 crypto_skcipher_reqsize(ctx->sw_cipher.cipher));
977 } 972 }
978 973
979 amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher); 974 amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher);
@@ -992,7 +987,7 @@ static void crypto4xx_sk_exit(struct crypto_skcipher *sk)
992 987
993 crypto4xx_common_exit(ctx); 988 crypto4xx_common_exit(ctx);
994 if (ctx->sw_cipher.cipher) 989 if (ctx->sw_cipher.cipher)
995 crypto_free_skcipher(ctx->sw_cipher.cipher); 990 crypto_free_sync_skcipher(ctx->sw_cipher.cipher);
996} 991}
997 992
998static int crypto4xx_aead_init(struct crypto_aead *tfm) 993static int crypto4xx_aead_init(struct crypto_aead *tfm)
diff --git a/drivers/crypto/amcc/crypto4xx_core.h b/drivers/crypto/amcc/crypto4xx_core.h
index 18df695ca6b1..4ecc34fa8ebd 100644
--- a/drivers/crypto/amcc/crypto4xx_core.h
+++ b/drivers/crypto/amcc/crypto4xx_core.h
@@ -131,7 +131,7 @@ struct crypto4xx_ctx {
131 __le32 iv_nonce; 131 __le32 iv_nonce;
132 u32 sa_len; 132 u32 sa_len;
133 union { 133 union {
134 struct crypto_skcipher *cipher; 134 struct crypto_sync_skcipher *cipher;
135 struct crypto_aead *aead; 135 struct crypto_aead *aead;
136 } sw_cipher; 136 } sw_cipher;
137}; 137};