mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-01 22:47:23 +00:00
Add improvement to chacha20 tests
Co-authored-by: minosgalanakis <[email protected]> Signed-off-by: Ben Taylor <[email protected]> (cherry picked from commit 9d6a54795c96f7f0d7dfc230071dc16c5f47f94a)
This commit is contained in:
@@ -97,7 +97,9 @@ void chacha20_input_len_too_long(void)
|
|||||||
/* Consume the rest of the final counter block, then reject more input. */
|
/* Consume the rest of the final counter block, then reject more input. */
|
||||||
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 63, input, output), 0);
|
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 63, input, output), 0);
|
||||||
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 0, NULL, NULL), 0);
|
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 0, NULL, NULL), 0);
|
||||||
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 1, input, output),
|
/*Test that zero length update does not break an exhausted context */
|
||||||
|
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 0, NULL, NULL), 0);
|
||||||
|
TEST_EQUAL(mbedtls_chacha20_update(&ctx, 1, input, output),
|
||||||
MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA);
|
MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA);
|
||||||
|
|
||||||
/* The final counter block is valid, but generating another block is not. */
|
/* The final counter block is valid, but generating another block is not. */
|
||||||
|
|||||||
Reference in New Issue
Block a user