mbedtls/library
Janos Follath 23bdeca64d Add core constant time comparison
Unfortunately reusing the new function from the signed constant time
comparison is not trivial.

One option would be to do temporary conditional swaps which would prevent
qualifying input to const. Another way would be to add an additional
flag for the sign and make it an integral part of the computation, which
would defeat the purpose of having an unsigned core comparison.

Going with two separate function for now and the signed version can be
retired/compiled out with the legacy API eventually.

The new function in theory could be placed into either
`library/constant_time.c` or `library/bignum_new.c`. Going with the
first as the other functions in the second are not constant time yet and
this distinction seems more valuable for new (as opposed to belonging to
the `_core` functions.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-08-05 17:08:52 +01:00
..
.gitignore Add psa_crypto_driver_wrappers.c to .gitignore 2021-12-18 13:29:10 +05:30
aes.c Reformat AES changes for readability 2022-06-29 16:17:50 +01:00
aesni.c Refactor AES context to be shallow-copyable 2022-06-29 16:17:50 +01:00
aesni.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
aria.c Replace 3 byte shift with appropriate macro 2021-08-19 09:55:42 +01:00
asn1parse.c
asn1write.c Fix bug whereby 0 was written as 0200 rather than 020100 2022-06-10 20:13:33 +02:00
base64.c Delete base64_invasive.h due to functions are moved to the constant-time module 2021-11-26 17:20:02 +01:00
bignum.c Reuse Bignum core I/O functions 2022-08-05 17:08:52 +01:00
bignum_core.h Reuse Bignum helper functions 2022-08-05 17:08:52 +01:00
bignum_internal.h Fix Doxygen for mbedtls_mpi_core_mla() 2022-04-11 13:44:15 +01:00
bignum_mod.h Clean up mpi_mod_init/free 2022-08-05 17:03:56 +01:00
bignum_mod_raw.h Fix typos 2022-08-05 17:03:56 +01:00
bignum_new.c Allow (NULL, 0) as a representation of 0 2022-08-05 17:08:52 +01:00
bn_mul.h Merge pull request #4686 from Kazuyuki-Kimura/patch_#2020 2022-07-29 17:08:11 +01:00
camellia.c Add Character byte reading macros 2021-08-19 09:55:41 +01:00
ccm.c Fix typos in documentation and constants with typo finding tool 2022-05-18 14:15:33 -04:00
chacha20.c Replace instances of byte reading macros with PUT 2021-08-19 09:56:47 +01:00
chachapoly.c Replace instances of byte reading macros with PUT 2021-08-19 09:56:47 +01:00
check_crypto_config.h
cipher.c Deprecate mbedtls_cipher_setup_psa() 2022-05-06 10:55:10 +02:00
cipher_wrap.c Use separate MBEDTLS_MODE for the CCM*. 2021-10-27 10:42:31 +02:00
cipher_wrap.h Make KEY_ID_ENCODES_OWNER compatible with USE_PSA_CRYPTO 2022-01-03 12:53:24 +01:00
cmac.c
CMakeLists.txt Build the new bignum_new.c file 2022-08-05 17:03:56 +01:00
common.h fix wrong para name in doxygen comments 2021-10-28 10:26:13 +08:00
constant_time.c Add core constant time comparison 2022-08-05 17:08:52 +01:00
constant_time_internal.h Add core constant time comparison 2022-08-05 17:08:52 +01:00
constant_time_invasive.h Add documentation for the functions 2021-11-26 17:25:14 +01:00
ctr_drbg.c Merge pull request #952 from gilles-peskine-arm/stdio_buffering-setbuf 2022-07-04 10:12:22 +01:00
debug.c Add missing parentheses 2021-06-17 21:46:29 +02:00
des.c Catch failures of AES or DES operations 2021-09-27 16:22:08 +02:00
dhm.c Call setbuf when reading or writing files: library 2022-06-30 17:03:40 +02:00
ecdh.c Reintroduce enum validation ecdh.c 2022-07-27 14:43:38 +01:00
ecdsa.c Remove NULL pointer validations in ecdsa.c 2022-07-27 14:28:20 +01:00
ecjpake.c Re-introduce ENUM validation in ecjpake.c 2022-07-27 15:20:08 +01:00
ecp.c Broke 2 long lines 2022-07-28 10:31:16 +01:00
ecp_curves.c Since the group is unloaded for all curves, it is better to initialize the group also for all curves. 2022-05-06 18:43:58 +02:00
ecp_internal_alt.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
ecp_invasive.h Move mbedtls_mpi_random to the bignum module 2021-06-03 18:10:04 +02:00
entropy.c Call setbuf when reading or writing files: library 2022-06-30 17:03:40 +02:00
entropy_poll.c Call setbuf when reading or writing files: library 2022-06-30 17:03:40 +02:00
entropy_poll.h Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
gcm.c Add missing local variable initialization 2022-05-13 18:08:11 +01:00
hash_info.c Fix typos in hash_info.[ch] 2022-07-26 10:20:52 +02:00
hash_info.h Fix typos in hash_info.[ch] 2022-07-26 10:20:52 +02:00
hkdf.c
hmac_drbg.c Call setbuf when reading or writing files: library 2022-06-30 17:03:40 +02:00
legacy_or_psa.h Fix a few more typos 2022-07-27 20:44:02 +02:00
Makefile Build the new bignum_new.c file 2022-08-05 17:03:56 +01:00
md.c Call setbuf when reading or writing files: library 2022-06-30 17:03:40 +02:00
md5.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
md_wrap.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
memory_buffer_alloc.c Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell. 2022-05-11 21:25:51 +01:00
mps_common.h Fix typos in documentation and constants with typo finding tool 2022-05-18 14:15:33 -04:00
mps_error.h
mps_reader.c Rename MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL to MBEDTLS_SSL_PROTO_TLS1_3 2021-12-10 13:47:55 +01:00
mps_reader.h
mps_trace.c Rename MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL to MBEDTLS_SSL_PROTO_TLS1_3 2021-12-10 13:47:55 +01:00
mps_trace.h
net_sockets.c Add a missing guard for time.h in net_sockets.c 2022-03-04 05:07:45 -05:00
nist_kw.c Merge branch 'development' into 3649_move_constant_time_functions_into_separate_module 2021-11-24 10:44:13 +01:00
oid.c Rework macros expressing dependencies 2022-07-21 12:11:53 +02:00
padlock.c Add fallback when rk unaligned with padlock 2022-07-05 11:55:15 +01:00
padlock.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
pem.c Rename the _ret() functions 2021-06-08 16:45:41 +02:00
pk.c Migrate from old inline to new actual function. 2022-07-18 21:28:38 +02:00
pk_wrap.c Merge pull request #6142 from tom-cosgrove-arm/fix-comments-in-docs-and-comments 2022-07-29 12:59:05 +01:00
pk_wrap.h Guard pk_opaque_rsa_decrypt() with PSA_WANT_KEY_TYPE_RSA_KEY_PAIR 2022-05-04 11:02:37 +02:00
pkcs5.c
pkcs12.c Add missing local variable initialization 2022-05-13 18:08:11 +01:00
pkparse.c Merge remote-tracking branch 'mbedtls-restricted/development-restricted' into mbedtls-3.2.0rc0-pr 2022-07-11 10:22:37 +02:00
pkwrite.c Add support for RSA Opaque PK key in mbedtls_pk_write_pubkey_der() 2022-04-07 15:01:24 +02:00
pkwrite.h Rename max sizes of RSA & EC DER keys defines 2022-03-01 10:03:21 +01:00
platform.c Fix code formatting 2022-07-01 16:43:25 +01:00
platform_util.c Add comment 2022-05-12 09:45:03 +01:00
poly1305.c Replace instances of byte reading macros with PUT 2021-08-19 09:57:41 +01:00
psa_crypto.c Merge pull request #5834 from mprse/HKDF_1 2022-06-20 15:27:46 +02:00
psa_crypto_aead.c Merge pull request #5047 from paul-elliott-arm/psa-m-aead-ccm 2021-12-09 14:49:42 +01:00
psa_crypto_aead.h Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell. 2022-05-11 21:25:51 +01:00
psa_crypto_cipher.c Use double quotes to include private header file psa_crypto_cipher.h 2022-08-02 12:44:35 +02:00
psa_crypto_cipher.h Merge branch 'development-restricted' into mbedtls-3.1.0rc-pr 2021-12-14 10:58:18 +01:00
psa_crypto_client.c Move the inclusion of crypto_spe.h to psa/crypto_platform.h 2021-06-17 11:43:58 +02:00
psa_crypto_core.h Code style improvements 2021-09-08 22:04:13 +05:30
psa_crypto_driver_wrappers.h Merge pull request #5292 from mprse/asym_encrypt 2022-03-10 20:07:38 +01:00
psa_crypto_ecp.c Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_ecp.h psa: test driver: Move driver test entry points prototypes 2021-12-06 07:50:27 +01:00
psa_crypto_hash.c Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_hash.h Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_invasive.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
psa_crypto_its.h
psa_crypto_mac.c psa: Fix and improve comments 2021-12-06 07:50:27 +01:00
psa_crypto_mac.h psa: test driver: Move driver test entry points prototypes 2021-12-06 07:50:27 +01:00
psa_crypto_random_impl.h
psa_crypto_rsa.c Rm now-duplicate helper function 2022-07-18 21:28:38 +02:00
psa_crypto_rsa.h psa_asymmetric_decrypt: move build-in impl to mbedtls_psa_asymmetric_decrypt 2022-01-10 12:55:06 +01:00
psa_crypto_se.c
psa_crypto_se.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
psa_crypto_slot_management.c Merge pull request #4878 from SiliconLabs/remove_dependency_4877 2021-09-20 22:20:16 +02:00
psa_crypto_slot_management.h
psa_crypto_storage.c Erase secrets in allocated memory before freeing said memory 2022-02-25 11:14:59 +01:00
psa_crypto_storage.h
psa_its_file.c Call setbuf when reading or writing files: library 2022-06-30 17:03:40 +02:00
ripemd160.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
rsa.c New internal module for managing hash information 2022-07-18 21:28:38 +02:00
rsa_alt_helpers.c
rsa_alt_helpers.h Replace all inclusions of config.h 2021-06-28 09:24:07 +01:00
sha1.c GET macros use a target variable 2021-08-19 09:31:55 +01:00
sha256.c Hide unnecessarily public functions in SHA-256 and SHA-512 A64 acceleration 2022-04-19 13:52:24 +01:00
sha512.c Hide unnecessarily public functions in SHA-256 and SHA-512 A64 acceleration 2022-04-19 13:52:24 +01:00
ssl_cache.c Merge remote-tracking branch 'mbedtls-restricted/development-restricted' into mbedtls-3.2.0rc0-pr 2022-07-11 10:22:37 +02:00
ssl_ciphersuites.c Migrate from old inline to new actual function. 2022-07-18 21:28:38 +02:00
ssl_client.c Rename functions and add test messages 2022-07-21 15:30:04 +02:00
ssl_client.h Mark internal int SSL functions CHECK_RETURN_CRITICAL 2022-06-20 21:12:55 +02:00
ssl_cookie.c Migrate from old inline to new actual function. 2022-07-18 21:28:38 +02:00
ssl_debug_helpers.h add named group debug helper 2022-05-09 15:49:00 +08:00
ssl_misc.h Merge pull request #6065 from mpg/explore2 2022-07-28 10:43:38 +02:00
ssl_msg.c Add check_return flag 2022-07-20 11:07:29 +08:00
ssl_ticket.c Mark static int SSL functions CHECK_RETURN_CRITICAL 2022-06-20 21:12:52 +02:00
ssl_tls.c Merge pull request #5963 from tom-daubney-arm/remove_ssl_compression_new 2022-07-28 10:28:23 +01:00
ssl_tls12_client.c Merge pull request #6142 from tom-cosgrove-arm/fix-comments-in-docs-and-comments 2022-07-29 12:59:05 +01:00
ssl_tls12_server.c Remove uses of SSL compression 2022-07-26 16:13:03 +01:00
ssl_tls13_client.c Replace hard-coded zeroes for constant 2022-07-26 16:13:23 +01:00
ssl_tls13_generic.c Merge pull request #6065 from mpg/explore2 2022-07-28 10:43:38 +02:00
ssl_tls13_invasive.h Merge remote-tracking branch 'mbedtls-restricted/development-restricted' into mbedtls-3.2.0rc0-pr 2022-07-11 10:22:37 +02:00
ssl_tls13_keys.c Merge pull request #6065 from mpg/explore2 2022-07-28 10:43:38 +02:00
ssl_tls13_keys.h Mark internal int SSL functions CHECK_RETURN_CRITICAL 2022-06-20 21:12:55 +02:00
ssl_tls13_server.c Replace hard-coded zeroes for constant 2022-07-26 16:13:23 +01:00
threading.c Fix typo "phtreads" to "pthreads" 2022-03-29 17:43:56 +02:00
timing.c Remove the dependency on MBEDTLS_HAVE_TIME from MBEDTLS_TIMING_C 2022-04-08 04:41:42 -04:00
version.c
x509.c Merge pull request #5980 from mprse/md_dep_fix 2022-06-29 10:18:41 +02:00
x509_create.c
x509_crl.c Do not include time.h without MBEDTLS_HAVE_TIME 2022-03-04 05:07:45 -05:00
x509_crt.c Merge pull request #2602 from edsiper/crt-symlink 2022-08-03 13:05:29 +02:00
x509_csr.c
x509write_crt.c Migrate from old inline to new actual function. 2022-07-18 21:28:38 +02:00
x509write_csr.c Migrate from old inline to new actual function. 2022-07-18 21:28:38 +02:00