mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Initialize platform in trng test
Add calls to `mbedtls_platform_setup()` and `mbedtls_platform_terminate()` to the trng greentea test, to initialize the hardware acceleration engines, in some platforms.pull/9493/head
							parent
							
								
									f95ec957dd
								
							
						
					
					
						commit
						22bf92bb7e
					
				| 
						 | 
					@ -43,6 +43,8 @@
 | 
				
			||||||
#include "base64b.h"
 | 
					#include "base64b.h"
 | 
				
			||||||
#include "pithy.h"
 | 
					#include "pithy.h"
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include "mbedtls/config.h"
 | 
				
			||||||
 | 
					#include "mbedtls/platform.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !DEVICE_TRNG
 | 
					#if !DEVICE_TRNG
 | 
				
			||||||
#error [NOT_SUPPORTED] TRNG API not supported for this target
 | 
					#error [NOT_SUPPORTED] TRNG API not supported for this target
 | 
				
			||||||
| 
						 | 
					@ -268,11 +270,17 @@ Specification specification(greentea_test_setup, cases, greentea_test_teardown_h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main()
 | 
					int main()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    int ret = 0;
 | 
				
			||||||
 | 
					#if defined(MBEDTLS_PLATFORM_C)
 | 
				
			||||||
 | 
					    ret = mbedtls_platform_setup(NULL);
 | 
				
			||||||
 | 
					#endif /* MBEDTLS_PLATFORM_C */
 | 
				
			||||||
#if (defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
 | 
					#if (defined(TARGET_PSA) && defined(COMPONENT_PSA_SRV_IPC) && defined(MBEDTLS_PSA_CRYPTO_C))
 | 
				
			||||||
    inject_entropy_for_psa();
 | 
					    inject_entropy_for_psa();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    bool ret = !Harness::run(specification);
 | 
					    ret = !Harness::run(specification);
 | 
				
			||||||
 | 
					#if defined(MBEDTLS_PLATFORM_C)
 | 
				
			||||||
 | 
					    mbedtls_platform_teardown(NULL);
 | 
				
			||||||
 | 
					#endif /* MBEDTLS_PLATFORM_C */
 | 
				
			||||||
    return ret;
 | 
					    return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue