diff --git a/IDE/WORKBENCH/README.md b/IDE/WORKBENCH/README.md index 1e0ca243a..74253f0f3 100644 --- a/IDE/WORKBENCH/README.md +++ b/IDE/WORKBENCH/README.md @@ -50,11 +50,21 @@ wolfcrypt directories. Uncheck the following: \#ifdef WOLFSSL\_VXWORKS block, a new GenerateSeed() function will need to be defined in wolfcrypt/src/random.c. +8. Include Entropy: + - Create a new project, similar to step 1 but choose VxWorks Source Build Project as the type of project instead of VxWorks Image Project. + + - In the project directory, double click "Source Build Configuration" and under os > core > CORE\_KERNEL Menu > VxWorks Kernel Component Configuration find "Inject entropy in interrupts". Double click this. + + - Go back to your VIP project. Right click the project and select "Properties". + + - In "Properties", select "Project References". Check the box next to the new project you created. Click "Ok". + + - Rebuild the project. + ####3 Testing wolfSSL with VxWorks: #####3.1 wolfCrypt Test and Benchmark Applications The wolfCrypt test application will test each of the cryptographic algorithms -and output the status for each as a success or failure. The benchmark application will output the runtime of -the cryptographic algorithms in milliseconds. +and output the status for each as a success or failure. The benchmark application will output the runtime of the cryptographic algorithms in milliseconds. 1. Include the following at the top of usrAppInit.c: diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 3793b69b4..d45800cb8 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1285,6 +1285,23 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) return 0; } +#elif defined(WOLFSSL_VXWORKS) + + #include + + int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) { + STATUS status; + + /* RANDOM ENTORPY INJECT component must be enabled in VSB project */ + status = randBytes (output, sz); + if (status == ERROR) { + WOLFSSL_MSG("Random seed failed! Enable RANDOM ENTROPY INJECT."); + return RNG_FAILURE_E; + } + + return 0; + } + #elif defined(CUSTOM_RAND_GENERATE) /* Implement your own random generation function