2021-04-29 01:10 PM
Hello to all!
Using X-Cube-Cryptolib for RSA algorythm on Nucleo-L476RG board, encryption and subsequent decryption of demo message going very slow - 2 seconds, its mostly decription, i using hardware timer2 for time measuring.
Is there any ways to reduce decription time?
Best regards!
2021-04-29 01:16 PM
Code your own crypto more optimally? Perhaps there are commercial libraries that run faster, perhaps look at what's available for CM3 and CM4 platforms.
Large bit count, and Elliptic Curve stuff is going to be quite slow.
The L486 would likely provide faster AES-256
2021-04-29 10:47 PM
Are there any STM32 chips that support the RSA algorithm at the hardware level?
2021-04-30 12:29 AM
there isn't
2021-04-30 12:52 AM
Hello!
The Cryptolib documentation has performance tables for the RSA encryption algorithm.
In the demo example for the NUCLEO-L476RG board, decryption using the RSA algorithm takes 195123172 clock cycles, the chip operates at a frequency of 80 MHz, so decryption takes 2.5 seconds. But, according to Table 53, the decryption time should take 57192232 clock cycles, which is less than a second, and the key size is larger than in the demo example.
How can i achieve at least this speed of decryption? Why does the speed in the demo example not match the speed in the documentation? Despite the fact that the key is smaller.
And if we look at table 54 - there is decryption time takes 7588416 clock cycles, outstanding!) With key size 2048.
How can i achieve that?
Best regards, Vladimir.
2021-05-04 12:32 AM
Hello to all!!
Is it possible to increase the block of data for encryption and decryption for the RSA algorithm?
The current limit is 244 bytes.
Best regards!
2021-05-04 11:18 AM
I Wladimir,
Yes there are chips that support public key acceleration:
STM32L5, STM32WL, STM32L4Q, STM32WB and coming STM32U5 with DPA resistance
You have the information in AN5156 (except for STM32L4A which is quite recent)
Best regards
Jocelyn
2021-05-07 03:11 AM
Hello!
How can i include cryptolyb library .a files into STM32CubeIDE project?
Project doesn't recognize them for now. I put them in source directory in project files catalog.
The following errors occur:
" ../Src/main.c:313: undefined reference to `RSA_PKCS1v15_Encrypt' "
" ../Src/main.c:297: undefined reference to `RNGinit' "
Best regards!
2021-05-07 03:44 AM
Adding libs directory to "Library Path" in Project Properties doesn't change anything.
2021-05-07 06:35 AM
Hello Wladimir,
You can add the library in the Build configuration/Setting/GCC Linker/Libraries
In top window add:
:STM32CryptographicV3.0.0_CM4_GCC.a
in bottom window add the path to the library
Best regards
Jocelyn