The rfc3686 implementation in crypto4xx is pretty much the same as the generic rfc3686 wrapper. So it can simply be removed to reduce complexity. Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> --- drivers/crypto/amcc/crypto4xx_alg.c | 47 ----------------------------------- drivers/crypto/amcc/crypto4xx_core.c | 20 -------------- drivers/crypto/amcc/crypto4xx_core.h | 4 -- 3 files changed, 71 deletions(-) diff --git a/drivers/crypto/amcc/crypto4xx_alg.c b/drivers/crypto/amcc/crypto4xx_alg.c index f7fc0c4641254..a7c17cdb1deb2 100644 --- a/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c @@ -202,53 +202,6 @@ int crypto4xx_setkey_aes_ofb(struct crypto_skcipher *cipher, CRYPTO_FEEDBACK_MODE_64BIT_OFB); } -int crypto4xx_setkey_rfc3686(struct crypto_skcipher *cipher, - const u8 *key, unsigned int keylen) -{ - struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(cipher); - int rc; - - rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE, - CRYPTO_MODE_CTR, CRYPTO_FEEDBACK_MODE_NO_FB); - if (rc) - return rc; - - ctx->iv_nonce = cpu_to_le32p((u32 *)&key[keylen - - CTR_RFC3686_NONCE_SIZE]); - - return 0; -} - -int crypto4xx_rfc3686_encrypt(struct skcipher_request *req) -{ - struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req); - struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(cipher); - __le32 iv[AES_IV_SIZE / 4] = { - ctx->iv_nonce, - cpu_to_le32p((u32 *) req->iv), - cpu_to_le32p((u32 *) (req->iv + 4)), - cpu_to_le32(1) }; - - return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, - req->cryptlen, iv, AES_IV_SIZE, - ctx->sa_out, ctx->sa_len, 0, NULL); -} - -int crypto4xx_rfc3686_decrypt(struct skcipher_request *req) -{ - struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req); - struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(cipher); - __le32 iv[AES_IV_SIZE / 4] = { - ctx->iv_nonce, - cpu_to_le32p((u32 *) req->iv), - cpu_to_le32p((u32 *) (req->iv + 4)), - cpu_to_le32(1) }; - - return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, - req->cryptlen, iv, AES_IV_SIZE, - ctx->sa_out, ctx->sa_len, 0, NULL); -} - static int crypto4xx_ctr_crypt(struct skcipher_request *req, bool encrypt) { diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 981de43ea5e24..2054e216440b5 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1252,26 +1252,6 @@ static struct crypto4xx_alg_common crypto4xx_alg[] = { .init = crypto4xx_sk_init, .exit = crypto4xx_sk_exit, } }, - { .type = CRYPTO_ALG_TYPE_SKCIPHER, .u.cipher = { - .base = { - .cra_name = "rfc3686(ctr(aes))", - .cra_driver_name = "rfc3686-ctr-aes-ppc4xx", - .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, - .cra_flags = CRYPTO_ALG_ASYNC | - CRYPTO_ALG_KERN_DRIVER_ONLY, - .cra_blocksize = 1, - .cra_ctxsize = sizeof(struct crypto4xx_ctx), - .cra_module = THIS_MODULE, - }, - .min_keysize = AES_MIN_KEY_SIZE + CTR_RFC3686_NONCE_SIZE, - .max_keysize = AES_MAX_KEY_SIZE + CTR_RFC3686_NONCE_SIZE, - .ivsize = CTR_RFC3686_IV_SIZE, - .setkey = crypto4xx_setkey_rfc3686, - .encrypt = crypto4xx_rfc3686_encrypt, - .decrypt = crypto4xx_rfc3686_decrypt, - .init = crypto4xx_sk_init, - .exit = crypto4xx_sk_exit, - } }, { .type = CRYPTO_ALG_TYPE_SKCIPHER, .u.cipher = { .base = { .cra_name = "ecb(aes)", diff --git a/drivers/crypto/amcc/crypto4xx_core.h b/drivers/crypto/amcc/crypto4xx_core.h index 6b68413591905..97f625fc5e8b1 100644 --- a/drivers/crypto/amcc/crypto4xx_core.h +++ b/drivers/crypto/amcc/crypto4xx_core.h @@ -169,8 +169,6 @@ int crypto4xx_setkey_aes_ecb(struct crypto_skcipher *cipher, const u8 *key, unsigned int keylen); int crypto4xx_setkey_aes_ofb(struct crypto_skcipher *cipher, const u8 *key, unsigned int keylen); -int crypto4xx_setkey_rfc3686(struct crypto_skcipher *cipher, - const u8 *key, unsigned int keylen); int crypto4xx_encrypt_ctr(struct skcipher_request *req); int crypto4xx_decrypt_ctr(struct skcipher_request *req); int crypto4xx_encrypt_iv_stream(struct skcipher_request *req); @@ -179,8 +177,6 @@ int crypto4xx_encrypt_iv_block(struct skcipher_request *req); int crypto4xx_decrypt_iv_block(struct skcipher_request *req); int crypto4xx_encrypt_noiv_block(struct skcipher_request *req); int crypto4xx_decrypt_noiv_block(struct skcipher_request *req); -int crypto4xx_rfc3686_encrypt(struct skcipher_request *req); -int crypto4xx_rfc3686_decrypt(struct skcipher_request *req); int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); int crypto4xx_hash_digest(struct ahash_request *req); int crypto4xx_hash_final(struct ahash_request *req);