Skip to content

Commit

Permalink
crypto: marvell/cesa - rename blkcipher to skcipher
Browse files Browse the repository at this point in the history
The driver specific types contain some rudimentary references to the
blkcipher API, which is deprecated and will be removed. To avoid confusion,
rename these to skcipher. This is a cosmetic change only, as the code does
not actually use the blkcipher API.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Ard Biesheuvel authored and Herbert Xu committed Nov 17, 2019
1 parent 7fe948a commit 8160ee7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions drivers/crypto/marvell/cesa.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ struct mv_cesa_sec_accel_desc {
};

/**
* struct mv_cesa_blkcipher_op_ctx - cipher operation context
* struct mv_cesa_skcipher_op_ctx - cipher operation context
* @key: cipher key
* @iv: cipher IV
*
* Context associated to a cipher operation.
*/
struct mv_cesa_blkcipher_op_ctx {
struct mv_cesa_skcipher_op_ctx {
u32 key[8];
u32 iv[4];
};
Expand All @@ -265,7 +265,7 @@ struct mv_cesa_hash_op_ctx {
struct mv_cesa_op_ctx {
struct mv_cesa_sec_accel_desc desc;
union {
struct mv_cesa_blkcipher_op_ctx blkcipher;
struct mv_cesa_skcipher_op_ctx skcipher;
struct mv_cesa_hash_op_ctx hash;
} ctx;
};
Expand Down
14 changes: 7 additions & 7 deletions drivers/crypto/marvell/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ mv_cesa_skcipher_complete(struct crypto_async_request *req)
struct mv_cesa_req *basereq;

basereq = &creq->base;
memcpy(skreq->iv, basereq->chain.last->op->ctx.blkcipher.iv,
memcpy(skreq->iv, basereq->chain.last->op->ctx.skcipher.iv,
ivsize);
} else {
memcpy_fromio(skreq->iv,
Expand Down Expand Up @@ -470,7 +470,7 @@ static int mv_cesa_des_op(struct skcipher_request *req,
mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTM_DES,
CESA_SA_DESC_CFG_CRYPTM_MSK);

memcpy(tmpl->ctx.blkcipher.key, ctx->key, DES_KEY_SIZE);
memcpy(tmpl->ctx.skcipher.key, ctx->key, DES_KEY_SIZE);

return mv_cesa_skcipher_queue_req(req, tmpl);
}
Expand Down Expand Up @@ -523,7 +523,7 @@ static int mv_cesa_cbc_des_op(struct skcipher_request *req,
mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTCM_CBC,
CESA_SA_DESC_CFG_CRYPTCM_MSK);

memcpy(tmpl->ctx.blkcipher.iv, req->iv, DES_BLOCK_SIZE);
memcpy(tmpl->ctx.skcipher.iv, req->iv, DES_BLOCK_SIZE);

return mv_cesa_des_op(req, tmpl);
}
Expand Down Expand Up @@ -575,7 +575,7 @@ static int mv_cesa_des3_op(struct skcipher_request *req,
mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTM_3DES,
CESA_SA_DESC_CFG_CRYPTM_MSK);

memcpy(tmpl->ctx.blkcipher.key, ctx->key, DES3_EDE_KEY_SIZE);
memcpy(tmpl->ctx.skcipher.key, ctx->key, DES3_EDE_KEY_SIZE);

return mv_cesa_skcipher_queue_req(req, tmpl);
}
Expand Down Expand Up @@ -628,7 +628,7 @@ struct skcipher_alg mv_cesa_ecb_des3_ede_alg = {
static int mv_cesa_cbc_des3_op(struct skcipher_request *req,
struct mv_cesa_op_ctx *tmpl)
{
memcpy(tmpl->ctx.blkcipher.iv, req->iv, DES3_EDE_BLOCK_SIZE);
memcpy(tmpl->ctx.skcipher.iv, req->iv, DES3_EDE_BLOCK_SIZE);

return mv_cesa_des3_op(req, tmpl);
}
Expand Down Expand Up @@ -694,7 +694,7 @@ static int mv_cesa_aes_op(struct skcipher_request *req,
key = ctx->aes.key_enc;

for (i = 0; i < ctx->aes.key_length / sizeof(u32); i++)
tmpl->ctx.blkcipher.key[i] = cpu_to_le32(key[i]);
tmpl->ctx.skcipher.key[i] = cpu_to_le32(key[i]);

if (ctx->aes.key_length == 24)
cfg |= CESA_SA_DESC_CFG_AES_LEN_192;
Expand Down Expand Up @@ -755,7 +755,7 @@ static int mv_cesa_cbc_aes_op(struct skcipher_request *req,
{
mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTCM_CBC,
CESA_SA_DESC_CFG_CRYPTCM_MSK);
memcpy(tmpl->ctx.blkcipher.iv, req->iv, AES_BLOCK_SIZE);
memcpy(tmpl->ctx.skcipher.iv, req->iv, AES_BLOCK_SIZE);

return mv_cesa_aes_op(req, tmpl);
}
Expand Down

0 comments on commit 8160ee7

Please sign in to comment.