cancel
Showing results for 
Search instead for 
Did you mean: 

encryption libraries not working

brisaargelia
Associate II
Posted on February 09, 2012 at 21:59

Hi everybody

I'm trying to use the encryption libraries

with an STM32F4Discovery board.

However, the function HASH_SHA1 is not obtaining

the hash value, it only got zero.

I am using this code to obtain the hash:

==========================================

uint8_t  arrdata[50];  //filled in HID interface

uint8_t  arrsha1[20];

 RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_HASH, ENABLE);

 HASH_SHA1(arrdata, 50, arrsha1);

========================================== 

arrsha1 always got zeroes.

I've traced the HASH_SHA1 function, and I feel it is working correctly

However, I can't see where in the library is the HASH computed,

as the function only read the value from an array...

Do you know if the encryuption libraries can be used with the

STM32F4Discovery board?

Brisa

#hash-sha1-encryption
5 REPLIES 5
jzarnow2
Associate II
Posted on February 09, 2012 at 22:27

Do you know if the encryuption libraries can be used with the

STM32F4Discovery board?

Brisa

Have you ever tried to discover the difference between STM32F40x

and STM32F41x chips ?

And what chip do you have on Discovery board ?
Posted on February 09, 2012 at 23:28

The board uses the STM32F407VGT6, and does not support hashing or encryption, presumably because of export restrictions that might otherwise exist.

http://www.st.com/internet/com/press_release/p3212.jsp

''The STM32F415 and STM32F417 parts add a crypto/hash processor to the STM32F405 and STM32F407. This crypto/hash processor includes hardware acceleration for AES 128, 192, 256, Triple DES, HASH (MD5, SHA-1). As an example of the performance achieved by the crypto/hash processor, the AES-256 encryption throughput reaches up to 149.33 Mbytes/s.''

Reading back the RCC clock register might be instructive as to whether the HASH unit is present/functional.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
brisaargelia
Associate II
Posted on February 10, 2012 at 04:53

Thanks.

I was aware of the difference between the series 40x/41x, but misinterpreted the description of the mcus

I had understood that *both* of them *have* hash/crypto processing, by software in the 40x and with specialized hardware in 41x series.

Thanks for correct my mistake.

Posted on February 10, 2012 at 15:45

They do have a software encryption library, but this is not supplied with the firmware library, and requires a separate NDA. Depending on your location this might be difficult to obtain, but other examples of SHA,MD5,AES,etc are available on the internets.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
brisaargelia
Associate II
Posted on February 15, 2012 at 05:38

Thanks Clive.

I'm talking with my local st representative, and had started the procedure to get the libraries, and yes, it will require an NDA

Thanks