mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
mbedtls: Remove -Wno-format
compile option for test app
This commit is contained in:
parent
92f94a51ea
commit
d4abf3ff45
@ -10,7 +10,6 @@ idf_component_register(SRC_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils mbedtls esp_timer unity spi_flash
|
||||
EMBED_TXTFILES ${TEST_CRTS}
|
||||
WHOLE_ARCHIVE)
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
||||
|
||||
idf_component_get_property(mbedtls mbedtls COMPONENT_LIB)
|
||||
target_compile_definitions(${mbedtls} INTERFACE "-DMBEDTLS_DEPRECATED_WARNING")
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
#include <esp_random.h>
|
||||
|
||||
#include <mbedtls/entropy.h>
|
||||
@ -247,9 +248,9 @@ static void test_ecp_mul(mbedtls_ecp_group_id id, const uint8_t *x_coord, const
|
||||
TEST_ASSERT_EQUAL(0, memcmp(y, result_y_coord, mbedtls_mpi_size(&R.MBEDTLS_PRIVATE(Y))));
|
||||
|
||||
if (id == MBEDTLS_ECP_DP_SECP192R1) {
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P192_POINT_MULTIPLY_OP, "%d us", elapsed_time);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P192_POINT_MULTIPLY_OP, "%" PRId64 " us", elapsed_time);
|
||||
} else if (id == MBEDTLS_ECP_DP_SECP256R1) {
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P256_POINT_MULTIPLY_OP, "%d us", elapsed_time);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P256_POINT_MULTIPLY_OP, "%" PRId64 " us", elapsed_time);
|
||||
}
|
||||
|
||||
mbedtls_ecp_point_free(&R);
|
||||
@ -303,9 +304,9 @@ static void test_ecp_verify(mbedtls_ecp_group_id id, const uint8_t *x_coord, con
|
||||
TEST_ASSERT_EQUAL(0, ret);
|
||||
|
||||
if (id == MBEDTLS_ECP_DP_SECP192R1) {
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P192_POINT_VERIFY_OP, "%d us", elapsed_time);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P192_POINT_VERIFY_OP, "%" PRId64 " us", elapsed_time);
|
||||
} else if (id == MBEDTLS_ECP_DP_SECP256R1) {
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P256_POINT_VERIFY_OP, "%d us", elapsed_time);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECP_P256_POINT_VERIFY_OP, "%" PRId64 " us", elapsed_time);
|
||||
}
|
||||
|
||||
mbedtls_ecp_point_free(&P);
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
#include <esp_log.h>
|
||||
|
||||
#include <mbedtls/entropy.h>
|
||||
@ -114,9 +115,9 @@ void test_ecdsa_verify(mbedtls_ecp_group_id id, const uint8_t *hash, const uint8
|
||||
elapsed_time = ccomp_timer_stop();
|
||||
|
||||
if (id == MBEDTLS_ECP_DP_SECP192R1) {
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECDSA_P192_VERIFY_OP, "%d us", elapsed_time);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECDSA_P192_VERIFY_OP, "%" PRId64 " us", elapsed_time);
|
||||
} else if (id == MBEDTLS_ECP_DP_SECP256R1) {
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECDSA_P256_VERIFY_OP, "%d us", elapsed_time);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(ECDSA_P256_VERIFY_OP, "%" PRId64 " us", elapsed_time);
|
||||
}
|
||||
|
||||
mbedtls_mpi_free(&r);
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include "esp_types.h"
|
||||
#include "esp_log.h"
|
||||
#include "ccomp_timer.h"
|
||||
@ -70,7 +71,7 @@ TEST_CASE("Test esp_sha()", "[hw_crypto]")
|
||||
elapsed = ccomp_timer_stop();
|
||||
TEST_ASSERT_EQUAL_HEX8_ARRAY(sha1_expected, sha1_result, sizeof(sha1_expected));
|
||||
us_sha1 = elapsed;
|
||||
ESP_LOGI(TAG, "esp_sha() 32KB SHA1 in %u us", us_sha1);
|
||||
ESP_LOGI(TAG, "esp_sha() 32KB SHA1 in %" PRIu32 " us", us_sha1);
|
||||
|
||||
#if SOC_SHA_SUPPORT_SHA512
|
||||
ccomp_timer_start();
|
||||
@ -79,15 +80,15 @@ TEST_CASE("Test esp_sha()", "[hw_crypto]")
|
||||
TEST_ASSERT_EQUAL_HEX8_ARRAY(sha512_expected, sha512_result, sizeof(sha512_expected));
|
||||
|
||||
us_sha512 = elapsed;
|
||||
ESP_LOGI(TAG, "esp_sha() 32KB SHA512 in %u us", us_sha512);
|
||||
ESP_LOGI(TAG, "esp_sha() 32KB SHA512 in %" PRIu32 " us", us_sha512);
|
||||
#endif
|
||||
|
||||
free(buffer);
|
||||
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(TIME_SHA1_32KB, "%dus", us_sha1);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(TIME_SHA1_32KB, "%" PRId32 " us", us_sha1);
|
||||
|
||||
#if SOC_SHA_SUPPORT_SHA512
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(TIME_SHA512_32KB, "%dus", us_sha512);
|
||||
TEST_PERFORMANCE_CCOMP_LESS_THAN(TIME_SHA512_32KB, "%" PRId32 " us", us_sha512);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user