2013-11-11 11:26 AM
Hello
Maybe I'm wrong, but thehttp://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF259409
only provides binaries compatible with compilers from Keil or IAR but none for GCC. Since the sources aren't openly available, for reasons I can understand, is it possible that somebody from ST provides us an GCC compatible version? Thank you. #stm32-cryptograhic-library-gcc #understand-your-tools #understand-your-tools #know-your-tools2013-11-22 01:22 AM
2014-06-01 09:15 AM
Hi, where I should put that code?
I'm using Eclipse with this Plugin http://gnuarmeclipse.livius.net/blog/ and this Toolchain https://launchpad.net/gcc-arm-embedded, but I can't find any ''abi.c'' file...Thanks in advance,Pierpaolo2014-06-01 09:32 AM
Hi, where I should put that code? I'm using Eclipse with this Plugin http://gnuarmeclipse.livius.net/blog/ and this Toolchain https://launchpad.net/gcc-arm-embedded, but I can't find any ''abi.c'' file...
You can't find the file because I created for the sole purpose of making the linkage work. You take the code, place it in a file called abi.c, or whatever, put that in your project, along with the IAR library. The linker can then get closure on the symbols/functions it needs and you get working code out the back end. I'd refer to this as a shim or a wrapper, and it's a method of getting two similar but different API/ABI to work together. It's helps to allow code from one brand of compiler to work with another, or code from a different OS or platform work without modifying the original code, which you may, or may not, have access to.
2014-06-01 11:58 AM
Hi, thanks for the answer!
I'm trying to compile my project, but I can't figure it out.I'm including the library file (M4_CryptoFW_RngHW_2_0_6.a) via Eclipse, but it says:Building target: CryptoFirmware.elfInvoking: Cross ARM C Linkerarm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T libs.ld -T mem.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L''../ldscripts'' -L../libs -Wl,-Map,''CryptoFirmware.map'' -o ''CryptoFirmware.elf'' ./src/abi.o ./src/main.o ./libs/misc/src/_sbrk.o ./libs/misc/src/_write.o ./libs/misc/src/trace_impl.o ./libs/cmsis/src/startup_cm.o ./libs/cmsis/src/startup_stm32f4xx.o ./libs/cmsis/src/system_stm32f4xx.o ./libs/cmsis/src/vectors_stm32f4xx.o ./libs/StdPeriph/src/misc.o ./libs/StdPeriph/src/stm32f4xx_adc.o ./libs/StdPeriph/src/stm32f4xx_can.o ./libs/StdPeriph/src/stm32f4xx_crc.o ./libs/StdPeriph/src/stm32f4xx_cryp.o ./libs/StdPeriph/src/stm32f4xx_cryp_aes.o ./libs/StdPeriph/src/stm32f4xx_cryp_des.o ./libs/StdPeriph/src/stm32f4xx_cryp_tdes.o ./libs/StdPeriph/src/stm32f4xx_dac.o ./libs/StdPeriph/src/stm32f4xx_dbgmcu.o ./libs/StdPeriph/src/stm32f4xx_dcmi.o ./libs/StdPeriph/src/stm32f4xx_dma.o ./libs/StdPeriph/src/stm32f4xx_dma2d.o ./libs/StdPeriph/src/stm32f4xx_exti.o ./libs/StdPeriph/src/stm32f4xx_flash.o ./libs/StdPeriph/src/stm32f4xx_fmc.o ./libs/StdPeriph/src/stm32f4xx_fsmc.o ./libs/StdPeriph/src/stm32f4xx_gpio.o ./libs/StdPeriph/src/stm32f4xx_hash.o ./libs/StdPeriph/src/stm32f4xx_hash_md5.o ./libs/StdPeriph/src/stm32f4xx_hash_sha1.o ./libs/StdPeriph/src/stm32f4xx_i2c.o ./libs/StdPeriph/src/stm32f4xx_iwdg.o ./libs/StdPeriph/src/stm32f4xx_ltdc.o ./libs/StdPeriph/src/stm32f4xx_pwr.o ./libs/StdPeriph/src/stm32f4xx_rcc.o ./libs/StdPeriph/src/stm32f4xx_rng.o ./libs/StdPeriph/src/stm32f4xx_rtc.o ./libs/StdPeriph/src/stm32f4xx_sai.o ./libs/StdPeriph/src/stm32f4xx_sdio.o ./libs/StdPeriph/src/stm32f4xx_spi.o ./libs/StdPeriph/src/stm32f4xx_syscfg.o ./libs/StdPeriph/src/stm32f4xx_tim.o ./libs/StdPeriph/src/stm32f4xx_usart.o ./libs/StdPeriph/src/stm32f4xx_wwdg.o -llibs/mammtmym4.ac:/arm/gnu tools arm embedded/4.8 2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -llibs/M4_CryptoFW_RngHW_2_0_6.acollect2.exe: error: ld returned 1 exit status''I don't understand why it says so. I tried to change the path, the name, the directory... nothing works. Is this a problem of Eclipse or of my toolchain?Thanks,Pierpaolo2014-06-01 02:30 PM
I don't understand why it says so. I tried to change the path, the name, the directory... nothing works. Is this a problem of Eclipse or of my toolchain?
Probably the relative paths, and placement within your project, but I have no insight into how you're doing that. Realistically you probably don't need the -l and you could explicitly path the file. I use Yagarto and makefiles for my GNU/GCC work under Windows.2016-11-07 03:24 AM
Hi Mr Clive1,
Good Evening, I had a problem with Cryptography Library module SHA I have been already working with SWSTM32 Tools. for Developing Camera Application.In this application i need to use SHA256 cryptography algorithm. Please find attached file in which I mention issue. Currently Camera application migrate in IAR tools because Cryptography library LIB file available for IAR tools. Kindly provide me solution Regards from Paresh Parekh ________________ Attachments : Cryptography_Issue.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0pl&d=%2Fa%2F0X0000000bg0%2F9i_oiyKo.KMkfRSfGPRQEcf19i6YZJO8W5rXeYjM8ks&asPdf=false2016-11-07 04:28 AM
This perhaps should have been a new thread.
Not really able to divine the cause from the presentation, I would recommend getting it to work in a standalone form, and then integrate with your existing project. Create a number of your own test vectors from a PC implementation you have validated.One potential pitfall is that the library expects the CRC peripheral to be enabled, as this allows it to validate it is running on an STM32 core. For cores with a programmable CRC module it must be in the default 32-bit mode.2016-11-11 01:26 AM
Hi Clive1,
Thanks you very much for your support. Once I enable CRC clock my issue solved. Now SHA256 HASH algorithm works perfectly. Next step is RSA with 2048 bits key sign algorithm use for digitally sign data. STM32 Cryptography library support SHA1 with RSA 1024 bits key sign algorithm. I test this algorithm it's works fine. Can you guide me what is the changes require in above application to Digitally sign data on SAH256 with RSA2048 bits key? Thanks Paresh Parekh2016-11-11 08:09 AM
I'm afraid I don't have the resources to guide you through your project implementation.
The ST library basically covers the functionality it has in common with the hardware HASH/CRYPT engine.2016-11-11 09:02 AM
Hello,
I think you are using an old version of crypto-lib 2.0.6 (UM0586) and it will be better referring to the new version 3.1.0 and follow this manual .You should use the APIs of SHA256 HASH algorithm instead of SHA1.About RSA2048, the APIs remain the same as RSA1024, just for RSA_PKCS1v15_Sign function you should use E_SHA256 as ''P_hashType'' input parameter instead of E_SHA1.Also, use a Modulus and a private Exponent with size 2048 instead of 1024.Regards