Split cipher_update_ad() out or cipher_reset()
diff --git a/tests/suites/test_suite_cipher.function b/tests/suites/test_suite_cipher.function
index d247bab..aa82daa 100644
--- a/tests/suites/test_suite_cipher.function
+++ b/tests/suites/test_suite_cipher.function
@@ -61,8 +61,11 @@
TEST_ASSERT( 0 == cipher_set_iv( &ctx_dec, iv, 16 ) );
TEST_ASSERT( 0 == cipher_set_iv( &ctx_enc, iv, 16 ) );
- TEST_ASSERT( 0 == cipher_reset( &ctx_dec, ad, 13 ) );
- TEST_ASSERT( 0 == cipher_reset( &ctx_enc, ad, 13 ) );
+ TEST_ASSERT( 0 == cipher_reset( &ctx_dec ) );
+ TEST_ASSERT( 0 == cipher_reset( &ctx_enc ) );
+
+ TEST_ASSERT( 0 == cipher_update_ad( &ctx_dec, ad, 13 ) );
+ TEST_ASSERT( 0 == cipher_update_ad( &ctx_enc, ad, 13 ) );
/* encode length number of bytes from inbuf */
TEST_ASSERT( 0 == cipher_update( &ctx_enc, inbuf, length, encbuf, &outlen ) );
@@ -137,7 +140,8 @@
TEST_ASSERT( 0 == cipher_setkey( &ctx, key, key_len, POLARSSL_ENCRYPT ) );
TEST_ASSERT( 0 == cipher_set_padding_mode( &ctx, pad_mode ) );
TEST_ASSERT( 0 == cipher_set_iv( &ctx, iv, 16 ) );
- TEST_ASSERT( 0 == cipher_reset( &ctx, NULL, 0 ) );
+ TEST_ASSERT( 0 == cipher_reset( &ctx ) );
+ TEST_ASSERT( 0 == cipher_update_ad( &ctx, NULL, 0 ) );
/* encode length number of bytes from inbuf */
TEST_ASSERT( 0 == cipher_update( &ctx, inbuf, length, encbuf, &outlen ) );
@@ -180,7 +184,9 @@
TEST_ASSERT( 0 == cipher_set_iv( &ctx_dec, iv, 16 ) );
- TEST_ASSERT( 0 == cipher_reset( &ctx_dec, NULL, 0 ) );
+ TEST_ASSERT( 0 == cipher_reset( &ctx_dec ) );
+
+ TEST_ASSERT( 0 == cipher_update_ad( &ctx_dec, NULL, 0 ) );
/* decode 0-byte string */
TEST_ASSERT( 0 == cipher_update( &ctx_dec, encbuf, 0, decbuf, &outlen ) );
@@ -237,8 +243,11 @@
TEST_ASSERT( 0 == cipher_set_iv( &ctx_dec, iv, 16 ) );
TEST_ASSERT( 0 == cipher_set_iv( &ctx_enc, iv, 16 ) );
- TEST_ASSERT( 0 == cipher_reset( &ctx_dec, NULL, 0 ) );
- TEST_ASSERT( 0 == cipher_reset( &ctx_enc, NULL, 0 ) );
+ TEST_ASSERT( 0 == cipher_reset( &ctx_dec ) );
+ TEST_ASSERT( 0 == cipher_reset( &ctx_enc ) );
+
+ TEST_ASSERT( 0 == cipher_update_ad( &ctx_dec, NULL, 0 ) );
+ TEST_ASSERT( 0 == cipher_update_ad( &ctx_enc, NULL, 0 ) );
/* encode length number of bytes from inbuf */
TEST_ASSERT( 0 == cipher_update( &ctx_enc, inbuf, first_length, encbuf, &outlen ) );