@@ -300,9 +300,13 @@ typedef struct {
300
300
rsa, dhm, ecdsa, ecdh;
301
301
} todo_list;
302
302
303
- static void test_md ( const todo_list * todo )
303
+ static void test_md ( const todo_list * todo, mbedtls_platform_context* ctx )
304
304
{
305
305
unsigned char tmp[200 ];
306
+ // The call below is used to avoid the "unused parameter" warning.
307
+ // The context itself can be used by cryptographic calls which require it.
308
+ // Please refer to https://github.com/ARMmbed/mbedtls/issues/1200 for more information.
309
+ (void )ctx;
306
310
memset ( tmp, 0xBB , sizeof ( tmp ) );
307
311
308
312
#if defined(MBEDTLS_MD4_C)
@@ -336,10 +340,14 @@ static void test_md( const todo_list * todo )
336
340
#endif
337
341
}
338
342
339
- static void test_crypt ( const todo_list * todo )
343
+ static void test_crypt ( const todo_list * todo, mbedtls_platform_context* ctx )
340
344
{
341
345
unsigned char tmp[200 ];
342
346
char title[TITLE_LEN];
347
+ // The call below is used to avoid the "unused parameter" warning.
348
+ // The context itself can be used by cryptographic calls which require it.
349
+ // Please refer to https://github.com/ARMmbed/mbedtls/issues/1200 for more information.
350
+ (void )ctx;
343
351
memset ( tmp, 0xBB , sizeof ( tmp ) );
344
352
345
353
#if defined(MBEDTLS_ARC4_C)
@@ -563,9 +571,13 @@ static void test_crypt( const todo_list * todo )
563
571
564
572
}
565
573
566
- static void test_rng ( const todo_list * todo )
574
+ static void test_rng ( const todo_list * todo, mbedtls_platform_context* ctx )
567
575
{
568
576
unsigned char tmp[200 ];
577
+ // The call below is used to avoid the "unused parameter" warning.
578
+ // The context itself can be used by cryptographic calls which require it.
579
+ // Please refer to https://github.com/ARMmbed/mbedtls/issues/1200 for more information.
580
+ (void )ctx;
569
581
memset ( tmp, 0xBB , sizeof ( tmp ) );
570
582
571
583
#if defined(MBEDTLS_HAVEGE_C)
@@ -654,10 +666,14 @@ static void test_rng( const todo_list * todo )
654
666
#endif
655
667
}
656
668
657
- static void test_pk ( const todo_list * todo )
669
+ static void test_pk ( const todo_list * todo, mbedtls_platform_context* ctx )
658
670
{
659
671
unsigned char tmp[200 ];
660
672
char title[TITLE_LEN];
673
+ // The call below is used to avoid the "unused parameter" warning.
674
+ // The context itself can be used by cryptographic calls which require it.
675
+ // Please refer to https://github.com/ARMmbed/mbedtls/issues/1200 for more information.
676
+ (void )ctx;
661
677
memset ( tmp, 0xBB , sizeof ( tmp ) );
662
678
663
679
#if defined(MBEDTLS_RSA_C) && \
@@ -903,10 +919,7 @@ static int benchmark( int argc, char *argv[], mbedtls_platform_context* ctx )
903
919
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
904
920
unsigned char malloc_buf[HEAP_SIZE] = { 0 };
905
921
#endif
906
- // The call below is used to avoid the "unused parameter" warning.
907
- // The context itself can be used by cryptographic calls which require it.
908
- // Please refer to https://github.com/ARMmbed/mbedtls/issues/1200 for more information.
909
- (void )ctx;
922
+
910
923
if ( argc <= 1 )
911
924
{
912
925
memset ( &todo, 1 , sizeof ( todo ) );
@@ -980,10 +993,10 @@ static int benchmark( int argc, char *argv[], mbedtls_platform_context* ctx )
980
993
#endif
981
994
memset ( buf, 0xAA , sizeof ( buf ) );
982
995
983
- test_md ( & todo );
984
- test_crypt ( &todo );
985
- test_rng ( &todo );
986
- test_pk ( &todo );
996
+ test_md ( &todo, ctx );
997
+ test_crypt ( &todo, ctx );
998
+ test_rng ( &todo, ctx );
999
+ test_pk ( &todo, ctx );
987
1000
988
1001
mbedtls_printf (" \r\n DONE\r\n " );
989
1002
0 commit comments