Allow use of FREESCALE hw RNG without a specific port

This commit is contained in:
Daniele Lacamera
2021-05-12 08:16:20 +02:00
parent 8a17e6c10e
commit 1dfde34852

View File

@ -1798,10 +1798,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
} }
#endif /* WOLFSSL_PIC32MZ_RNG */ #endif /* WOLFSSL_PIC32MZ_RNG */
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX) || \ #elif defined(FREESCALE_K70_RNGA) || defined(FREESCALE_RNGA)
defined(FREESCALE_KSDK_BM) || defined(FREESCALE_FREE_RTOS)
#if defined(FREESCALE_K70_RNGA) || defined(FREESCALE_RNGA)
/* /*
* wc_Generates a RNG seed using the Random Number Generator Accelerator * wc_Generates a RNG seed using the Random Number Generator Accelerator
* on the Kinetis K70. Documentation located in Chapter 37 of * on the Kinetis K70. Documentation located in Chapter 37 of
@ -1841,7 +1838,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
return 0; return 0;
} }
#elif defined(FREESCALE_K53_RNGB) || defined(FREESCALE_RNGB) #elif defined(FREESCALE_K53_RNGB) || defined(FREESCALE_RNGB)
/* /*
* wc_Generates a RNG seed using the Random Number Generator (RNGB) * wc_Generates a RNG seed using the Random Number Generator (RNGB)
* on the Kinetis K53. Documentation located in Chapter 33 of * on the Kinetis K53. Documentation located in Chapter 33 of
@ -1879,7 +1876,10 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
return 0; return 0;
} }
#elif defined(FREESCALE_KSDK_2_0_TRNG) #elif defined(FREESCALE_KSDK_2_0_TRNG)
#ifndef TRNG0
#define TRNG0 TRNG
#endif
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{ {
@ -1895,7 +1895,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
} }
} }
#elif defined(FREESCALE_KSDK_2_0_RNGA) #elif defined(FREESCALE_KSDK_2_0_RNGA)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{ {
@ -1912,7 +1912,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
} }
#elif defined(FREESCALE_RNGA) #elif defined(FREESCALE_RNGA)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{ {
@ -1920,9 +1920,13 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
return 0; return 0;
} }
#else #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX) || \
defined(FREESCALE_KSDK_BM) || defined(FREESCALE_FREE_RTOS)
/*
* Fallback to USE_TEST_GENSEED if a FREESCALE platform did not match any
* of the TRNG/RNGA/RNGB support
*/
#define USE_TEST_GENSEED #define USE_TEST_GENSEED
#endif /* FREESCALE_K70_RNGA */
#elif defined(WOLFSSL_SILABS_SE_ACCEL) #elif defined(WOLFSSL_SILABS_SE_ACCEL)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)