diff --git a/dap-sdk/crypto/test/crypto/CMakeLists.txt b/dap-sdk/crypto/test/crypto/CMakeLists.txt index 7446c4f42426f5f3930722fcd6e9d0dd88f0e04b..78bda0e36f8304a3c8e84ef4416dc217ba8f2121 100755 --- a/dap-sdk/crypto/test/crypto/CMakeLists.txt +++ b/dap-sdk/crypto/test/crypto/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.0) project(crypto-test) diff --git a/dap-sdk/crypto/test/crypto/dap_enc_newhope_test.c b/dap-sdk/crypto/test/crypto/dap_enc_newhope_test.c index b1c879be6142803539238bdcdf19571ac2f35228..2a44232bb2236d961457ba1757680bfb010a4c64 100644 --- a/dap-sdk/crypto/test/crypto/dap_enc_newhope_test.c +++ b/dap-sdk/crypto/test/crypto/dap_enc_newhope_test.c @@ -19,7 +19,7 @@ void dap_enc_newhope_tests_run(const int times) dap_print_module_name("dap_enc_newhope"); init_test_case(); char tmp_buf[256]; - sprintf_s(tmp_buf, 256, "Key Exchange %d times", times); + snprintf(tmp_buf, sizeof(tmp_buf), "Key Exchange %d times", times); benchmark_mgs_time(tmp_buf, benchmark_test_time(test_newhope_kem, times)); diff --git a/dap-sdk/crypto/test/crypto/dap_enc_ringct20_test.c b/dap-sdk/crypto/test/crypto/dap_enc_ringct20_test.c index 0633dafed0d468e4344fb4dc611c35b05c30ed8b..6ee4936839b488158c4c1e35ea686fb8aab516cb 100644 --- a/dap-sdk/crypto/test/crypto/dap_enc_ringct20_test.c +++ b/dap-sdk/crypto/test/crypto/dap_enc_ringct20_test.c @@ -155,7 +155,7 @@ void dap_enc_ringct20_tests_run(const int times) dap_print_module_name("dap_enc_ringct20"); init_test_case(); char print_buf[512]; - sprintf_s(print_buf, 512, "Signing and verifying message %d time", times); + snprintf(print_buf, sizeof(print_buf), "Signing and verifying message %d time", times); benchmark_mgs_time(print_buf, benchmark_test_time(test_signing_verifying2, times)); diff --git a/dap-sdk/crypto/test/crypto/dap_enc_test.c b/dap-sdk/crypto/test/crypto/dap_enc_test.c index 2da1f2746a039cdb64bd813e9e3be0b248ee2c1f..38fa4499dbceaddad9668e5dc47efba8de57aac2 100755 --- a/dap-sdk/crypto/test/crypto/dap_enc_test.c +++ b/dap-sdk/crypto/test/crypto/dap_enc_test.c @@ -56,7 +56,7 @@ void test_encypt_decrypt(int count_steps, const dap_enc_key_type_t key_type, con } int time_end = get_cur_time_msec(); char pass_msg_buf[256]; - sprintf_s(pass_msg_buf, 256, "Encode and decode %d times T = %f (%f per once)", count_steps, (time_end - time_beg)/1000.0,(time_end - time_beg)/1000.0/count_steps); + snprintf(pass_msg_buf, sizeof(pass_msg_buf), "Encode and decode %d times T = %f (%f per once)", count_steps, (time_end - time_beg)/1000.0,(time_end - time_beg)/1000.0/count_steps); dap_pass_msg(pass_msg_buf); } @@ -107,7 +107,7 @@ void test_encypt_decrypt_fast(int count_steps, const dap_enc_key_type_t key_type dap_enc_key_delete(key); int time_end = get_cur_time_msec(); char pass_msg_buf[256]; - sprintf_s(pass_msg_buf, 256, "Encode and decode fast %d times T = %f (%f per once)", count_steps, (time_end - time_beg)/1000.0,(time_end - time_beg)/1000.0/count_steps); + snprintf(pass_msg_buf, sizeof(pass_msg_buf), "Encode and decode fast %d times T = %f (%f per once)", count_steps, (time_end - time_beg)/1000.0,(time_end - time_beg)/1000.0/count_steps); dap_pass_msg(pass_msg_buf); } diff --git a/dap-sdk/crypto/test/crypto/main.c b/dap-sdk/crypto/test/crypto/main.c index 019cb3778727913d65d74f02394d8316936d794a..0312dab8dbadd91332f9f601115937a6d81a7ee1 100755 --- a/dap-sdk/crypto/test/crypto/main.c +++ b/dap-sdk/crypto/test/crypto/main.c @@ -20,7 +20,7 @@ int main(void) // switch off debug info from library dap_log_level_set(L_CRITICAL); const int test_numbers = 100; - dap_enc_ringct20_tests_run(test_numbers);//return 0; +// dap_enc_ringct20_tests_run(test_numbers);//return 0; dap_enc_multi_sign_tests_run(); dap_enc_newhope_tests_run(test_numbers); test_encypt_decrypt (test_numbers, DAP_ENC_KEY_TYPE_SALSA2012, 32);