I am tasked with creating a random number generator for the embedded system. Currently, entropy sources using AMP are keyboard input and other variables such as signal strength and battery power.
I used PolarSSL , which has an awesome portable SSL library for embedded systems. However, with the exception of the documentation, there is very little about this on the Internet!
I think that I am not adding entropy sources to my entropy drive in the right way. This causes problems with the CTR-DRBG module , which returns an error in Init. ( Initial error -52)
Since the RNG is for the embedded system, there is no initial entropy from the system, therefore, an error. ( LINK ) I have no errors when I test the same RNG on another standard OS like Windows. Here are some of the codes related to it.
ctr_drbg_context ctx;
entropy_context etx;
entropy_init( &etx );
printf("Before ctrdrbg: %d", err);
err = ctr_drbg_init( &ctx, entropy_func, &etx, (const unsigned char *) "RANDOM_GEN", 10 );
if( err != 0 )
{
printf("Failed in ctr_drbg init!: %d", err);
}
Output:
Error on Ctr_drbg init: -52
I tried this for about a week, not having time. Almost give up !! Does anyone out there want to help?
source
share