mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-11-09 14:50:17 +08:00
Add improvement to chacha20 tests
Co-authored-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com> Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com> (cherry picked from commit 9d6a54795c96f7f0d7dfc230071dc16c5f47f94a)
This commit is contained in:
parent
a6023aef67
commit
8b7fca9ede
@ -97,7 +97,9 @@ void chacha20_input_len_too_long(void)
|
||||
/* 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, 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);
|
||||
|
||||
/* The final counter block is valid, but generating another block is not. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user