mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-20 22:05:15 +00:00
Merge remote-tracking branch 'upstream/development' into make_tests_thread_safe
This commit is contained in:
commit
54ad01efed
228 changed files with 10997 additions and 4609 deletions
|
|
@ -26,7 +26,7 @@ if(TEST_CPP)
|
|||
)
|
||||
add_executable(cpp_dummy_build "${cpp_dummy_build_cpp}")
|
||||
target_include_directories(cpp_dummy_build PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include)
|
||||
target_link_libraries(cpp_dummy_build ${mbedcrypto_target})
|
||||
target_link_libraries(cpp_dummy_build ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
if(USE_SHARED_MBEDTLS_LIBRARY AND
|
||||
|
|
@ -81,9 +81,9 @@ foreach(exe IN LISTS executables_libs executables_mbedcrypto)
|
|||
# This emulates "if ( ... IN_LIST ... )" which becomes available in CMake 3.3
|
||||
list(FIND executables_libs ${exe} exe_index)
|
||||
if (${exe_index} GREATER -1)
|
||||
target_link_libraries(${exe} ${libs})
|
||||
target_link_libraries(${exe} ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
else()
|
||||
target_link_libraries(${exe} ${mbedcrypto_target})
|
||||
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ typedef struct {
|
|||
char md5, ripemd160, sha1, sha256, sha512,
|
||||
sha3_224, sha3_256, sha3_384, sha3_512,
|
||||
des3, des,
|
||||
aes_cbc, aes_cfb128, aes_cfb8, aes_gcm, aes_ccm, aes_xts, chachapoly,
|
||||
aes_cbc, aes_cfb128, aes_cfb8, aes_ctr, aes_gcm, aes_ccm, aes_xts, chachapoly,
|
||||
aes_cmac, des3_cmac,
|
||||
aria, camellia, chacha20,
|
||||
poly1305,
|
||||
|
|
@ -571,6 +571,8 @@ int main(int argc, char *argv[])
|
|||
todo.aes_cfb128 = 1;
|
||||
} else if (strcmp(argv[i], "aes_cfb8") == 0) {
|
||||
todo.aes_cfb8 = 1;
|
||||
} else if (strcmp(argv[i], "aes_ctr") == 0) {
|
||||
todo.aes_ctr = 1;
|
||||
} else if (strcmp(argv[i], "aes_xts") == 0) {
|
||||
todo.aes_xts = 1;
|
||||
} else if (strcmp(argv[i], "aes_gcm") == 0) {
|
||||
|
|
@ -774,6 +776,31 @@ int main(int argc, char *argv[])
|
|||
mbedtls_aes_free(&aes);
|
||||
}
|
||||
#endif
|
||||
#if defined(MBEDTLS_CIPHER_MODE_CTR)
|
||||
if (todo.aes_ctr) {
|
||||
int keysize;
|
||||
mbedtls_aes_context aes;
|
||||
|
||||
uint8_t stream_block[16];
|
||||
size_t nc_off;
|
||||
|
||||
mbedtls_aes_init(&aes);
|
||||
for (keysize = 128; keysize <= 256; keysize += 64) {
|
||||
mbedtls_snprintf(title, sizeof(title), "AES-CTR-%d", keysize);
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
memset(tmp, 0, sizeof(tmp));
|
||||
memset(stream_block, 0, sizeof(stream_block));
|
||||
nc_off = 0;
|
||||
|
||||
CHECK_AND_CONTINUE(mbedtls_aes_setkey_enc(&aes, tmp, keysize));
|
||||
|
||||
TIME_AND_TSC(title, mbedtls_aes_crypt_ctr(&aes, BUFSIZE, &nc_off, tmp, stream_block,
|
||||
buf, buf));
|
||||
}
|
||||
mbedtls_aes_free(&aes);
|
||||
}
|
||||
#endif
|
||||
#if defined(MBEDTLS_CIPHER_MODE_XTS)
|
||||
if (todo.aes_xts) {
|
||||
int keysize;
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@ set(libs
|
|||
)
|
||||
|
||||
add_executable(cmake_subproject cmake_subproject.c)
|
||||
target_link_libraries(cmake_subproject ${libs})
|
||||
target_link_libraries(cmake_subproject ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include <mbedtls/platform.h>
|
||||
#include <mbedtls/platform_util.h>
|
||||
#include "test/helpers.h"
|
||||
#include "test/threading_helpers.h"
|
||||
#include "test/macros.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue