mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 11:44:38 +02:00
Merge pull request #211 from lchristina26/master
GenerateSeed() Function for VxWorks compatibility
This commit is contained in:
@@ -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:
|
||||
|
||||
|
@@ -1285,6 +1285,23 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(WOLFSSL_VXWORKS)
|
||||
|
||||
#include <randomNumGen.h>
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user