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

Add test helpers to framework repo #37

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
6e450c7
Updated the PR template with new checkboxes
minosgalanakis May 1, 2024
1deadf5
Update .github/pull_request_template.md
minosgalanakis May 3, 2024
ad94717
Update .github/pull_request_template.md
minosgalanakis May 20, 2024
fc37c10
psa: fix parameters' names of psa_key_derivation_verify_bytes()
valeriosetti Jun 24, 2024
f47b66e
Remove MBEDTLS_RSA_ALT
tom-daubney-arm Jun 4, 2024
5edad7f
Remove MBEDTLS_DHM_ALT
tom-daubney-arm Jun 5, 2024
e647d8f
Remove MBEDTLS_ECJPAKE_ALT
tom-daubney-arm Jun 5, 2024
9da1769
Remove MBEDTLS_ECP_ALT and associated options
tom-daubney-arm Jun 6, 2024
3507d76
Modify rsa_alt_helpers.h docs
tom-daubney-arm Jul 1, 2024
b744dd3
Move some files to framework repository
davidhorstmann-arm Jul 5, 2024
dcf18dd
Update paths pointing to tests/data_files
davidhorstmann-arm Jun 11, 2024
4481698
Update directory-climbing path in context-info.sh
davidhorstmann-arm Jun 19, 2024
eb8abda
Fix line-too-long in generate_tls13_compat_tests.py
davidhorstmann-arm Jun 19, 2024
441b66c
Correct redundant framework/../framework paths
davidhorstmann-arm Jul 1, 2024
d178031
Replace data_files path with variable in compat.sh
davidhorstmann-arm Jul 1, 2024
184c4f0
Use variable for data_files path in ssl-opt.sh
davidhorstmann-arm Jul 1, 2024
661c088
Simplify data_files path in compat test generation
davidhorstmann-arm Jul 1, 2024
f36b7bc
Simplify path in audit-validity-dates.py
davidhorstmann-arm Jul 1, 2024
b51ed61
Move variable into generated bash
davidhorstmann-arm Jul 3, 2024
0cbf8d5
Update generated tls13 testcase script
davidhorstmann-arm Jul 3, 2024
53ce048
Update framework submodule
davidhorstmann-arm Jul 5, 2024
1d25626
Merge pull request #9271 from tom-daubney-arm/remove_asymmetric_crypt…
ronald-cron-arm Jul 5, 2024
797e43b
Update .github/pull_request_template.md
minosgalanakis Jul 8, 2024
0ce9fa9
Update the framework submodule to the merge of PR18
ronald-cron-arm Jul 9, 2024
fe3ad99
Merge pull request #9249 from davidhorstmann-arm/move-test-data-files…
ronald-cron-arm Jul 9, 2024
90ca414
Move crypto modules
ronald-cron-arm Jul 1, 2024
c29afb6
Adjust build systems
ronald-cron-arm Jul 1, 2024
52cd108
Adapt make cscope
ronald-cron-arm Jul 2, 2024
b2bdb78
Adapt libtestdriver1 build
ronald-cron-arm Jul 2, 2024
6921d54
Adapt check_names.py
ronald-cron-arm Jul 2, 2024
381247e
Adapt check-generated-files.sh
ronald-cron-arm Jul 2, 2024
ad6d1ce
Adapt list_internal_identifiers.py
ronald-cron-arm Jul 3, 2024
709bbf0
all.sh: Update paths to builtin driver modules and objects
ronald-cron-arm Jul 3, 2024
5b41a65
all.sh: Update paths to PSA core modules and objects
ronald-cron-arm Jul 3, 2024
8280398
Adapt all.sh cleanup
ronald-cron-arm Jul 2, 2024
1606cff
Move everest and p256-m
ronald-cron-arm Jul 1, 2024
aef8cf3
Adjust build systems
ronald-cron-arm Jul 1, 2024
691f67f
Adapt make cscope
ronald-cron-arm Jul 2, 2024
4cc77a1
Adapt libtestdriver1 build
ronald-cron-arm Jul 2, 2024
0070d05
Adapt check_names.py
ronald-cron-arm Jul 2, 2024
2f44756
Adapt check_files.py
ronald-cron-arm Jul 2, 2024
2fd621e
Adapt code_style.py
ronald-cron-arm Jul 2, 2024
f37ff7f
Adapt all.sh cleanup
ronald-cron-arm Jul 2, 2024
bdd8df8
Adapt documentation
ronald-cron-arm Jul 2, 2024
9027955
all.sh: Move definitions of PSA core and builtin source paths
ronald-cron-arm Jul 4, 2024
f250cf6
common.make: Use dedicated env variable
ronald-cron-arm Jul 4, 2024
080ab4f
check_files.py: Exempt only everest from license checking
ronald-cron-arm Jul 4, 2024
1992c91
Update the framework submodule to the merge of PR32
ronald-cron-arm Jul 10, 2024
1004c9c
Merge pull request #9340 from ronald-cron-arm/move-mbedtls-crypto-mod…
ronald-cron-arm Jul 10, 2024
f7ca94a
Remove MBEDTLS_POLY1305_ALT
tom-daubney-arm Jun 5, 2024
af28a17
Remove MBEDTLS_CHACHAPOLY_ALT
tom-daubney-arm Jun 5, 2024
f60ff02
Remove MBEDTLS_CHACHA20_ALT
tom-daubney-arm Jun 5, 2024
0916cd7
Replace MBEDTLS_MD_CAN_SHA256 with PSA_WANT_ALG_SHA_256
eleuzi01 May 23, 2024
4e6a368
Replace MBEDTLS_MD_CAN_SHA256 in md.h, ssl.h, and entropy.h
eleuzi01 Jun 26, 2024
095fa2c
Merge pull request #9173 from eleuzi01/replace-mbedtls-md-can-sha256
paul-elliott-arm Jul 11, 2024
d53e889
Update .github/pull_request_template.md
minosgalanakis Jul 11, 2024
1e96705
Replace MBEDTLS_MD_CAN_SHA3_224 with PSA_WANT_ALG_SHA3_224
eleuzi01 May 31, 2024
9a8a9d3
Replace MBEDTLS_MD_CAN_SHA3_224 in md.h
eleuzi01 Jun 26, 2024
ac97c86
Merge pull request #9080 from minosgalanakis/dev_fix_checkboxes
gilles-peskine-arm Jul 12, 2024
6a5278b
Merge pull request #9211 from eleuzi01/replace-mbedtls-md-can-sha3-224
gilles-peskine-arm Jul 12, 2024
3f2d9b6
Merge pull request #9268 from tom-daubney-arm/remove_symmetric_crypto…
bensze01 Jul 12, 2024
db0421c
Replace MBEDTLS_MD_CAN_SHA3_384 with PSA_WANT_ALG_SHA3_384
eleuzi01 May 31, 2024
7a507d2
Replace MBEDTLS_MD_CAN_SHA3_384 in md.h
eleuzi01 Jun 26, 2024
4137609
Remove MBEDTLS_AES_ALT
tom-daubney-arm Jun 4, 2024
b4914cf
Remove MBEDTLS_CCM_ALT
tom-daubney-arm Jun 4, 2024
c7cb810
Remove MBEDTLS_GCM_ALT
tom-daubney-arm Jun 4, 2024
e9fe311
Remove MBEDTLS_CAMELLIA_ALT
tom-daubney-arm Jun 5, 2024
064f1df
Remove MBEDTLS_ARIA_ALT
tom-daubney-arm Jun 5, 2024
a9ea6f8
Remove MBEDTLS_DES_ALT
tom-daubney-arm Jun 5, 2024
25e2be1
Remove MBEDTLS_NIST_KW_ALT
tom-daubney-arm Jun 5, 2024
ebeef15
Remove MBEDTLS_TEST_HAVE_ALT_GCM
tom-daubney-arm Jun 17, 2024
478efd7
Improved AES comment
tom-daubney-arm Jun 17, 2024
356309f
Restore config option
tom-daubney-arm Jun 18, 2024
53377f1
Update comment in further places
tom-daubney-arm Jun 20, 2024
3f40127
Merge pull request #9213 from eleuzi01/replace-mbedtls-md-can-sha3-384
bensze01 Jul 12, 2024
f974bff
Merge pull request #9259 from tom-daubney-arm/remove_aes-like_alt_int…
bensze01 Jul 12, 2024
5f616e9
Merge pull request #9308 from valeriosetti/fix-psa_key_derivation_ver…
gilles-peskine-arm Jul 15, 2024
eff4db6
Move some files to framework repository
davidhorstmann-arm Jul 17, 2024
a3aae68
Merge branch 'tmp-branch-move-files-to-framework' into dev/davidhorst…
davidhorstmann-arm Jul 17, 2024
9819b04
Update references to tests/src
davidhorstmann-arm Jul 12, 2024
bde4a56
Update comment references to test helpers
davidhorstmann-arm Jul 18, 2024
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
Prev Previous commit
Next Next commit
Remove MBEDTLS_AES_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
  • Loading branch information
tom-daubney-arm committed Jul 12, 2024
commit 4137609776bcf1aaaf0dce61951c09895754cf75
26 changes: 0 additions & 26 deletions include/mbedtls/mbedtls_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,32 +350,6 @@
*/
//#define MBEDTLS_TIMING_ALT

/**
* \def MBEDTLS_AES_ALT
*
* MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let Mbed TLS use your
* alternate core implementation of a symmetric crypto, an arithmetic or hash
* module (e.g. platform specific assembly optimized implementations). Keep
* in mind that the function prototypes should remain the same.
*
* This replaces the whole module. If you only want to replace one of the
* functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
*
* Example: In case you uncomment MBEDTLS_AES_ALT, Mbed TLS will no longer
* provide the "struct mbedtls_aes_context" definition and omit the base
* function declarations and implementations. "aes_alt.h" will be included from
* "aes.h" to include the new function definitions.
*
* Uncomment a macro to enable alternate implementation of the corresponding
* module.
*
* \warning MD5, DES and SHA-1 are considered weak and their
* use constitutes a security risk. If possible, we recommend
* avoiding dependencies on them, and considering stronger message
* digests and ciphers instead.
*
*/
//#define MBEDTLS_AES_ALT
//#define MBEDTLS_ARIA_ALT
//#define MBEDTLS_CAMELLIA_ALT
//#define MBEDTLS_CCM_ALT
Expand Down
23 changes: 0 additions & 23 deletions tests/include/alt-dummy/aes_alt.h

This file was deleted.

3 changes: 1 addition & 2 deletions tests/include/test/psa_crypto_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ uint64_t mbedtls_test_parse_binary_string(data_t *bin_string);
* \param key_type Key type
* \param key_bits Key length in number of bits.
*/
#if defined(MBEDTLS_AES_ALT) || \
defined(MBEDTLS_AES_SETKEY_ENC_ALT) || \
#if defined(MBEDTLS_AES_SETKEY_ENC_ALT) || \
defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_AES)
#define MBEDTLS_TEST_HAVE_ALT_AES 1
#else
Expand Down
8 changes: 0 additions & 8 deletions tf-psa-crypto/drivers/builtin/include/mbedtls/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
extern "C" {
#endif

#if !defined(MBEDTLS_AES_ALT)
// Regular implementation
//

/**
* \brief The AES context-type definition.
*/
Expand Down Expand Up @@ -88,10 +84,6 @@ typedef struct mbedtls_aes_xts_context {
} mbedtls_aes_xts_context;
#endif /* MBEDTLS_CIPHER_MODE_XTS */

#else /* MBEDTLS_AES_ALT */
#include "aes_alt.h"
#endif /* MBEDTLS_AES_ALT */

/**
* \brief This function initializes the specified AES context.
*
Expand Down
24 changes: 8 additions & 16 deletions tf-psa-crypto/drivers/builtin/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
#define MBEDTLS_AES_NEED_REVERSE_TABLES
#endif

#if !defined(MBEDTLS_AES_ALT)

#if defined(MBEDTLS_AES_ROM_TABLES)
/*
* Forward S-box
Expand Down Expand Up @@ -1436,8 +1434,6 @@ int mbedtls_aes_crypt_ctr(mbedtls_aes_context *ctx,
}
#endif /* MBEDTLS_CIPHER_MODE_CTR */

#endif /* !MBEDTLS_AES_ALT */

#if defined(MBEDTLS_SELF_TEST)
/*
* AES test vectors from:
Expand Down Expand Up @@ -1800,9 +1796,6 @@ int mbedtls_aes_self_test(int verbose)
mbedtls_aes_init(&ctx);

if (verbose != 0) {
#if defined(MBEDTLS_AES_ALT)
mbedtls_printf(" AES note: alternative implementation.\n");
#else /* MBEDTLS_AES_ALT */
#if defined(MBEDTLS_AESNI_HAVE_CODE)
#if MBEDTLS_AESNI_HAVE_CODE == 1
mbedtls_printf(" AES note: AESNI code present (assembly implementation).\n");
Expand All @@ -1825,7 +1818,6 @@ int mbedtls_aes_self_test(int verbose)
mbedtls_printf(" AES note: built-in implementation.\n");
#endif
}
#endif /* MBEDTLS_AES_ALT */
}

/*
Expand Down Expand Up @@ -1868,8 +1860,8 @@ int mbedtls_aes_self_test(int verbose)

/*
* AES-192 is an optional feature that may be unavailable when
* there is an alternative underlying implementation i.e. when
* MBEDTLS_AES_ALT is defined.
* there is an alternative underlying implementation such as a
* PSA driver.
*/
if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && keybits == 192) {
mbedtls_printf("skipped\n");
Expand Down Expand Up @@ -1932,8 +1924,8 @@ int mbedtls_aes_self_test(int verbose)

/*
* AES-192 is an optional feature that may be unavailable when
* there is an alternative underlying implementation i.e. when
* MBEDTLS_AES_ALT is defined.
* there is an alternative underlying implementation such as a
* PSA driver.
*/
if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && keybits == 192) {
mbedtls_printf("skipped\n");
Expand Down Expand Up @@ -1999,8 +1991,8 @@ int mbedtls_aes_self_test(int verbose)
ret = mbedtls_aes_setkey_enc(&ctx, key, keybits);
/*
* AES-192 is an optional feature that may be unavailable when
* there is an alternative underlying implementation i.e. when
* MBEDTLS_AES_ALT is defined.
* there is an alternative underlying implementation such as a
* PSA driver.
*/
if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && keybits == 192) {
mbedtls_printf("skipped\n");
Expand Down Expand Up @@ -2063,8 +2055,8 @@ int mbedtls_aes_self_test(int verbose)
ret = mbedtls_aes_setkey_enc(&ctx, key, keybits);
/*
* AES-192 is an optional feature that may be unavailable when
* there is an alternative underlying implementation i.e. when
* MBEDTLS_AES_ALT is defined.
* there is an alternative underlying implementation such as a
* PSA driver.
*/
if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && keybits == 192) {
mbedtls_printf("skipped\n");
Expand Down
4 changes: 2 additions & 2 deletions tf-psa-crypto/drivers/builtin/src/gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,8 @@ int mbedtls_gcm_self_test(int verbose)
key_len);
/*
* AES-192 is an optional feature that may be unavailable when
* there is an alternative underlying implementation i.e. when
* MBEDTLS_AES_ALT is defined.
* there is an alternative underlying implementation such as a
* PSA driver.
*/
if (ret == MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED && key_len == 192) {
mbedtls_printf("skipped\n");
Expand Down