@@ -11,6 +11,8 @@ use wolfssl_wolfcrypt::random::RNG;
1111#[ test]
1212#[ cfg( random) ]
1313fn test_ecc_generate ( ) {
14+ common:: setup ( ) ;
15+
1416 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
1517 let mut ecc = ECC :: generate ( 32 , & mut rng, None , None ) . expect ( "Error with generate()" ) ;
1618 ecc. check ( ) . expect ( "Error with check()" ) ;
@@ -19,6 +21,8 @@ fn test_ecc_generate() {
1921#[ test]
2022#[ cfg( random) ]
2123fn test_ecc_generate_ex ( ) {
24+ common:: setup ( ) ;
25+
2226 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
2327 let curve_id = ECC :: SECP256R1 ;
2428 let curve_size = ECC :: get_curve_size_from_id ( curve_id) . expect ( "Error with get_curve_size_from_id()" ) ;
@@ -30,6 +34,8 @@ fn test_ecc_generate_ex() {
3034#[ test]
3135#[ cfg( all( ecc_import, ecc_export, random) ) ]
3236fn test_ecc_import_x963 ( ) {
37+ common:: setup ( ) ;
38+
3339 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
3440 let curve_id = ECC :: SECP256R1 ;
3541 let curve_size = ECC :: get_curve_size_from_id ( curve_id) . expect ( "Error with get_curve_size_from_id()" ) ;
@@ -47,6 +53,8 @@ fn test_ecc_import_x963() {
4753#[ test]
4854#[ cfg( random) ]
4955fn test_ecc_generate_ex2 ( ) {
56+ common:: setup ( ) ;
57+
5058 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
5159 let curve_id = ECC :: SECP256R1 ;
5260 let curve_size = ECC :: get_curve_size_from_id ( curve_id) . expect ( "Error with get_curve_size_from_id()" ) ;
@@ -58,6 +66,8 @@ fn test_ecc_generate_ex2() {
5866#[ test]
5967#[ cfg( all( ecc_import, ecc_export, ecc_sign, ecc_verify, random) ) ]
6068fn test_ecc_import_export_sign_verify ( ) {
69+ common:: setup ( ) ;
70+
6171 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
6272 let key_path = "../../../certs/ecc-client-key.der" ;
6373 let der: Vec < u8 > = fs:: read ( key_path) . expect ( "Error reading key file" ) ;
@@ -242,6 +252,8 @@ fn test_ecc_import_export_private_ex() {
242252#[ test]
243253#[ cfg( all( ecc_export, random) ) ]
244254fn test_ecc_export_public ( ) {
255+ common:: setup ( ) ;
256+
245257 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
246258 let mut ecc = ECC :: generate ( 32 , & mut rng, None , None ) . expect ( "Error with generate()" ) ;
247259 let mut qx = [ 0u8 ; 32 ] ;
@@ -281,6 +293,8 @@ fn test_ecc_import_unsigned() {
281293#[ test]
282294#[ cfg( random) ]
283295fn test_ecc_make_pub ( ) {
296+ common:: setup ( ) ;
297+
284298 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
285299 let key_path = "../../../certs/ecc-client-key.der" ;
286300 let der: Vec < u8 > = fs:: read ( key_path) . expect ( "Error reading key file" ) ;
@@ -294,6 +308,8 @@ fn test_ecc_make_pub() {
294308#[ test]
295309#[ cfg( all( ecc_export, random) ) ]
296310fn test_ecc_point ( ) {
311+ common:: setup ( ) ;
312+
297313 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
298314 let curve_id = ECC :: SECP256R1 ;
299315 let curve_size = ECC :: get_curve_size_from_id ( curve_id) . expect ( "Error with get_curve_size_from_id()" ) ;
@@ -308,6 +324,8 @@ fn test_ecc_point() {
308324#[ test]
309325#[ cfg( all( all( ecc_import, ecc_export, random) ) ) ]
310326fn test_ecc_point_import ( ) {
327+ common:: setup ( ) ;
328+
311329 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
312330 let curve_id = ECC :: SECP256R1 ;
313331 let curve_size = ECC :: get_curve_size_from_id ( curve_id) . expect ( "Error with get_curve_size_from_id()" ) ;
@@ -323,6 +341,8 @@ fn test_ecc_point_import() {
323341#[ test]
324342#[ cfg( all( ecc_import, ecc_export, ecc_comp_key, random) ) ]
325343fn test_ecc_point_import_compressed ( ) {
344+ common:: setup ( ) ;
345+
326346 let mut rng = RNG :: new ( ) . expect ( "Failed to create RNG" ) ;
327347 let curve_id = ECC :: SECP256R1 ;
328348 let curve_size = ECC :: get_curve_size_from_id ( curve_id) . expect ( "Error with get_curve_size_from_id()" ) ;
@@ -336,6 +356,8 @@ fn test_ecc_point_import_compressed() {
336356#[ test]
337357#[ cfg( ecc_import) ]
338358fn test_ecc_import ( ) {
359+ common:: setup ( ) ;
360+
339361 let qx = b"7a4e287890a1a47ad3457e52f2f76a83ce46cbc947616d0cbaa82323818a793d\0 " ;
340362 let qy = b"eec4084f5b29ebf29c44cce3b3059610922f8b30ea6e8811742ac7238fe87308\0 " ;
341363 let d = b"8c14b793cb19137e323a6d2e2a870bca2e7a493ec1153b3a95feb8a4873f8d08\0 " ;
@@ -345,6 +367,8 @@ fn test_ecc_import() {
345367
346368#[ test]
347369fn test_ecc_rs_hex_to_sig_not_null_terminated ( ) {
370+ common:: setup ( ) ;
371+
348372 let r_hex = b"AABB\0 " ;
349373 let s_hex = b"CCDD\0 " ;
350374 let r_hex_no_nul = b"AABB" ;
0 commit comments