7f887bdc05
Move license out of Doxygen comment
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-10-04 14:50:17 +02:00
8fcde5bb8e
Remove duplicate test case
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-10-04 13:53:33 +02:00
dba2677597
Update documentation
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-10-03 17:01:02 +02:00
02e5d439db
Add more tests for cond_assign/swap functions
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-10-03 16:45:11 +02:00
6546a6cc03
Rewrite tests for cond_assign/swap
...
The cond_swap and cond_assign test functions now requires the same limb size
for the MPI parameters.
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-10-03 14:56:51 +02:00
0957e7bfc5
Rmove MBEDTLS_NIST_KW_C dependency from MBEDTLS_SSL_TICKET_C
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-10-03 11:39:02 +02:00
6a5cc74cc4
Fix typos and comments
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-10-03 09:04:16 +02:00
460192ee19
Fix and sync configuration file and configuration verifiation
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-10-03 08:55:29 +02:00
bd99a0221b
test_driver_aead.c: add support for LIBTESTDRIVER1 tests
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-10-02 21:01:23 +02:00
e290f2ea14
all.sh: add testing of AEAD drivers with libtestdriver1
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-10-02 20:58:39 +02:00
5bbdfce44c
Streamline mbedtls_mpi_core_lt_ct unit test
...
Use mbedtls_test_read_mpi_core() to read the test data. Among other
benefits, X and Y are now allocated to their exact size, so analyzers (Asan,
Valgrind, Coverity, ...) have a chance of complaining if the tested function
overflows the buffer.
Remove TEST_CF_PUBLIC calls which are no longer necessary.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-09-30 18:53:04 +02:00
3aae4e815e
New function mbedtls_test_read_mpi_core
...
Allocate and read an MPI from a binary test argument.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-09-30 18:51:41 +02:00
571576fc5c
Move the definition of data_t to a header file
...
This way it can be used in helper functions.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-09-30 18:51:41 +02:00
bdc7b8bb6a
Allow test assertions on constant-flow scalar data
...
When testing a function that is supposed to be constant-flow, we declare the
inputs as constant-flow secrets with TEST_CF_SECRET. The result of such a
function is itself a constant-flow secret, so it can't be tested with
comparison operators.
In TEST_EQUAL, TEST_LE_U and TEST_LE_S, declare the values to be compared as
public. This way, test code doesn't need to explicitly declare results as
public if they're only used by one of these macros.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-09-30 18:51:41 +02:00
97483b0fd4
Remove incorrect comment
...
This comment (which used to be attached to the implementation, and should
not have been moved to the header file) is incorrect: the library function
mbedtls_mpi_read_string preserves leading zeros as desired, but does not
create a zero-limb object for an empty string.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-09-30 18:51:41 +02:00
ec5685f1ee
Use exact-size buffers for inputs and outputs to library functions in tests
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 14:48:54 +02:00
f5ca726ce1
Rename variables to match bettr to its purpose
...
The length in bytes is used with the 'len' prefix and
the length in limbs is used with the 'limbs' prefix.
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 14:35:42 +02:00
86dfe384c2
Fix documentation tags to be lower case
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 14:03:04 +02:00
e5b8585f1e
Follow parameter naming convention
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:54:02 +02:00
8b05e3b148
Add memory freeing
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:41 +02:00
a7584888da
Use exact-size buffers for inputs and outputs to library functions in tests
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:41 +02:00
821d15107b
Check true and false condition in the same test case
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:41 +02:00
1c628d5700
Follow parameter naming comvention
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
3eff425b1a
Use only one limb parameter for assign
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
81e57021c6
Change the input parameters to be const
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
2b5bf4cec7
Fix doumentation
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
027d696434
Remove unused code
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
b2763ef507
Do not read uninitialized memory
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
f4dd3b6a6d
Fix documentation
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:40 +02:00
cfc0eb8d22
Remove unused parameter
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:39 +02:00
53e455db7b
Remove return value checking from test functions of assign and swap
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:39 +02:00
87638a9ead
Add missing include
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:39 +02:00
63c3282ec4
Remove retrun code from mod_raw_cond_assign/swap
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:39 +02:00
24d183aa00
Use the new swap and assign function in the old interface
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:39 +02:00
9f6615f146
Remove argument checking from constant time functions
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:39 +02:00
b27b1c5db0
Add tests for conditional assign and swap functions
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:36:30 +02:00
12071d4403
Add conditional assign and swap function for MPI modulus
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:33:35 +02:00
e1d31c4aad
Add conditional swap and assign function for MPI core
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2022-09-30 13:33:30 +02:00
845de0898e
Merge pull request #6083 from tom-cosgrove-arm/issue-6015-montgomery-multiplication
...
Montgomery multiplication from bignum prototype
2022-09-30 10:35:21 +02:00
00a02b1468
Add Changelog entry
...
Signed-off-by: Victor Barpp Gomes <17840319+Kabbah@users.noreply.github.com >
2022-09-29 13:52:55 -03:00
d0225afcb6
Add a new test with a binary hwSerialNum
...
Signed-off-by: Victor Barpp Gomes <17840319+Kabbah@users.noreply.github.com >
2022-09-29 13:52:55 -03:00
31a8815f25
Documentation typo
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com >
2022-09-29 18:48:41 +02:00
6da3a3b15f
Fix doc regarding aliasing of modulus input to mbedtls_mpi_core_montmul()
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-09-29 17:20:18 +01:00
47c7a732d2
Print RFC 4108 hwSerialNum in hex format
...
Signed-off-by: Victor Barpp Gomes <17840319+Kabbah@users.noreply.github.com >
2022-09-29 11:34:23 -03:00
4386ead662
Correct the aliasing requirements in doc for mbedtls_mpi_core_montmul(), and test them
...
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com >
2022-09-29 14:40:21 +01:00
48a6a666a0
Add ssl-opt tls 1.2 tests for single cipher builds
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-09-29 15:29:33 +02:00
ce5b68c7a3
Revert "Fix guards for mbedtls_ssl_ticket_write() and mbedtls_ssl_ticket_parse() functions"
...
This reverts commit a82290b727
.
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-09-29 15:29:18 +02:00
8d4b241028
Remove redundant indirect dependencies after optimizing setup for one cipher components
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-09-29 10:13:40 +02:00
a891a091a3
test_suite_cmac.data: fix bug: use cipher type instead cipher id
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-09-29 09:53:20 +02:00
68db0d2f67
Optimize one cipher only components and adapt nemes
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2022-09-29 08:32:25 +02:00