diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-05-13 14:03:50 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-06-13 17:26:15 +0800 |
| commit | 7938eb10436c792bfb2d80433015347b571446d6 (patch) | |
| tree | 5755d734198d8e367e3b567e5895cefa12dcd0f1 | |
| parent | f6192d0d641f42f3f5b8efeb6e7f5f8bdbedf7bf (diff) | |
crypto: aspeed/hash - Reorganise struct aspeed_sham_reqctx
Move the from-device DMA buffer to the front of the structure.
Sort the rest by size and alignment.
Keep the partial block buffer at the end.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| -rw-r--r-- | drivers/crypto/aspeed/aspeed-hace.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/crypto/aspeed/aspeed-hace.h b/drivers/crypto/aspeed/aspeed-hace.h index 7ff1798bc198..a34677f10966 100644 --- a/drivers/crypto/aspeed/aspeed-hace.h +++ b/drivers/crypto/aspeed/aspeed-hace.h @@ -165,6 +165,12 @@ struct aspeed_sham_ctx { }; struct aspeed_sham_reqctx { + /* DMA buffer written by hardware */ + u8 digest[SHA512_DIGEST_SIZE] __aligned(64); + + /* Software state sorted by size. */ + u64 digcnt[2]; + unsigned long flags; /* final update flag should no use*/ unsigned long op; /* final or update */ u32 cmd; /* trigger cmd */ @@ -181,14 +187,13 @@ struct aspeed_sham_reqctx { const __be32 *sha_iv; /* remain data buffer */ - u8 buffer[SHA512_BLOCK_SIZE * 2]; dma_addr_t buffer_dma_addr; size_t bufcnt; /* buffer counter */ - /* output buffer */ - u8 digest[SHA512_DIGEST_SIZE] __aligned(64); dma_addr_t digest_dma_addr; - u64 digcnt[2]; + + /* This is DMA too but read-only for hardware. */ + u8 buffer[SHA512_BLOCK_SIZE * 2]; }; struct aspeed_engine_crypto { |
