mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge remote-tracking branch 'origin/development' into safer-ct5
This commit is contained in:
@ -31,10 +31,18 @@
|
||||
#include "mbedtls/platform_util.h"
|
||||
|
||||
#include <string.h>
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
#define PSA_TO_MBEDTLS_ERR(status) PSA_TO_MBEDTLS_ERR_LIST(status, \
|
||||
psa_to_ssl_errors, \
|
||||
psa_generic_status_to_mbedtls)
|
||||
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SSL_SOME_SUITES_USE_MAC)
|
||||
#include "psa/crypto.h"
|
||||
/* Define a local translating function to save code size by not using too many
|
||||
* arguments in each translating place. */
|
||||
static int local_err_translation(psa_status_t status)
|
||||
{
|
||||
return psa_status_to_mbedtls(status, psa_to_ssl_errors,
|
||||
ARRAY_LENGTH(psa_to_ssl_errors),
|
||||
psa_generic_status_to_mbedtls);
|
||||
}
|
||||
#define PSA_TO_MBEDTLS_ERR(status) local_err_translation(status)
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_CT_ASM)
|
||||
@ -57,8 +65,9 @@ volatile mbedtls_ct_uint_t mbedtls_ct_zero = 0;
|
||||
* only used here.
|
||||
*/
|
||||
#if defined(MBEDTLS_EFFICIENT_UNALIGNED_ACCESS) && \
|
||||
(defined(MBEDTLS_CT_ARM_ASM) || defined(MBEDTLS_CT_AARCH64_ASM))
|
||||
|
||||
((defined(MBEDTLS_CT_ARM_ASM) && (UINTPTR_MAX == 0xfffffffful)) || \
|
||||
defined(MBEDTLS_CT_AARCH64_ASM))
|
||||
/* We check pointer sizes to avoid issues with them not matching register size requirements */
|
||||
#define MBEDTLS_EFFICIENT_UNALIGNED_VOLATILE_ACCESS
|
||||
|
||||
static inline uint32_t mbedtls_get_unaligned_volatile_uint32(volatile const unsigned char *p)
|
||||
@ -71,7 +80,7 @@ static inline uint32_t mbedtls_get_unaligned_volatile_uint32(volatile const unsi
|
||||
#if defined(MBEDTLS_CT_ARM_ASM)
|
||||
asm volatile ("ldr %0, [%1]" : "=r" (r) : "r" (p) :);
|
||||
#elif defined(MBEDTLS_CT_AARCH64_ASM)
|
||||
asm volatile ("ldr %w0, [%1]" : "=r" (r) : "r" (p) :);
|
||||
asm volatile ("ldr %w0, [%1]" : "=r" (r) : MBEDTLS_ASM_AARCH64_PTR_CONSTRAINT(p) :);
|
||||
#else
|
||||
#error No assembly defined for mbedtls_get_unaligned_volatile_uint32
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user