1
1
/* mbed Microcontroller Library
2
- * Copyright (c) 2016 ARM Limited
2
+ * Copyright (c) 2017 ARM Limited
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -37,11 +37,6 @@ using namespace utest::v1;
37
37
#else
38
38
#include < stdio.h>
39
39
#include < stdlib.h>
40
- #define mbedtls_printf printf
41
- #define mbedtls_snprintf snprintf
42
- #define mbedtls_exit exit
43
- #define MBEDTLS_EXIT_SUCCESS EXIT_SUCCESS
44
- #define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
45
40
#endif
46
41
47
42
#ifndef PUT_UINT32_BE
@@ -86,20 +81,13 @@ typedef struct
86
81
*/
87
82
static int rnd_std_rand ( void *rng_state, unsigned char *output, size_t len )
88
83
{
89
- #if !defined(__OpenBSD__)
90
84
size_t i;
91
85
92
86
if ( rng_state != NULL )
93
87
rng_state = NULL ;
94
88
95
89
for ( i = 0 ; i < len; ++i )
96
90
output[i] = rand ();
97
- #else
98
- if ( rng_state != NULL )
99
- rng_state = NULL ;
100
-
101
- arc4random_buf ( output, len );
102
- #endif /* !OpenBSD */
103
91
104
92
return ( 0 );
105
93
}
@@ -144,7 +132,7 @@ static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len )
144
132
145
133
return ( 0 );
146
134
}
147
- /* BEGIN_CASE */
135
+
148
136
void ecp_test_vect ( mbedtls_ecp_group_id id, const char *dA_str, const char *xA_str, const char *yA_str,
149
137
const char *dB_str, const char *xB_str, const char *yB_str, const char *xZ_str,
150
138
const char *yZ_str )
@@ -202,7 +190,6 @@ void ecp_test_vect( mbedtls_ecp_group_id id, const char *dA_str, const char *xA_
202
190
TEST_ASSERT (_assert == -1 );
203
191
}
204
192
205
- /* END_CASE */
206
193
#define UTEST_FOR_ECP_TEST_VECTOR (id, dA_str, xA_str, yA_str, dB_str, xB_str, yB_str, xZ_str, yZ_str ) \
207
194
void utest_ ## id () { \
208
195
ecp_test_vect (id, dA_str, xA_str, yA_str, dB_str, xB_str, yB_str, xZ_str, yZ_str); \
@@ -211,8 +198,7 @@ Case case_ ## id (#id, utest_ ## id) \
211
198
212
199
213
200
#if defined MBEDTLS_ECP_DP_SECP192R1_ENABLED
214
- UTEST_FOR_ECP_TEST_VECTOR (ecp_test_vect,
215
- MBEDTLS_ECP_DP_SECP192R1,
201
+ UTEST_FOR_ECP_TEST_VECTOR ( MBEDTLS_ECP_DP_SECP192R1,
216
202
" 323FA3169D8E9C6593F59476BC142000AB5BE0E249C43426" ,
217
203
" CD46489ECFD6C105E7B3D32566E2B122E249ABAADD870612" ,
218
204
" 68887B4877DF51DD4DC3D6FD11F0A26F8FD3844317916E9A" ,
0 commit comments