8c8f269a | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Fix potential overflow in dma_prepare_sg
The mapped SG lists are written to hash_engine->ahash_src_addr which has the size ASPEED_HASH_SRC_DMA_BUF_LEN. Since scatterlists are
crypto: aspeed/hash - Fix potential overflow in dma_prepare_sg
The mapped SG lists are written to hash_engine->ahash_src_addr which has the size ASPEED_HASH_SRC_DMA_BUF_LEN. Since scatterlists are not bound in size, make sure that size is not exceeded.
If the mapped SG list is larger than the buffer, simply iterate over it as is done in the dma_prepare case.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
0602f0ef | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Iterate on large hashes in dma_prepare
Rather than failing a hash larger than ASPEED_CRYPTO_SRC_DMA_BUF_LEN, just hash them over and over again until it's done.
Signed-off-by:
crypto: aspeed/hash - Iterate on large hashes in dma_prepare
Rather than failing a hash larger than ASPEED_CRYPTO_SRC_DMA_BUF_LEN, just hash them over and over again until it's done.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
50871222 | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Add fallback
If a hash request fails due to a DMA mapping error, or if it is too large to fit in the the driver buffer, use a fallback to do the hash rather than failing.
Sign
crypto: aspeed/hash - Add fallback
If a hash request fails due to a DMA mapping error, or if it is too large to fit in the the driver buffer, use a fallback to do the hash rather than failing.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
5f38ebef | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Use API partial block handling
Use the Crypto API partial block handling.
Also switch to the generic export format.
Remove final function that is no longer used by the Crypto
crypto: aspeed/hash - Use API partial block handling
Use the Crypto API partial block handling.
Also switch to the generic export format.
Remove final function that is no longer used by the Crypto API. Move final padding into aspeed_ahash_dma_prepare_sg.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
278d737c | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Move final padding into dma_prepare
Rather than processing a final as two separate updates, combine them into one for the linear dma_prepare case.
This means that the total ha
crypto: aspeed/hash - Move final padding into dma_prepare
Rather than processing a final as two separate updates, combine them into one for the linear dma_prepare case.
This means that the total hash size is slightly reduced, but that will be fixed up later by repeating the hash if necessary.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
879203de | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Move sham_final call into sham_update
The only time when sham_final needs to be called in sham_finup is when the finup request fits into the partial block. Move this special h
crypto: aspeed/hash - Move sham_final call into sham_update
The only time when sham_final needs to be called in sham_finup is when the finup request fits into the partial block. Move this special handling into sham_update.
The comment about releaseing resources is non-sense. The Crypto API does not mandate the use of final so the user could always go away after an update and never come back. Therefore the driver must not hold any resources after an update call.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
43ddeca4 | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed/hash - Provide rctx->buffer as argument to fill padding
Instead of always writing the padding to rctx->buffer, make it an argument.
Signed-off-by: Herbert Xu <herbert@gondor.apana.or
crypto: aspeed/hash - Provide rctx->buffer as argument to fill padding
Instead of always writing the padding to rctx->buffer, make it an argument.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
7938eb10 | 13-May-2025 |
Herbert Xu <herbert@gondor.apana.org.au> |
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
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>
show more ...
|
7866701c | 20-Oct-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
crypto: aspeed-hace - Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to d
crypto: aspeed-hace - Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|
d33a6a3f | 13-Aug-2023 |
Herbert Xu <herbert@gondor.apana.org.au> |
crypto: aspeed - Remove non-standard sha512 algorithms
Algorithms must never be added to a driver unless there is a generic implementation. These truncated versions of sha512 slipped through. Remov
crypto: aspeed - Remove non-standard sha512 algorithms
Algorithms must never be added to a driver unless there is a generic implementation. These truncated versions of sha512 slipped through. Remove them as they are useless.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
|