[PATCH v4 14/15] crypto: ti - Change lengths in AES to u64 to avoid potential overflows

From: T Pratham

Date: Thu Sep 10 2026 - 14:07:38 EST


Change cryptlen from unsigned int to u64 to avoid overflow when added in
padding length calculation.

Fixes: 35645ca63caa1 ("crypto: ti - Add support for AES-CTR in DTHEv2 driver")
Signed-off-by: T Pratham <t-pratham@xxxxxx>
---
drivers/crypto/ti/dthev2-aes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ti/dthev2-aes.c b/drivers/crypto/ti/dthev2-aes.c
index 150ba73776aa9..9b982ca4a7730 100644
--- a/drivers/crypto/ti/dthev2-aes.c
+++ b/drivers/crypto/ti/dthev2-aes.c
@@ -326,8 +326,8 @@ static int dthe_aes_run(struct crypto_engine *engine, void *areq)
struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req);
struct dthe_data *dev_data = rctx->dev_data;

- unsigned int len = req->cryptlen;
- unsigned int pad_len = 0;
+ u64 len = req->cryptlen;
+ u64 pad_len = 0;
struct scatterlist *src = req->src;
struct scatterlist *dst = req->dst;
struct scatterlist *sg;
--
2.34.1