mbedtls/library
Janos Follath 8faf1d627b Change mbedtls_mpi_cmp_mpi_ct to check less than
The signature of mbedtls_mpi_cmp_mpi_ct() meant to support using it in
place of mbedtls_mpi_cmp_mpi(). This meant full comparison functionality
and a signed result.

To make the function more universal and friendly to constant time
coding, we change the result type to unsigned. Theoretically, we could
encode the comparison result in an unsigned value, but it would be less
intuitive.

Therefore we won't be able to represent the result as unsigned anymore
and the functionality will be constrained to checking if the first
operand is less than the second. This is sufficient to support the
current use case and to check any relationship between MPIs.

The only drawback is that we need to call the function twice when
checking for equality, but this can be optimised later if an when it is
needed.
2020-03-13 15:25:40 +00:00
..
.gitignore
aes.c Fix usage of randomized number in AES 2020-01-21 12:01:42 +02:00
aesni.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
arc4.c Changed mbedtls_platform_memcpy back to memcpy for selftest and test functions 2019-10-30 14:07:04 +02:00
aria.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
asn1parse.c Merge remote-tracking branch 'public/pr/2877' into baremetal 2019-10-23 14:53:29 +01:00
asn1write.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
base64.c Changed every memcmp to SCA equivalent mbedtls_platform_memcmp 2019-10-03 13:14:33 +03:00
bignum.c Change mbedtls_mpi_cmp_mpi_ct to check less than 2020-03-13 15:25:40 +00:00
blowfish.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
camellia.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
ccm.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
certs.c Fixup certs.c: Remove redundant TinyCrypt guard 2019-09-04 16:19:49 +01:00
chacha20.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
chachapoly.c Replace memset() with mbedtls_platform_memset() 2019-10-22 10:03:07 +02:00
cipher_wrap.c
cipher.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
cmac.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
CMakeLists.txt Add USE_TINYCRYPT build option to CMake files 2019-11-22 16:56:17 +00:00
ctr_drbg.c CTR_DRBG: support set_entropy_len() before seed() 2020-03-13 15:25:39 +00:00
debug.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
des.c Changed mbedtls_platform_memcpy back to memcpy for selftest and test functions 2019-10-30 14:07:04 +02:00
dhm.c Replace memset() with mbedtls_platform_memset() 2019-10-22 10:03:07 +02:00
ecdh.c Replace memset() with mbedtls_platform_memset() 2019-10-22 10:03:07 +02:00
ecdsa.c ECDSA: Fix side channel vulnerability 2020-03-13 15:25:39 +00:00
ecjpake.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
ecp_curves.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
ecp.c Change mbedtls_mpi_cmp_mpi_ct to check less than 2020-03-13 15:25:40 +00:00
entropy_poll.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
entropy.c Update signature of mbedtls_platform_random_delay 2020-01-09 10:19:07 +02:00
error.c Fix mbedtls_strerror to work with all wanted codes 2020-01-09 14:22:32 +02:00
gcm.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
havege.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
hkdf.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
hmac_drbg.c HMAC_DRBG: support set_entropy_len() before seed() 2020-03-13 15:24:20 +00:00
Makefile Add Makefile option to exclude TinyCrypt files 2019-11-22 15:09:39 +00:00
md2.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
md4.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
md5.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
md.c Include platform.h in hmac_drbg.c and md.c 2019-11-25 17:32:28 +02:00
memory_buffer_alloc.c Replace memset() with mbedtls_platform_memset() 2019-10-22 10:03:07 +02:00
net_sockets.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
nist_kw.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
oid.c Changed every memcmp to SCA equivalent mbedtls_platform_memcmp 2019-10-03 13:14:33 +03:00
padlock.c Added include platform_util.h to padlock.c to fix compile with all defines variants 2019-10-30 14:07:04 +02:00
pem.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
pk.c Update signature of mbedtls_platform_random_delay 2020-01-09 10:19:07 +02:00
pkcs5.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
pkcs11.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
pkcs12.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
pkparse.c Return and propagate UECC_FAULT_DETECTED 2019-11-26 12:54:06 +01:00
pkwrite.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
platform_util.c Rename macro MBEDTLS_MAX_RAND_DELAY 2020-01-09 11:11:23 +02:00
platform.c
poly1305.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
ripemd160.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
rsa_internal.c
rsa.c Changed mbedtls_platform_memcpy back to memcpy for selftest and test functions 2019-10-30 14:07:04 +02:00
sha1.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
sha256.c Protect get/put on secret data on sha256-module 2020-01-08 10:45:51 +02:00
sha512.c Changed mbedtls_platform_memset/cpy/cmp in selftest functions back to original methods 2019-10-30 14:07:04 +02:00
ssl_cache.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
ssl_ciphersuites.c Fixup: Add missing TinyCrypt guards 2019-09-04 16:17:45 +01:00
ssl_cli.c Update signature of mbedtls_platform_random_delay 2020-01-09 10:19:07 +02:00
ssl_cookie.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
ssl_srv.c Update signature of mbedtls_platform_random_delay 2020-01-09 10:19:07 +02:00
ssl_ticket.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
ssl_tls.c Fix bug in record decompression 2020-03-09 17:39:04 +00:00
threading.c
timing.c
version_features.c Move MBEDTLS_CTR_DRBG_USE_128_BIT_KEY to the correct section 2020-03-13 15:22:14 +00:00
version.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
x509_create.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
x509_crl.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
x509_crt.c Update signature of mbedtls_platform_random_delay 2020-01-09 10:19:07 +02:00
x509_csr.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
x509.c Merge remote-tracking branch 'public/pr/2877' into baremetal 2019-10-23 14:53:29 +01:00
x509write_crt.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
x509write_csr.c Changed every memcpy to SCA equivalent mbedtls_platform_memcpy 2019-10-30 14:07:04 +02:00
xtea.c Changed mbedtls_platform_memcpy back to memcpy for selftest and test functions 2019-10-30 14:07:04 +02:00