mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
crypto: inside-secure - fix queued len computation
[ Upstream commitccd65a206a] This patch fixes the queued len computation, which could theoretically be wrong if req->len[1] - req->processed[1] > 1. Be future-proof here, and fix it. Fixes:b460edb623("crypto: inside-secure - sha512 support") Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
65bf43424d
commit
ccc988d685
@@ -50,10 +50,12 @@ struct safexcel_ahash_req {
|
||||
|
||||
static inline u64 safexcel_queued_len(struct safexcel_ahash_req *req)
|
||||
{
|
||||
if (req->len[1] > req->processed[1])
|
||||
return 0xffffffff - (req->len[0] - req->processed[0]);
|
||||
u64 len, processed;
|
||||
|
||||
return req->len[0] - req->processed[0];
|
||||
len = (0xffffffff * req->len[1]) + req->len[0];
|
||||
processed = (0xffffffff * req->processed[1]) + req->processed[0];
|
||||
|
||||
return len - processed;
|
||||
}
|
||||
|
||||
static void safexcel_hash_token(struct safexcel_command_desc *cdesc,
|
||||
|
||||
Reference in New Issue
Block a user