-
Notifications
You must be signed in to change notification settings - Fork 8.1k
driver: crypto: add Espressif HW AES and SHA #97991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: crypto: add Espressif HW AES and SHA #97991
Conversation
7abb36a to
fa84648
Compare
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
fa84648 to
9581d40
Compare
b3603cf to
27d3f53
Compare
Add into device tree SHA and AES peripherals. Signed-off-by: Sylvio Alves <[email protected]>
27d3f53 to
745023e
Compare
Add hardware-accelerated SHA driver for Espressif SoCs supporting SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. Supported SoCs: - ESP32: SHA-224/256/384/512 (single-shot operations) - ESP32-S2/S3: SHA-224/256/384/512 (with multi-part support) - ESP32-C2/C3/C6/H2: SHA-224/256 (with multi-part support) Tested with Zephyr crypto subsystem hash_compute() API. Signed-off-by: Sylvio Alves <[email protected]>
Add hardware-accelerated AES driver for Espressif SoCs supporting ECB, CBC, and CTR cipher modes with AES-128, AES-192, and AES-256 key lengths. Supported modes: - ECB (Electronic Codebook) - CBC (Cipher Block Chaining) - CTR (Counter) Supported SoCs: - ESP32: All modes, all key sizes - ESP32-S2/S3: All modes, AES-128/256 only - ESP32-C2/C3/C6/H2: All modes, all key sizes Signed-off-by: Sylvio Alves <[email protected]>
Add support crypto tag into espressif boards. Signed-off-by: Sylvio Alves <[email protected]>
Allow ESP32 SoCs to run AES sample. Signed-off-by: Sylvio Alves <[email protected]>
Allow Espressif SoCs to be tested properly. Signed-off-by: Sylvio Alves <[email protected]>
745023e to
48e1a7e
Compare
|
|
|
||
| switch (algo) { | ||
| case CRYPTO_HASH_ALGO_SHA224: | ||
| params->hal_mode = SHA2_256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that the right hal mode or it should be SHA2_224 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, no, it must be SHA2_256. Espressif hardware doesn't have a separate SHA-224 engine. SHA-224 is implemented by running the SHA-256 hardware with a custom initialization vector (IV) and truncating the output to 224 bits. Shall I update the PR and add a proper comment in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, it all works good with samples/driver/crypto and also with the improved tests added in here: #98099
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope it is fine this way. I saw the comments about prefix IV and I thought that was the reason, but I checked the HAL and saw references to SHA224 and thought was better to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks awesome, glad to see it on esp32 :)



Add hardware-accelerated crypto drivers for Espressif SoCs, enabling
SHA hashing and AES encryption/decryption operations.
SHA Driver Support:
AES Driver Support:
Also expands crypto test suite to validate SHA-224/256/384/512
algorithms with unified test vector framework.