-
Notifications
You must be signed in to change notification settings - Fork 3k
NUCLEO_F439ZI/mbedtls: add SHA1 hw_acceleration #3947
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
Conversation
|
||
|
||
#define MBEDTLS_SHA1_C |
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.
Why is MBEDTLS_SHA1_C defined here (and MBEDTLS_AES_C) was not ?
maybe add a small comment that explain what it is defined for
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 @LMESTM ,
This define is supposed to be located in features\mbedtls\inc\mbedtls\config.h.
It would enable the SHA1 module for every targets, thus adding code size for everyone.
I have chosen to add the SHA1 enablement in this target only.
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.
Ok clear - thanks
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.
Looks good to me.
I only asked few questions for my own understanding
|
||
void mbedtls_sha1_init( mbedtls_sha1_context *ctx ) | ||
{ | ||
memset( ctx, 0, sizeof( mbedtls_sha1_context ) ); |
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.
why using memset here and not zeroize as defined above ?
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.
ok, will do it
const mbedtls_sha1_context *src ) | ||
{ | ||
*dst = *src; | ||
} |
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 is safe for all toolchains and compilers options (no warnings?)
or would we need a copy ?
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.
This function is a copy-paste from the original mbedtls/src/sha1.c
As we are replacing the complete module, we had to import every function that is declared inside #if !defined(MBEDTLS_SHA1_ALT) in the original sha1.c file.
unsigned char *sbuf; | ||
unsigned char sbuf_len; | ||
HASH_HandleTypeDef hhash_sha1; | ||
int flag; /* flag to manage buffer constraint of crypto Hw */ |
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.
would be nice to explicit how flag is used (what 0 means / what 1 means)
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.
ok. I will add a comment
|
Hi @LMESTM |
* Make memory sections configurable in linker files * Dynamically determine vector location in flash for NVIC relocation * Advertise bootloader support in targets.json
When using ARM Compiler 5, the RTX config hard-coded the heap and stack sizes to specific values. This prevented the RTX HAL from dynamically allocating unused memory as heap space. Specifically, the HEAP_START define prevents this logic in RTX_CM_lib.h from activating. The rest of the defines are also set in that header, and should be removed from here.
The header is already included inside of flash_api.h if the target uses CMSIS flash algos. If it doesn't, the file shouldn't be included, since it doesn't exist.
* Using PinName as bitfield doesn't work without warnings, since NC needs all 32 bits to be represented. * lp_ticker should not be freed when interrupt is disabled, since this will kill the timebase.
Signed-off-by: Mahadevan Mahesh <[email protected]>
*** Is alpha *** I added options to tools/arm_pack_manager/pack_manager.py and tools/flash_algo/extract.py to allow a user to specify a single pack on disk to add to the cache. The syntax is as follows: - python tools/arm_pack_manager/pack_manager.py add-local-pack <local-pack> - cd tools/flash_algo; python extract.py --local-pack <local-pack> Both of these methods will add your pack to the index and copy the pack file into the location that arm_pack_manager would have placed it if it was downloaded from the internet.
GetSector has been rewritten
Signed-off-by: Mahadevan Mahesh <[email protected]>
Signed-off-by: Mahadevan Mahesh <[email protected]>
rebase done |
[Silicon Labs] Add TRNG support
17q2 l4 flash
Replace CMSIS flash driver by SDK flash driver
[Silicon Labs] Bugfix for bootloader on Pearl and Mighty Gecko
…er_support_stm32f439xI Add bootloader support stm32f439xI
Fix comments in KW41Z hardware entropy driver
Flash API support using the MCUXpresso drivers
Hello @0xc0170 |
I restarted the job, as it did not produce any valuable report (was restarted this morning by us). |
K64F: Add MMCAU driver needed for mbedtls
…spi_sdcard [NRF52840]: enabled SdBlockDevice capability
Add mmcau for K66F K82F KW24D
@adustm Can this be moved against the workshop branch? |
Description
Enable SHA1 for STM32F439ZI
Enable HW acceleration for SHA1 algorithm on STM32F439ZI
Status
READY
Migrations
If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.
YES | NO
Steps to test or reproduce
To test this feature, you have to modify TESTS/mbedtls/selfttest/main.cpp in order to call sha1 self test:
add:
#include "mbedtls/sha1.h"
then
then