crypto: starfive - Remove cfb and ofb

Remove the unused CFB/OFB implementation.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu 2023-11-30 18:12:55 +08:00
parent 66c465c6e7
commit 015b8e1210
2 changed files with 1 additions and 72 deletions

View File

@ -262,12 +262,7 @@ static int starfive_aes_hw_init(struct starfive_cryp_ctx *ctx)
rctx->csr.aes.mode = hw_mode;
rctx->csr.aes.cmode = !is_encrypt(cryp);
rctx->csr.aes.ie = 1;
if (hw_mode == STARFIVE_AES_MODE_CFB ||
hw_mode == STARFIVE_AES_MODE_OFB)
rctx->csr.aes.stmode = STARFIVE_AES_MODE_XFB_128;
else
rctx->csr.aes.stmode = STARFIVE_AES_MODE_XFB_1;
rctx->csr.aes.stmode = STARFIVE_AES_MODE_XFB_1;
if (cryp->side_chan) {
rctx->csr.aes.delay_aes = 1;
@ -294,8 +289,6 @@ static int starfive_aes_hw_init(struct starfive_cryp_ctx *ctx)
starfive_aes_ccm_init(ctx);
starfive_aes_aead_hw_start(ctx, hw_mode);
break;
case STARFIVE_AES_MODE_OFB:
case STARFIVE_AES_MODE_CFB:
case STARFIVE_AES_MODE_CBC:
case STARFIVE_AES_MODE_CTR:
starfive_aes_write_iv(ctx, (void *)cryp->req.sreq->iv);
@ -785,26 +778,6 @@ static int starfive_aes_cbc_decrypt(struct skcipher_request *req)
return starfive_aes_crypt(req, STARFIVE_AES_MODE_CBC);
}
static int starfive_aes_cfb_encrypt(struct skcipher_request *req)
{
return starfive_aes_crypt(req, STARFIVE_AES_MODE_CFB | FLG_ENCRYPT);
}
static int starfive_aes_cfb_decrypt(struct skcipher_request *req)
{
return starfive_aes_crypt(req, STARFIVE_AES_MODE_CFB);
}
static int starfive_aes_ofb_encrypt(struct skcipher_request *req)
{
return starfive_aes_crypt(req, STARFIVE_AES_MODE_OFB | FLG_ENCRYPT);
}
static int starfive_aes_ofb_decrypt(struct skcipher_request *req)
{
return starfive_aes_crypt(req, STARFIVE_AES_MODE_OFB);
}
static int starfive_aes_ctr_encrypt(struct skcipher_request *req)
{
return starfive_aes_crypt(req, STARFIVE_AES_MODE_CTR | FLG_ENCRYPT);
@ -910,48 +883,6 @@ static struct skcipher_engine_alg skcipher_algs[] = {
.op = {
.do_one_request = starfive_aes_do_one_req,
},
}, {
.base.init = starfive_aes_init_tfm,
.base.setkey = starfive_aes_setkey,
.base.encrypt = starfive_aes_cfb_encrypt,
.base.decrypt = starfive_aes_cfb_decrypt,
.base.min_keysize = AES_MIN_KEY_SIZE,
.base.max_keysize = AES_MAX_KEY_SIZE,
.base.ivsize = AES_BLOCK_SIZE,
.base.base = {
.cra_name = "cfb(aes)",
.cra_driver_name = "starfive-cfb-aes",
.cra_priority = 200,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = 1,
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
.cra_alignmask = 0xf,
.cra_module = THIS_MODULE,
},
.op = {
.do_one_request = starfive_aes_do_one_req,
},
}, {
.base.init = starfive_aes_init_tfm,
.base.setkey = starfive_aes_setkey,
.base.encrypt = starfive_aes_ofb_encrypt,
.base.decrypt = starfive_aes_ofb_decrypt,
.base.min_keysize = AES_MIN_KEY_SIZE,
.base.max_keysize = AES_MAX_KEY_SIZE,
.base.ivsize = AES_BLOCK_SIZE,
.base.base = {
.cra_name = "ofb(aes)",
.cra_driver_name = "starfive-ofb-aes",
.cra_priority = 200,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = 1,
.cra_ctxsize = sizeof(struct starfive_cryp_ctx),
.cra_alignmask = 0xf,
.cra_module = THIS_MODULE,
},
.op = {
.do_one_request = starfive_aes_do_one_req,
},
},
};

View File

@ -50,8 +50,6 @@ union starfive_aes_csr {
u32 ccm_start :1;
#define STARFIVE_AES_MODE_ECB 0x0
#define STARFIVE_AES_MODE_CBC 0x1
#define STARFIVE_AES_MODE_CFB 0x2
#define STARFIVE_AES_MODE_OFB 0x3
#define STARFIVE_AES_MODE_CTR 0x4
#define STARFIVE_AES_MODE_CCM 0x5
#define STARFIVE_AES_MODE_GCM 0x6