cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4Cube: PolarSSL client Strange && in RandVal()

jjackbauer7
Associate III
Posted on February 27, 2015 at 17:48

Dear all,

In Cube version of STM32F4, there is a strange code.

In PolarSSL/SSL_Client/Src/main.c => RandVal()

Is there a reason to use ''&&'' instead of ''&'' in the following line:

*(output + offset) = HAL_RNG_GetRandomNumber(&RngHandle)

&&

0xFFFFFF00;

I suppose the developper made a mistake.

The second question is: why do we have to zero out the 8-bit LSB of the RNG value ?

#stm32f4 #rng
0 REPLIES 0