David Horstmann
e54f565d96
Stop testing Aria
...
Signed-off-by: David Horstmann <david.horstmann@arm.com >
2023-01-04 14:08:01 +00:00
Manuel Pégourié-Gonnard
7a389ddc84
Merge pull request #6784 from valeriosetti/issue6702
...
Make SHA224_C/SHA384_C independent from SHA256_C/SHA512_C
2023-01-03 09:36:58 +01:00
Janos Follath
b4b0bb737d
Merge pull request #5907 from mpg/use-psa-rsa-pss
...
Use PSA more often in `pk_verify_ext()`
2022-12-30 12:33:50 +00:00
Manuel Pégourié-Gonnard
4511ca063a
Use PSS-signed CRL for PSS tests
...
Otherwise, in builds without PKSC1_V15, tests that are supposed to
accept the certificate will fail, because once the cert is OK they will
move on to checking the CRL and will choke on its non-PSS signature.
Tests that are supposed to reject the cert due to an invalid signature
from the CA will not check the CRL because they don't recognize the CA
as valid, so they have no reason to check the CA's CRL. This was hiding
the problem until the recent commit that added a test where the cert is
supposed to be accepted.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2022-12-30 10:13:41 +01:00
Manuel Pégourié-Gonnard
6ea0a8d883
Disable 'wrong salt len' PK test with USE_PSA
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2022-12-29 10:07:08 +01:00
Valerio Setti
77b1452784
test: fix error in test_suite_ssl
...
Signed-off-by: Valerio Setti <vsetti@baylibre.com >
2022-12-23 10:53:06 +01:00
Manuel Pégourié-Gonnard
676766ff77
Merge pull request #6776 from gabor-mezei-arm/6222_bignum_mod_mul
...
Bignum: Implement fixed width modular multiplication
2022-12-23 10:39:30 +01:00
Manuel Pégourié-Gonnard
2fcb4c1d06
Merge pull request #6747 from gilles-peskine-arm/bignum-mod-random
...
Bignum mod random
2022-12-23 10:36:22 +01:00
Valerio Setti
b6bf7dcc28
test: fix depends.py for hash tests
...
Signed-off-by: Valerio Setti <vsetti@baylibre.com >
2022-12-22 14:28:03 +01:00
Manuel Pégourié-Gonnard
2510dd41bf
Merge pull request #6282 from gstrauss/sw_derive_y
...
mbedtls_ecp_point_read_binary from compressed fmt
2022-12-22 10:20:31 +01:00
Gabor Mezei
f65c71fbe6
Fix possible uninitialization error
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-21 11:54:22 +01:00
Manuel Pégourié-Gonnard
3b1a706935
Disable 'wrong salt len' test with USE_PSA
...
We've decided not to check it, see
https://github.com/Mbed-TLS/mbedtls/issues/5277
Also add a test that we accept the certificate with USE_PSA.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com >
2022-12-21 09:55:30 +01:00
Gilles Peskine
4c950d5ff1
Cosmetic fix
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-20 22:02:55 +01:00
Gilles Peskine
d1aa75d7b2
Update of the RNG seed in mpi_mod_random_values
...
The code had an earlier version. Update to the new seed that
mpi_core_random_basic has moved to.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-20 22:01:47 +01:00
Gilles Peskine
e1d8326e90
Fix representation of mod-random output
...
mbedtls_mpi_mod_raw_random() and mbedtls_mpi_mod_random() were producing
output in the Montgomery representation, instead of obeying the
representation chosen in the modulus structure. Fix this.
Duplicate the test cases for mod-random output to have separate test cases
for each representation.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-20 20:28:02 +01:00
Gilles Peskine
1e2a4d4089
Functions to convert raw residues to/from the modulus representation
...
Test cases will be generated automatically by a subsequent commit.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-20 19:55:51 +01:00
Gabor Mezei
78c4fb4551
Fix possible uninitialization error
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-20 18:09:49 +01:00
Gabor Mezei
f9728137d8
Fix the order of freeing memory
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-20 17:30:20 +01:00
Gabor Mezei
61fd1fb4b1
Calling the residue_release() is not needed
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-20 17:30:20 +01:00
Gabor Mezei
809baef2dd
Use helper functions to simplify test code
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-20 17:30:19 +01:00
Gabor Mezei
77b877d5a7
Generate operands in Mongomery representation for the test function
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-20 17:30:19 +01:00
Gabor Mezei
eca74668c7
Add tests for mod_mul
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-20 17:30:19 +01:00
Gilles Peskine
e162b4725c
Merge pull request #6777 from tom-cosgrove-arm/issue-6292-mod_inv
...
Bignum: Implement high level fixed width modular inversion
2022-12-17 13:26:02 +01:00
Gilles Peskine
cf86d70162
Merge pull request #6742 from gabor-mezei-arm/6022_bignum_mod_raw_mul
...
Bignum: Implement fixed width raw modular multiplication
2022-12-17 13:25:43 +01:00
Valerio Setti
e7221a21ad
test: adjust depends.py to new SHA224/SHA384 changes
...
Signed-off-by: Valerio Setti <vsetti@baylibre.com >
2022-12-16 14:43:48 +01:00
Gabor Mezei
b31b2e62ec
Generate operands in Mongomery representation for the test function
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-16 14:27:48 +01:00
Gilles Peskine
071f47343b
Document the test strategy
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:29 +01:00
Gilles Peskine
d878d1c638
Add validation tests for mbedtls_mpi_{mod,mod_raw}_random
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:29 +01:00
Gilles Peskine
b1eea02f74
Implement and test mbedtls_mpi_mod_random
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:29 +01:00
Gilles Peskine
d008abbc4f
Fix leak of modulus structures in tests
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:29 +01:00
Gilles Peskine
a57cf9813a
Implement and test mbedtls_mpi_mod_raw_random
...
In the basic/XXX=core test cases, use odd upper bounds, because the mod
version of random() only supports odd upper bounds (the upper bound is a
modulus and the mod modules only support odd moduli).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:29 +01:00
Gilles Peskine
8c32b24a35
Rename MPI-legacy test function for clarity
...
A mod version of the function will be added very soon.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:29 +01:00
Gilles Peskine
881447d411
Move bignum helpers to their own module
...
Move bignum-related helper functions to their own files under tests/include
and tests/src. The primary motivation is that a subsequent commit will make
bignum_helpers.h include library/bignum*.h, but we want to be able to
include <test/helpers.h> without having the library directory on the include
path (we do this in some programs under programs/ intended for testing).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-16 10:13:28 +01:00
Manuel Pégourié-Gonnard
5bf8629b2c
Merge pull request #6303 from gilles-peskine-arm/bignum-core-random
...
Bignum: Implement mbedtls_mpi_core_random
2022-12-16 09:58:07 +01:00
Gilles Peskine
d1dd41f3fc
Merge pull request #6723 from mpg/restartable-vs-use-psa
...
Document ECP_RESTARTABLE and make it compatible with USE_PSA
2022-12-15 19:47:44 +01:00
Gilles Peskine
c8d616364c
Merge pull request #6793 from tom-cosgrove-arm/update-mbedtls_mpi_mod_sub-tests-to-match-mod_add-tests
...
Update mbedtls_mpi_mod_sub() tests to incorporate mod_add test feedback
2022-12-15 19:47:01 +01:00
Tom Cosgrove
dc19759327
Add tests for mbedtls_mpi_mod_inv()
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-12-15 16:59:40 +00:00
Tom Cosgrove
786848b5c5
Add low-level Montgomery conversion functions to bignum_core
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-12-15 16:56:36 +00:00
Tom Cosgrove
28ff92cc3a
Add an explicit mbedtls_mpi_core_montmul_working_limbs() function
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-12-15 16:56:36 +00:00
Tom Cosgrove
30f3b4d601
Add mbedtls_mpi_core_check_zero_ct() and tests
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-12-15 16:56:36 +00:00
Gilles Peskine
acdefdd51a
Unify RNG initialization that must be unified
...
mpi_core_random_basic and mpi_random_values must generate the same random
sequences in order to get the expected test coverage (where we know we'll
hit certain numbers of retries). Facilitate this by defining the RNG seed
only once.
Fix the seed to explicitly list all 16 words of the key. This isn't strictly
required (missing initializer fields get the value zero), but it's clearer.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-12-15 15:15:47 +01:00
Gabor Mezei
80a334ada3
Add generated tests for mod_raw_mul
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-12-15 15:04:20 +01:00
Gilles Peskine
9fa4897839
Merge pull request #6772 from wernerlewis/bignum_refactor_sub
...
Bignum: Refactor mpi_core_sub tests to use arch_split
2022-12-15 12:32:44 +01:00
Gilles Peskine
081369111e
Merge pull request #6594 from gilles-peskine-arm/generate_test_code-function_comments
...
Allow comments in test function prototypes
2022-12-15 12:32:11 +01:00
Tom Cosgrove
7f4d15e84d
Update mbedtls_mpi_mod_sub() tests to incorporate mod_add test feedback
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-12-15 10:55:15 +00:00
Manuel Pégourié-Gonnard
50faa55e4d
Merge pull request #6732 from wernerlewis/bignum_6019_mod_add
...
Bignum: Implement mbedtls_mpi_mod_add()
2022-12-15 11:39:24 +01:00
Dave Rodgman
01f6e61781
Merge pull request #986 from Mbed-TLS/merge-back-3.3.0-3
...
Merge back 3.3.0 3
2022-12-14 19:18:05 +00:00
Dave Rodgman
ebef3562c3
Revert "Add generated files"
...
This reverts commit c18d932705
.
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2022-12-14 19:14:00 +00:00
Manuel Pégourié-Gonnard
c98624af3c
Merge pull request #6680 from valeriosetti/issue6599
...
Allow isolation of EC J-PAKE password when used in TLS
2022-12-14 11:04:33 +01:00
Valerio Setti
46e8fd8263
test: sha: test SHA224 and SHA256 separately
...
This is meant to adapt to the new library design in which
SHA224 and SHA256 can be built independently from each other.
Signed-off-by: Valerio Setti <vsetti@baylibre.com >
2022-12-14 10:58:02 +01:00