Make GCM tests accept any cipher, not just AES
diff --git a/tests/suites/test_suite_gcm.function b/tests/suites/test_suite_gcm.function
index b131e7a..3167bdb 100644
--- a/tests/suites/test_suite_gcm.function
+++ b/tests/suites/test_suite_gcm.function
@@ -8,7 +8,8 @@
*/
/* BEGIN_CASE */
-void gcm_encrypt_and_tag( char *hex_key_string, char *hex_src_string,
+void gcm_encrypt_and_tag( int cipher_id,
+ char *hex_key_string, char *hex_src_string,
char *hex_iv_string, char *hex_add_string,
char *hex_dst_string, int tag_len_bits,
char *hex_tag_string, int init_result )
@@ -39,7 +40,7 @@
iv_len = unhexify( iv_str, hex_iv_string );
add_len = unhexify( add_str, hex_add_string );
- TEST_ASSERT( gcm_init( &ctx, POLARSSL_CIPHER_ID_AES, key_str, key_len * 8 ) == init_result );
+ TEST_ASSERT( gcm_init( &ctx, cipher_id, key_str, key_len * 8 ) == init_result );
if( init_result == 0 )
{
TEST_ASSERT( gcm_crypt_and_tag( &ctx, GCM_ENCRYPT, pt_len, iv_str, iv_len, add_str, add_len, src_str, output, tag_len, tag_output ) == 0 );
@@ -55,7 +56,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void gcm_decrypt_and_verify( char *hex_key_string, char *hex_src_string,
+void gcm_decrypt_and_verify( int cipher_id,
+ char *hex_key_string, char *hex_src_string,
char *hex_iv_string, char *hex_add_string,
int tag_len_bits, char *hex_tag_string,
char *pt_result, int init_result )
@@ -86,7 +88,7 @@
add_len = unhexify( add_str, hex_add_string );
unhexify( tag_str, hex_tag_string );
- TEST_ASSERT( gcm_init( &ctx, POLARSSL_CIPHER_ID_AES, key_str, key_len * 8 ) == init_result );
+ TEST_ASSERT( gcm_init( &ctx, cipher_id, key_str, key_len * 8 ) == init_result );
if( init_result == 0 )
{
ret = gcm_auth_decrypt( &ctx, pt_len, iv_str, iv_len, add_str, add_len, tag_str, tag_len, src_str, output );