[PATCH v5 0/3] Add support for hashing algorithms in TI DTHE V2

T Pratham posted 3 patches 1 month, 3 weeks ago
There is a newer version of this series
drivers/crypto/ti/Kconfig         |    4 +
drivers/crypto/ti/Makefile        |    2 +-
drivers/crypto/ti/dthev2-aes.c    |    6 +-
drivers/crypto/ti/dthev2-common.c |   43 +-
drivers/crypto/ti/dthev2-common.h |   61 +-
drivers/crypto/ti/dthev2-hash.c   | 1074 +++++++++++++++++++++++++++++
6 files changed, 1172 insertions(+), 18 deletions(-)
create mode 100644 drivers/crypto/ti/dthev2-hash.c
[PATCH v5 0/3] Add support for hashing algorithms in TI DTHE V2
Posted by T Pratham 1 month, 3 weeks ago
DTHEv2 is a new cryptography engine introduced in TI AM62L SoC. The
features of DTHEv2 were detailed in [1]. Additional hardware details
available in SoC TRM [2]. DTHEv2 includes, among its various
sub-components, a hashing engine which is compliant with various IETF
and NIST standards, including FIPS 180-3 and FIPS PUB 198.

This patch series adds support for the hashing algorithms
SHA224/256/384/512 and MD5 as well as their HMAC counnterparts for the
hashing engine of Texas Instruments DTHE V2 crypto driver.

The driver is tested using full kernel crypto selftests
(CRYPTO_SELFTESTS_FULL) which all pass successfully [3].

Signed-off-by: T Pratham <t-pratham@ti.com>
---
[1]: [PATCH v7 0/2] Add support for Texas Instruments DTHEv2 Crypto Engine
Link: https://lore.kernel.org/all/20250820092710.3510788-1-t-pratham@ti.com/

[2]: Section 14.6.3 (DMA Control Registers -> DMASS_DTHE)
Link: https://www.ti.com/lit/ug/sprujb4/sprujb4.pdf

[3]: DTHEv2 kernel self-tests logs
Link: https://gist.github.com/Pratham-T/fd15b8e0ee815bcb420a60d451a0cf18

Changelog:
v5:
 - Removed CRYPTO_AHASH_ALG_FINAL_NON_ZERO and FINUP_MAX. Implemented
   the same mechanism in the driver itself by witholding one block in
   the req ctx. 
v4:
 - Export initial state when phash_available = 0
v3:
 - Check for error in registration individualy for hash and aes driver
   algos.
 - Fixed comment style in dthev2-common.c
v2:
 - Completely revamped the driver to use the new CRYPTO_AHASH_BLOCK_ONLY
   framework for handling partial blocks and crypto_engine for queueing.
 - Added HMAC as well.

Link to previous versions:
v3: https://lore.kernel.org/all/20260226131103.3560884-1-t-pratham@ti.com/
v2: https://lore.kernel.org/all/20260121132408.743777-1-t-pratham@ti.com/
v1: https://lore.kernel.org/all/20250218104943.2304730-1-t-pratham@ti.com/
---

T Pratham (3):
  crypto: ti - Add support for SHA224/256/384/512 in DTHEv2 driver
  crypto: ti - Add support for MD5 in DTHEv2 Hashing Engine driver
  crypto: ti - Add support for HMAC in DTHEv2 Hashing Engine driver

 drivers/crypto/ti/Kconfig         |    4 +
 drivers/crypto/ti/Makefile        |    2 +-
 drivers/crypto/ti/dthev2-aes.c    |    6 +-
 drivers/crypto/ti/dthev2-common.c |   43 +-
 drivers/crypto/ti/dthev2-common.h |   61 +-
 drivers/crypto/ti/dthev2-hash.c   | 1074 +++++++++++++++++++++++++++++
 6 files changed, 1172 insertions(+), 18 deletions(-)
 create mode 100644 drivers/crypto/ti/dthev2-hash.c

-- 
2.34.1
Re: [PATCH v5 0/3] Add support for hashing algorithms in TI DTHE V2
Posted by Herbert Xu 1 month, 2 weeks ago
On Fri, Aug 07, 2026 at 04:34:56PM +0530, T Pratham wrote:
> 
> T Pratham (3):
>   crypto: ti - Add support for SHA224/256/384/512 in DTHEv2 driver
>   crypto: ti - Add support for MD5 in DTHEv2 Hashing Engine driver

As even sha1 is being phased out, there is no point int adding
another new implementation of md5 into the kernel.

Please drop the md5 code.

>   crypto: ti - Add support for HMAC in DTHEv2 Hashing Engine driver

Sashiko has found some issues with this patch-set, please take
a look:

https://sashiko.dev/#/patchset/20260807110501.975130-1-t-pratham%40ti.com

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Re: [PATCH v5 0/3] Add support for hashing algorithms in TI DTHE V2
Posted by T Pratham 1 month, 1 week ago
On 8/15/26 06:39, Herbert Xu wrote:
> On Fri, Aug 07, 2026 at 04:34:56PM +0530, T Pratham wrote:
>>
>> T Pratham (3):
>>   crypto: ti - Add support for SHA224/256/384/512 in DTHEv2 driver
>>   crypto: ti - Add support for MD5 in DTHEv2 Hashing Engine driver
> 
> As even sha1 is being phased out, there is no point int adding
> another new implementation of md5 into the kernel.
> 
> Please drop the md5 code.

Ok.

> 
>>   crypto: ti - Add support for HMAC in DTHEv2 Hashing Engine driver
> 
> Sashiko has found some issues with this patch-set, please take
> a look:
> 
> https://sashiko.dev/#/patchset/20260807110501.975130-1-t-pratham%40ti.com

Will look into this and update. Thanks.

-- 
Regards
T Pratham <t-pratham@ti.com>