Skip to content

Commit

Permalink
crypto: qce - fix ctr-aes-qce block, chunk sizes
Browse files Browse the repository at this point in the history
Set blocksize of ctr-aes-qce to 1, so it can operate as a stream cipher,
adding the definition for chucksize instead, where the underlying block
size belongs.

Signed-off-by: Eneas U de Queiroz <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
cotequeiroz authored and herbertx committed Dec 27, 2019
1 parent b3c16bf commit bb5c863
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/crypto/qce/skcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ struct qce_skcipher_def {
const char *name;
const char *drv_name;
unsigned int blocksize;
unsigned int chunksize;
unsigned int ivsize;
unsigned int min_keysize;
unsigned int max_keysize;
Expand Down Expand Up @@ -298,7 +299,8 @@ static const struct qce_skcipher_def skcipher_def[] = {
.flags = QCE_ALG_AES | QCE_MODE_CTR,
.name = "ctr(aes)",
.drv_name = "ctr-aes-qce",
.blocksize = AES_BLOCK_SIZE,
.blocksize = 1,
.chunksize = AES_BLOCK_SIZE,
.ivsize = AES_BLOCK_SIZE,
.min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE,
Expand Down Expand Up @@ -368,6 +370,7 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def,
def->drv_name);

alg->base.cra_blocksize = def->blocksize;
alg->chunksize = def->chunksize;
alg->ivsize = def->ivsize;
alg->min_keysize = def->min_keysize;
alg->max_keysize = def->max_keysize;
Expand Down

0 comments on commit bb5c863

Please sign in to comment.