Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do Not Review: Upmerge TF-M v2.1.0 and Mbed TLS v3.6.0 #1462

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions crypto/nrf_cc310_mbedcrypto/include/mbedtls/ecp_alt.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ mbedtls_ecp_group;
* \{
*/

#if !defined(MBEDTLS_ECP_MAX_BITS)
/**
* The maximum size of the groups, that is, of \c N and \c P.
*/
#define MBEDTLS_ECP_MAX_BITS 384 /**< The maximum size of groups, in bits. */
#endif

#if !defined(MBEDTLS_ECP_WINDOW_SIZE)
/*
* Maximum "window" size used for point multiplication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ K_MUTEX_DEFINE(power_mutex_int);
*/
K_MUTEX_DEFINE(heap_mutex_int);

/** @brief Definition of mutex for PSA storage key slot operations
*/
K_MUTEX_DEFINE(key_slot_mutex_int);

/** @brief Definition of mutex for PSA global access
*/
K_MUTEX_DEFINE(psa_globaldata_mutex_int);

/** @brief Definition of mutex for PSA global access
*/
K_MUTEX_DEFINE(psa_rng_mutex_int);

#elif CONFIG_CC3XX_ATOMIC_LOCK

/** @brief Definition of mutex for symmetric cryptography
Expand All @@ -63,13 +75,28 @@ static atomic_t power_mutex_int;
*/
static atomic_t heap_mutex_int;

/** @brief Definition of mutex for PSA storage key slot operations
*/
static atomic_t key_slot_mutex_int;

/** @brief Definition of mutex for PSA global access
*/
static atomic_t psa_globaldata_mutex_int;

/** @brief Definition of mutex for PSA global access
*/
static atomic_t psa_rng_mutex_int;

#elif defined(NRF5340_XXAA_APPLICATION) && NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX

typedef enum {
HW_MUTEX_SYM_CRYPTO = 15,
HW_MUTEX_ASYM_CRYPTO = 14,
HW_MUTEX_POWER_MODE = 13,
HW_MUTEX_HEAP_ALLOC = 12,
HW_MUTEX_KEY_SLOT = 11,
HW_MUTEX_PSA_GLOBALDATA = 10,
HW_MUTEX_PSA_RNG = 9,
} hw_mutex_t;

/** @brief Definition of mutex for symmetric cryptography
Expand All @@ -88,6 +115,18 @@ static hw_mutex_t power_mutex_int = HW_MUTEX_POWER_MODE;
*/
static hw_mutex_t heap_mutex_int = HW_MUTEX_HEAP_ALLOC;

/** @brief Definition of mutex for PSA storage key slot operations
*/
static hw_mutex_t key_slot_mutex_int = HW_MUTEX_KEY_SLOT;

/** @brief Definition of mutex for PSA global access
*/
static hw_mutex_t psa_globaldata_mutex_int = HW_MUTEX_PSA_GLOBALDATA;

/** @brief Definition of mutex for PSA global access
*/
static hw_mutex_t psa_rng_mutex_int = HW_MUTEX_PSA_RNG;

#else
#error "Improper configuration of the lock variant!"
#endif
Expand Down Expand Up @@ -161,7 +200,7 @@ static nrf_cc3xx_platform_mutex_t power_mutex = {
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced in the replacement
* file mbemory_buffer_alloc.c inside the heap structure.
* file memory_buffer_alloc.c inside the heap structure.
*/
nrf_cc3xx_platform_mutex_t heap_mutex = {
.mutex = &heap_mutex_int,
Expand All @@ -172,6 +211,51 @@ nrf_cc3xx_platform_mutex_t heap_mutex = {
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

/** @brief Definition of RTOS-independent key slot mutex
* with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced from Mbed TLS
*/
nrf_cc3xx_platform_mutex_t mbedtls_threading_key_slot_mutex = {
.mutex = &key_slot_mutex_int,
.flags = IS_ENABLED(CONFIG_CC3XX_ATOMIC_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC :
IS_ENABLED(CONFIG_CC3XX_HW_MUTEX_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX :
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

/** @brief Definition of RTOS-independent PSA global data mutex
* with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced from Mbed TLS
*/
nrf_cc3xx_platform_mutex_t mbedtls_threading_psa_globaldata_mutex = {
.mutex = &psa_globaldata_mutex_int,
.flags = IS_ENABLED(CONFIG_CC3XX_ATOMIC_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC :
IS_ENABLED(CONFIG_CC3XX_HW_MUTEX_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX :
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

/** @brief Definition of RTOS-independent psa global data mutex
* with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced from Mbed TLS
*/
nrf_cc3xx_platform_mutex_t mbedtls_threading_psa_rngdata_mutex = {
.mutex = &psa_rng_mutex_int,
.flags = IS_ENABLED(CONFIG_CC3XX_ATOMIC_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC :
IS_ENABLED(CONFIG_CC3XX_HW_MUTEX_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX :
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

static bool mutex_flags_unknown(uint32_t flags){
switch(flags){
case (NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID | NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_INTERNAL_MUTEX):
Expand Down
7 changes: 0 additions & 7 deletions crypto/nrf_cc312_mbedcrypto/include/mbedtls/ecp_alt.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ mbedtls_ecp_group;
* \{
*/

#if !defined(MBEDTLS_ECP_MAX_BITS)
/**
* The maximum size of the groups, that is, of \c N and \c P.
*/
#define MBEDTLS_ECP_MAX_BITS 384 /**< The maximum size of groups, in bits. */
#endif

#if !defined(MBEDTLS_ECP_WINDOW_SIZE)
/*
* Maximum "window" size used for point multiplication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ K_MUTEX_DEFINE(power_mutex_int);
*/
K_MUTEX_DEFINE(heap_mutex_int);

/** @brief Definition of mutex for PSA storage key slot operations
*/
K_MUTEX_DEFINE(key_slot_mutex_int);

/** @brief Definition of mutex for PSA global access
*/
K_MUTEX_DEFINE(psa_globaldata_mutex_int);

/** @brief Definition of mutex for PSA global access
*/
K_MUTEX_DEFINE(psa_rng_mutex_int);

#elif CONFIG_CC3XX_ATOMIC_LOCK

/** @brief Definition of mutex for symmetric cryptography
Expand All @@ -63,13 +75,28 @@ static atomic_t power_mutex_int;
*/
static atomic_t heap_mutex_int;

/** @brief Definition of mutex for PSA storage key slot operations
*/
static atomic_t key_slot_mutex_int;

/** @brief Definition of mutex for PSA global access
*/
static atomic_t psa_globaldata_mutex_int;

/** @brief Definition of mutex for PSA global access
*/
static atomic_t psa_rng_mutex_int;

#elif defined(NRF5340_XXAA_APPLICATION) && NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX

typedef enum {
HW_MUTEX_SYM_CRYPTO = 15,
HW_MUTEX_ASYM_CRYPTO = 14,
HW_MUTEX_POWER_MODE = 13,
HW_MUTEX_HEAP_ALLOC = 12,
HW_MUTEX_KEY_SLOT = 11,
HW_MUTEX_PSA_GLOBALDATA = 10,
HW_MUTEX_PSA_RNG = 9,
} hw_mutex_t;

/** @brief Definition of mutex for symmetric cryptography
Expand All @@ -88,6 +115,18 @@ static hw_mutex_t power_mutex_int = HW_MUTEX_POWER_MODE;
*/
static hw_mutex_t heap_mutex_int = HW_MUTEX_HEAP_ALLOC;

/** @brief Definition of mutex for PSA storage key slot operations
*/
static hw_mutex_t key_slot_mutex_int = HW_MUTEX_KEY_SLOT;

/** @brief Definition of mutex for PSA global access
*/
static hw_mutex_t psa_globaldata_mutex_int = HW_MUTEX_PSA_GLOBALDATA;

/** @brief Definition of mutex for PSA global access
*/
static hw_mutex_t psa_rng_mutex_int = HW_MUTEX_PSA_RNG;

#else
#error "Improper configuration of the lock variant!"
#endif
Expand Down Expand Up @@ -161,7 +200,7 @@ static nrf_cc3xx_platform_mutex_t power_mutex = {
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced in the replacement
* file mbemory_buffer_alloc.c inside the heap structure.
* file memory_buffer_alloc.c inside the heap structure.
*/
nrf_cc3xx_platform_mutex_t heap_mutex = {
.mutex = &heap_mutex_int,
Expand All @@ -172,6 +211,51 @@ nrf_cc3xx_platform_mutex_t heap_mutex = {
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

/** @brief Definition of RTOS-independent key slot mutex
* with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced from Mbed TLS
*/
nrf_cc3xx_platform_mutex_t mbedtls_threading_key_slot_mutex = {
.mutex = &key_slot_mutex_int,
.flags = IS_ENABLED(CONFIG_CC3XX_ATOMIC_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC :
IS_ENABLED(CONFIG_CC3XX_HW_MUTEX_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX :
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

/** @brief Definition of RTOS-independent PSA global data mutex
* with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced from Mbed TLS
*/
nrf_cc3xx_platform_mutex_t mbedtls_threading_psa_globaldata_mutex = {
.mutex = &psa_globaldata_mutex_int,
.flags = IS_ENABLED(CONFIG_CC3XX_ATOMIC_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC :
IS_ENABLED(CONFIG_CC3XX_HW_MUTEX_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX :
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

/** @brief Definition of RTOS-independent psa global data mutex
* with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that
* allocation is unneccesary
*
* @note This symbol can't be static as it is referenced from Mbed TLS
*/
nrf_cc3xx_platform_mutex_t mbedtls_threading_psa_rngdata_mutex = {
.mutex = &psa_rng_mutex_int,
.flags = IS_ENABLED(CONFIG_CC3XX_ATOMIC_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ATOMIC :
IS_ENABLED(CONFIG_CC3XX_HW_MUTEX_LOCK) ?
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_HW_MUTEX :
NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID
};

static bool mutex_flags_unknown(uint32_t flags){
switch(flags){
case (NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID | NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_INTERNAL_MUTEX):
Expand Down
1 change: 1 addition & 0 deletions nrf_dm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ config NRF_DM
select CMSIS_DSP_STATISTICS
select CMSIS_DSP_TRANSFORM
select EXPERIMENTAL
select STATIC_INIT_GNU
help
Enable nRF DM (Distance Measurement) library
14 changes: 0 additions & 14 deletions nrf_wifi/README.rst

This file was deleted.

Loading
Loading