diff --git a/tests/suites/test_suite_dhm.data b/tests/suites/test_suite_dhm.data index 773fe3b9c..1def7fca9 100644 --- a/tests/suites/test_suite_dhm.data +++ b/tests/suites/test_suite_dhm.data @@ -10,6 +10,8 @@ dhm_do_dhm:10:"23":3:10:"5":0 Diffie-Hellman full exchange: 5-bit, x_size=2 dhm_do_dhm:10:"23":2:10:"5":0 +## Repeat this test case and a few similar ones several times. The RNG state +## changes, so we get to exercise the code with a few different values. Diffie-Hellman full exchange: 5-bit #1 dhm_do_dhm:10:"23":1:10:"5":0 diff --git a/tests/suites/test_suite_dhm.function b/tests/suites/test_suite_dhm.function index c51ec946d..6d3743f94 100644 --- a/tests/suites/test_suite_dhm.function +++ b/tests/suites/test_suite_dhm.function @@ -1,6 +1,9 @@ /* BEGIN_HEADER */ #include "mbedtls/dhm.h" +/* Sanity checks on a Diffie-Hellman parameter: check the length-value + * syntax and check that the value is the expected one (taken from the + * DHM context by the caller). */ static int check_dhm_param_output( const mbedtls_mpi *expected, const unsigned char *buffer, size_t size, @@ -30,6 +33,8 @@ exit: return( ok ); } +/* Sanity checks on Diffie-Hellman parameters: syntax, range, and comparison + * against the context. */ static int check_dhm_params( const mbedtls_dhm_context *ctx, size_t x_size, const unsigned char *ske, size_t ske_len )