Rename HexParam_t -> data_t for consistent coding style
diff --git a/tests/scripts/generate_test_code.py b/tests/scripts/generate_test_code.py
index 047b130..c4c11fc 100755
--- a/tests/scripts/generate_test_code.py
+++ b/tests/scripts/generate_test_code.py
@@ -300,19 +300,19 @@
elif re.search('char\s*\*\s*.*', arg.strip()):
args.append('char*')
args_dispatch.append('(char *) params[%d]' % arg_idx)
- elif re.search('HexParam_t\s*\*\s*.*', arg.strip()):
+ elif re.search('data_t\s*\*\s*.*', arg.strip()):
args.append('hex')
# create a structure
pointer_initializer = '(uint8_t *) params[%d]' % arg_idx
len_initializer = '*( (uint32_t *) params[%d] )' % (arg_idx+1)
- locals += """ HexParam_t hex%d = {%s, %s};
+ locals += """ data_t data%d = {%s, %s};
""" % (arg_idx, pointer_initializer, len_initializer)
- args_dispatch.append('&hex%d' % arg_idx)
+ args_dispatch.append('&data%d' % arg_idx)
arg_idx += 1
else:
raise ValueError("Test function arguments can only be 'int', "
- "'char *' or 'HexParam_t'\n%s" % line)
+ "'char *' or 'data_t'\n%s" % line)
arg_idx += 1
return name, args, locals, args_dispatch
diff --git a/tests/scripts/test_generate_test_code.py b/tests/scripts/test_generate_test_code.py
index 9964ab9..f1088a3 100755
--- a/tests/scripts/test_generate_test_code.py
+++ b/tests/scripts/test_generate_test_code.py
@@ -442,11 +442,11 @@
Test hex parameters parsing
:return:
"""
- line = 'void entropy_threshold( char * a, HexParam_t * h, int result )'
+ line = 'void entropy_threshold( char * a, data_t * h, int result )'
name, args, local, arg_dispatch = parse_function_signature(line)
self.assertEqual(name, 'entropy_threshold')
self.assertEqual(args, ['char*', 'hex', 'int'])
- self.assertEqual(local, ' HexParam_t hex1 = {(uint8_t *) params[1], *( (uint32_t *) params[2] )};\n')
+ self.assertEqual(local, ' data_t hex1 = {(uint8_t *) params[1], *( (uint32_t *) params[2] )};\n')
self.assertEqual(arg_dispatch, ['(char *) params[0]', '&hex1', '*( (int *) params[3] )'])
def test_non_void_function(self):
@@ -454,15 +454,15 @@
Test invalid signature (non void).
:return:
"""
- line = 'int entropy_threshold( char * a, HexParam_t * h, int result )'
+ line = 'int entropy_threshold( char * a, data_t * h, int result )'
self.assertRaises(ValueError, parse_function_signature, line)
def test_unsupported_arg(self):
"""
- Test unsupported arguments (not among int, char * and HexParam_t)
+ Test unsupported arguments (not among int, char * and data_t)
:return:
"""
- line = 'int entropy_threshold( char * a, HexParam_t * h, int * result )'
+ line = 'int entropy_threshold( char * a, data_t * h, int * result )'
self.assertRaises(ValueError, parse_function_signature, line)
def test_no_params(self):
diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function
index 3c2a6db..56ae629 100644
--- a/tests/suites/helpers.function
+++ b/tests/suites/helpers.function
@@ -42,11 +42,11 @@
#endif
/* Type for Hex parameters */
-typedef struct HexParam_tag
+typedef struct data_tag
{
uint8_t * x;
uint32_t len;
-} HexParam_t;
+} data_t;
/*----------------------------------------------------------------------------*/
/* Status and error constants */
diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function
index a0f1b13..a797e69 100644
--- a/tests/suites/test_suite_aes.function
+++ b/tests/suites/test_suite_aes.function
@@ -8,8 +8,8 @@
*/
/* BEGIN_CASE */
-void aes_encrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int setkey_result )
+void aes_encrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string, int setkey_result )
{
unsigned char output[100];
mbedtls_aes_context ctx;
@@ -32,8 +32,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void aes_decrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int setkey_result )
+void aes_decrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string, int setkey_result )
{
unsigned char output[100];
mbedtls_aes_context ctx;
@@ -56,8 +56,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void aes_encrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void aes_encrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -81,8 +81,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void aes_decrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void aes_decrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -230,8 +230,8 @@
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void aes_encrypt_cfb128( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void aes_encrypt_cfb128( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_aes_context ctx;
@@ -252,8 +252,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void aes_decrypt_cfb128( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void aes_decrypt_cfb128( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_aes_context ctx;
@@ -274,8 +274,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void aes_encrypt_cfb8( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void aes_encrypt_cfb8( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_aes_context ctx;
@@ -295,8 +295,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void aes_decrypt_cfb8( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void aes_decrypt_cfb8( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_aes_context ctx;
diff --git a/tests/suites/test_suite_arc4.function b/tests/suites/test_suite_arc4.function
index 2a56a5b..ae3b032 100644
--- a/tests/suites/test_suite_arc4.function
+++ b/tests/suites/test_suite_arc4.function
@@ -8,8 +8,8 @@
*/
/* BEGIN_CASE */
-void mbedtls_arc4_crypt( HexParam_t * src_str, HexParam_t * key_str,
- HexParam_t * hex_dst_string )
+void mbedtls_arc4_crypt( data_t * src_str, data_t * key_str,
+ data_t * hex_dst_string )
{
unsigned char dst_str[1000];
mbedtls_arc4_context ctx;
diff --git a/tests/suites/test_suite_asn1write.function b/tests/suites/test_suite_asn1write.function
index 3b2d86e..aae44a8 100644
--- a/tests/suites/test_suite_asn1write.function
+++ b/tests/suites/test_suite_asn1write.function
@@ -11,7 +11,7 @@
*/
/* BEGIN_CASE */
-void mbedtls_asn1_write_octet_string( HexParam_t * str, HexParam_t * asn1,
+void mbedtls_asn1_write_octet_string( data_t * str, data_t * asn1,
int buf_len, int result )
{
int ret;
@@ -44,7 +44,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_asn1_write_ia5_string( char * str, HexParam_t * asn1,
+void mbedtls_asn1_write_ia5_string( char * str, data_t * asn1,
int buf_len, int result )
{
int ret;
@@ -79,7 +79,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_asn1_write_len( int len, HexParam_t * asn1, int buf_len,
+void mbedtls_asn1_write_len( int len, data_t * asn1, int buf_len,
int result )
{
int ret;
diff --git a/tests/suites/test_suite_base64.function b/tests/suites/test_suite_base64.function
index 53f0f69..3a8bf43 100644
--- a/tests/suites/test_suite_base64.function
+++ b/tests/suites/test_suite_base64.function
@@ -49,7 +49,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void base64_encode_hex( HexParam_t * src, char * dst, int dst_buf_size,
+void base64_encode_hex( data_t * src, char * dst, int dst_buf_size,
int result )
{
unsigned char *res = NULL;
@@ -70,7 +70,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void base64_decode_hex( char * src, HexParam_t * dst, int dst_buf_size,
+void base64_decode_hex( char * src, data_t * dst, int dst_buf_size,
int result )
{
unsigned char *res = NULL;
@@ -92,7 +92,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void base64_decode_hex_src( HexParam_t * src, char * dst_ref, int result )
+void base64_decode_hex_src( data_t * src, char * dst_ref, int result )
{
unsigned char dst[1000] = { 0 };
size_t len;
diff --git a/tests/suites/test_suite_blowfish.function b/tests/suites/test_suite_blowfish.function
index d88eac4..189e23d 100644
--- a/tests/suites/test_suite_blowfish.function
+++ b/tests/suites/test_suite_blowfish.function
@@ -8,8 +8,8 @@
*/
/* BEGIN_CASE */
-void blowfish_encrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int setkey_result )
+void blowfish_encrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string, int setkey_result )
{
unsigned char output[100];
mbedtls_blowfish_context ctx;
@@ -32,8 +32,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void blowfish_decrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int setkey_result )
+void blowfish_decrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string, int setkey_result )
{
unsigned char output[100];
mbedtls_blowfish_context ctx;
@@ -56,8 +56,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void blowfish_encrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void blowfish_encrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -82,8 +82,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void blowfish_decrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void blowfish_decrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -107,8 +107,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void blowfish_encrypt_cfb64( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string
+void blowfish_encrypt_cfb64( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string
)
{
unsigned char output[100];
@@ -130,8 +130,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void blowfish_decrypt_cfb64( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string
+void blowfish_decrypt_cfb64( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string
)
{
unsigned char output[100];
@@ -153,8 +153,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CTR */
-void blowfish_encrypt_ctr( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void blowfish_encrypt_ctr( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char stream_str[100];
unsigned char output[100];
diff --git a/tests/suites/test_suite_camellia.function b/tests/suites/test_suite_camellia.function
index 4bfa1a5..d09a610 100644
--- a/tests/suites/test_suite_camellia.function
+++ b/tests/suites/test_suite_camellia.function
@@ -8,8 +8,8 @@
*/
/* BEGIN_CASE */
-void camellia_encrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int setkey_result )
+void camellia_encrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string, int setkey_result )
{
unsigned char output[100];
mbedtls_camellia_context ctx;
@@ -32,8 +32,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void camellia_decrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int setkey_result )
+void camellia_decrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string, int setkey_result )
{
unsigned char output[100];
mbedtls_camellia_context ctx;
@@ -56,8 +56,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void camellia_encrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void camellia_encrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -81,8 +81,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void camellia_decrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void camellia_decrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -106,9 +106,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void camellia_encrypt_cfb128( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str,
- HexParam_t * hex_dst_string )
+void camellia_encrypt_cfb128( data_t * key_str, data_t * iv_str,
+ data_t * src_str,
+ data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_camellia_context ctx;
@@ -129,9 +129,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CFB */
-void camellia_decrypt_cfb128( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str,
- HexParam_t * hex_dst_string )
+void camellia_decrypt_cfb128( data_t * key_str, data_t * iv_str,
+ data_t * src_str,
+ data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_camellia_context ctx;
diff --git a/tests/suites/test_suite_ccm.function b/tests/suites/test_suite_ccm.function
index 79ee0ff..9951ca1 100644
--- a/tests/suites/test_suite_ccm.function
+++ b/tests/suites/test_suite_ccm.function
@@ -116,9 +116,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_ccm_encrypt_and_tag( int cipher_id, HexParam_t * key,
- HexParam_t * msg, HexParam_t * iv,
- HexParam_t * add, HexParam_t * result )
+void mbedtls_ccm_encrypt_and_tag( int cipher_id, data_t * key,
+ data_t * msg, data_t * iv,
+ data_t * add, data_t * result )
{
mbedtls_ccm_context ctx;
size_t tag_len;
@@ -149,10 +149,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_ccm_auth_decrypt( int cipher_id, HexParam_t * key,
- HexParam_t * msg, HexParam_t * iv,
- HexParam_t * add, int tag_len, int result,
- HexParam_t * hex_msg )
+void mbedtls_ccm_auth_decrypt( int cipher_id, data_t * key,
+ data_t * msg, data_t * iv,
+ data_t * add, int tag_len, int result,
+ data_t * hex_msg )
{
unsigned char tag[16];
mbedtls_ccm_context ctx;
diff --git a/tests/suites/test_suite_cipher.function b/tests/suites/test_suite_cipher.function
index ddb9576..0de02e8 100644
--- a/tests/suites/test_suite_cipher.function
+++ b/tests/suites/test_suite_cipher.function
@@ -471,9 +471,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void decrypt_test_vec( int cipher_id, int pad_mode, HexParam_t * key,
- HexParam_t * iv, HexParam_t * cipher,
- HexParam_t * clear, HexParam_t * ad, HexParam_t * tag,
+void decrypt_test_vec( int cipher_id, int pad_mode, data_t * key,
+ data_t * iv, data_t * cipher,
+ data_t * clear, data_t * ad, data_t * tag,
int finish_result, int tag_result )
{
unsigned char output[265];
@@ -529,9 +529,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_AEAD */
-void auth_crypt_tv( int cipher_id, HexParam_t * key, HexParam_t * iv,
- HexParam_t * ad, HexParam_t * cipher, HexParam_t * tag,
- char * result, HexParam_t * clear )
+void auth_crypt_tv( int cipher_id, data_t * key, data_t * iv,
+ data_t * ad, data_t * cipher, data_t * tag,
+ char * result, data_t * clear )
{
int ret;
unsigned char output[267]; /* above + 2 (overwrite check) */
@@ -598,8 +598,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void test_vec_ecb( int cipher_id, int operation, HexParam_t * key,
- HexParam_t * input, HexParam_t * result, int finish_result
+void test_vec_ecb( int cipher_id, int operation, data_t * key,
+ data_t * input, data_t * result, int finish_result
)
{
mbedtls_cipher_context_t ctx;
@@ -655,7 +655,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void check_padding( int pad_mode, HexParam_t * input, int ret, int dlen_check
+void check_padding( int pad_mode, data_t * input, int ret, int dlen_check
)
{
mbedtls_cipher_info_t cipher_info;
diff --git a/tests/suites/test_suite_cmac.function b/tests/suites/test_suite_cmac.function
index 85b3be1..cabf107 100644
--- a/tests/suites/test_suite_cmac.function
+++ b/tests/suites/test_suite_cmac.function
@@ -119,13 +119,13 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_cmac_multiple_blocks( int cipher_type, HexParam_t * key,
+void mbedtls_cmac_multiple_blocks( int cipher_type, data_t * key,
int keybits, int block_size,
- HexParam_t * block1, int block1_len,
- HexParam_t * block2, int block2_len,
- HexParam_t * block3, int block3_len,
- HexParam_t * block4, int block4_len,
- HexParam_t * expected_result )
+ data_t * block1, int block1_len,
+ data_t * block2, int block2_len,
+ data_t * block3, int block3_len,
+ data_t * block4, int block4_len,
+ data_t * expected_result )
{
const mbedtls_cipher_info_t *cipher_info;
mbedtls_cipher_context_t ctx;
@@ -184,22 +184,22 @@
/* BEGIN_CASE */
void mbedtls_cmac_multiple_operations_same_key( int cipher_type,
- HexParam_t * key, int keybits,
+ data_t * key, int keybits,
int block_size,
- HexParam_t * block_a1,
+ data_t * block_a1,
int block_a1_len,
- HexParam_t * block_a2,
+ data_t * block_a2,
int block_a2_len,
- HexParam_t * block_a3,
+ data_t * block_a3,
int block_a3_len,
- HexParam_t * expected_result_a,
- HexParam_t * block_b1,
+ data_t * expected_result_a,
+ data_t * block_b1,
int block_b1_len,
- HexParam_t * block_b2,
+ data_t * block_b2,
int block_b2_len,
- HexParam_t * block_b3,
+ data_t * block_b3,
int block_b3_len,
- HexParam_t * expected_result_b
+ data_t * expected_result_b
)
{
const mbedtls_cipher_info_t *cipher_info;
diff --git a/tests/suites/test_suite_ctr_drbg.function b/tests/suites/test_suite_ctr_drbg.function
index 619c76e..c8d2aff 100644
--- a/tests/suites/test_suite_ctr_drbg.function
+++ b/tests/suites/test_suite_ctr_drbg.function
@@ -51,9 +51,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void ctr_drbg_validate_pr( HexParam_t * add_init, HexParam_t * entropy,
- HexParam_t * add1, HexParam_t * add2,
- HexParam_t * result_str )
+void ctr_drbg_validate_pr( data_t * add_init, data_t * entropy,
+ data_t * add1, data_t * add2,
+ data_t * result_str )
{
mbedtls_ctr_drbg_context ctx;
unsigned char buf[512];
@@ -75,9 +75,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void ctr_drbg_validate_nopr( HexParam_t * add_init, HexParam_t * entropy,
- HexParam_t * add1, HexParam_t * add_reseed,
- HexParam_t * add2, HexParam_t * result_str )
+void ctr_drbg_validate_nopr( data_t * add_init, data_t * entropy,
+ data_t * add1, data_t * add_reseed,
+ data_t * add2, data_t * result_str )
{
mbedtls_ctr_drbg_context ctx;
unsigned char buf[512];
diff --git a/tests/suites/test_suite_debug.function b/tests/suites/test_suite_debug.function
index f517c8a..377d630 100644
--- a/tests/suites/test_suite_debug.function
+++ b/tests/suites/test_suite_debug.function
@@ -105,7 +105,7 @@
/* BEGIN_CASE */
void mbedtls_debug_print_buf( char * file, int line, char * text,
- HexParam_t * data, char * result_str )
+ data_t * data, char * result_str )
{
mbedtls_ssl_context ssl;
mbedtls_ssl_config conf;
diff --git a/tests/suites/test_suite_des.function b/tests/suites/test_suite_des.function
index 8fab5e4..b5acb7b 100644
--- a/tests/suites/test_suite_des.function
+++ b/tests/suites/test_suite_des.function
@@ -8,15 +8,15 @@
*/
/* BEGIN_CASE */
-void des_check_weak( HexParam_t * key, int ret )
+void des_check_weak( data_t * key, int ret )
{
TEST_ASSERT( mbedtls_des_key_check_weak( key->x ) == ret );
}
/* END_CASE */
/* BEGIN_CASE */
-void des_encrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string )
+void des_encrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_des_context ctx;
@@ -36,8 +36,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void des_decrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string )
+void des_decrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_des_context ctx;
@@ -57,8 +57,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void des_encrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void des_encrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -82,8 +82,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void des_decrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string,
+void des_decrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string,
int cbc_result )
{
unsigned char output[100];
@@ -107,8 +107,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void des3_encrypt_ecb( int key_count, HexParam_t * key_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void des3_encrypt_ecb( int key_count, data_t * key_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_des3_context ctx;
@@ -134,8 +134,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void des3_decrypt_ecb( int key_count, HexParam_t * key_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void des3_decrypt_ecb( int key_count, data_t * key_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_des3_context ctx;
@@ -161,9 +161,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void des3_encrypt_cbc( int key_count, HexParam_t * key_str,
- HexParam_t * iv_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int cbc_result )
+void des3_encrypt_cbc( int key_count, data_t * key_str,
+ data_t * iv_str, data_t * src_str,
+ data_t * hex_dst_string, int cbc_result )
{
unsigned char output[100];
mbedtls_des3_context ctx;
@@ -193,9 +193,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void des3_decrypt_cbc( int key_count, HexParam_t * key_str,
- HexParam_t * iv_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string, int cbc_result )
+void des3_decrypt_cbc( int key_count, data_t * key_str,
+ data_t * iv_str, data_t * src_str,
+ data_t * hex_dst_string, int cbc_result )
{
unsigned char output[100];
mbedtls_des3_context ctx;
diff --git a/tests/suites/test_suite_ecdh.function b/tests/suites/test_suite_ecdh.function
index 2d71828..a2c7ced 100644
--- a/tests/suites/test_suite_ecdh.function
+++ b/tests/suites/test_suite_ecdh.function
@@ -43,8 +43,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void ecdh_primitive_testvec( int id, HexParam_t * rnd_buf_A, char * xA_str,
- char * yA_str, HexParam_t * rnd_buf_B,
+void ecdh_primitive_testvec( int id, data_t * rnd_buf_A, char * xA_str,
+ char * yA_str, data_t * rnd_buf_B,
char * xB_str, char * yB_str, char * z_str )
{
mbedtls_ecp_group grp;
diff --git a/tests/suites/test_suite_ecdsa.function b/tests/suites/test_suite_ecdsa.function
index 65d497d..48ce586 100644
--- a/tests/suites/test_suite_ecdsa.function
+++ b/tests/suites/test_suite_ecdsa.function
@@ -41,8 +41,8 @@
/* BEGIN_CASE */
void ecdsa_prim_test_vectors( int id, char * d_str, char * xQ_str,
- char * yQ_str, HexParam_t * rnd_buf,
- HexParam_t * hash, char * r_str, char * s_str,
+ char * yQ_str, data_t * rnd_buf,
+ data_t * hash, char * r_str, char * s_str,
int result )
{
mbedtls_ecp_group grp;
diff --git a/tests/suites/test_suite_ecjpake.function b/tests/suites/test_suite_ecjpake.function
index 2579704..9e4f7a3 100644
--- a/tests/suites/test_suite_ecjpake.function
+++ b/tests/suites/test_suite_ecjpake.function
@@ -106,7 +106,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C */
-void read_round_one( int role, HexParam_t * msg, int ref_ret )
+void read_round_one( int role, data_t * msg, int ref_ret )
{
mbedtls_ecjpake_context ctx;
const unsigned char * pw = NULL;
@@ -125,7 +125,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C */
-void read_round_two_cli( HexParam_t * msg, int ref_ret )
+void read_round_two_cli( data_t * msg, int ref_ret )
{
mbedtls_ecjpake_context ctx;
const unsigned char * pw = NULL;
@@ -150,7 +150,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED:MBEDTLS_SHA256_C */
-void read_round_two_srv( HexParam_t * msg, int ref_ret )
+void read_round_two_srv( data_t * msg, int ref_ret )
{
mbedtls_ecjpake_context ctx;
const unsigned char * pw = NULL;
diff --git a/tests/suites/test_suite_ecp.function b/tests/suites/test_suite_ecp.function
index d5a0926..d79a6b3 100644
--- a/tests/suites/test_suite_ecp.function
+++ b/tests/suites/test_suite_ecp.function
@@ -193,7 +193,7 @@
/* BEGIN_CASE */
void ecp_write_binary( int id, char * x, char * y, char * z, int format,
- HexParam_t * out, int blen, int ret )
+ data_t * out, int blen, int ret )
{
mbedtls_ecp_group grp;
mbedtls_ecp_point P;
@@ -224,7 +224,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void ecp_read_binary( int id, HexParam_t * buf, char * x, char * y, char * z,
+void ecp_read_binary( int id, data_t * buf, char * x, char * y, char * z,
int ret )
{
mbedtls_ecp_group grp;
@@ -257,7 +257,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_ecp_tls_read_point( int id, HexParam_t * buf, char * x, char * y,
+void mbedtls_ecp_tls_read_point( int id, data_t * buf, char * x, char * y,
char * z, int ret )
{
mbedtls_ecp_group grp;
@@ -344,7 +344,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_ecp_tls_read_group( HexParam_t * buf, int result, int bits,
+void mbedtls_ecp_tls_read_group( data_t * buf, int result, int bits,
int record_len )
{
mbedtls_ecp_group grp;
diff --git a/tests/suites/test_suite_entropy.function b/tests/suites/test_suite_entropy.function
index 9b54f30..26a0f59 100644
--- a/tests/suites/test_suite_entropy.function
+++ b/tests/suites/test_suite_entropy.function
@@ -302,7 +302,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_NV_SEED:MBEDTLS_PLATFORM_NV_SEED_ALT:MBEDTLS_ENTROPY_SHA512_ACCUMULATOR */
-void entropy_nv_seed( HexParam_t * read_seed )
+void entropy_nv_seed( data_t * read_seed )
{
mbedtls_sha512_context accumulator;
mbedtls_entropy_context ctx;
diff --git a/tests/suites/test_suite_gcm.function b/tests/suites/test_suite_gcm.function
index b3d212a..4d3bba1 100644
--- a/tests/suites/test_suite_gcm.function
+++ b/tests/suites/test_suite_gcm.function
@@ -9,8 +9,8 @@
/* BEGIN_CASE */
void gcm_bad_parameters( int cipher_id, int direction,
- HexParam_t *key_str, HexParam_t *src_str,
- HexParam_t *iv_str, HexParam_t *add_str,
+ data_t *key_str, data_t *src_str,
+ data_t *iv_str, data_t *add_str,
int tag_len_bits, int gcm_result )
{
unsigned char output[128];
@@ -33,10 +33,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void gcm_encrypt_and_tag( int cipher_id, HexParam_t * key_str,
- HexParam_t * src_str, HexParam_t * iv_str,
- HexParam_t * add_str, HexParam_t * hex_dst_string,
- int tag_len_bits, HexParam_t * hex_tag_string,
+void gcm_encrypt_and_tag( int cipher_id, data_t * key_str,
+ data_t * src_str, data_t * iv_str,
+ data_t * add_str, data_t * hex_dst_string,
+ int tag_len_bits, data_t * hex_tag_string,
int init_result )
{
unsigned char output[128];
@@ -65,11 +65,11 @@
/* END_CASE */
/* BEGIN_CASE */
-void gcm_decrypt_and_verify( int cipher_id, HexParam_t * key_str,
- HexParam_t * src_str, HexParam_t * iv_str,
- HexParam_t * add_str, int tag_len_bits,
- HexParam_t * tag_str, char * result,
- HexParam_t * pt_result, int init_result )
+void gcm_decrypt_and_verify( int cipher_id, data_t * key_str,
+ data_t * src_str, data_t * iv_str,
+ data_t * add_str, int tag_len_bits,
+ data_t * tag_str, char * result,
+ data_t * pt_result, int init_result )
{
unsigned char output[128];
mbedtls_gcm_context ctx;
diff --git a/tests/suites/test_suite_hmac_drbg.function b/tests/suites/test_suite_hmac_drbg.function
index aeea62c..13bc400 100644
--- a/tests/suites/test_suite_hmac_drbg.function
+++ b/tests/suites/test_suite_hmac_drbg.function
@@ -161,9 +161,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void hmac_drbg_no_reseed( int md_alg, HexParam_t * entropy,
- HexParam_t * custom, HexParam_t * add1,
- HexParam_t * add2, HexParam_t * output )
+void hmac_drbg_no_reseed( int md_alg, data_t * entropy,
+ data_t * custom, data_t * add1,
+ data_t * add2, data_t * output )
{
unsigned char data[1024];
unsigned char my_output[512];
@@ -209,9 +209,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void hmac_drbg_nopr( int md_alg, HexParam_t * entropy, HexParam_t * custom,
- HexParam_t * add1, HexParam_t * add2, HexParam_t * add3,
- HexParam_t * output )
+void hmac_drbg_nopr( int md_alg, data_t * entropy, data_t * custom,
+ data_t * add1, data_t * add2, data_t * add3,
+ data_t * output )
{
unsigned char my_output[512];
entropy_ctx p_entropy;
@@ -242,8 +242,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void hmac_drbg_pr( int md_alg, HexParam_t * entropy, HexParam_t * custom,
- HexParam_t * add1, HexParam_t * add2, HexParam_t * output )
+void hmac_drbg_pr( int md_alg, data_t * entropy, data_t * custom,
+ data_t * add1, data_t * add2, data_t * output )
{
unsigned char my_output[512];
entropy_ctx p_entropy;
diff --git a/tests/suites/test_suite_md.function b/tests/suites/test_suite_md.function
index 07e2d58..11cf88a 100644
--- a/tests/suites/test_suite_md.function
+++ b/tests/suites/test_suite_md.function
@@ -127,7 +127,7 @@
/* BEGIN_CASE */
void md_text( char * text_md_name, char * text_src_string,
- HexParam_t * hex_hash_string )
+ data_t * hex_hash_string )
{
char md_name[100];
unsigned char src_str[1000];
@@ -150,8 +150,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void md_hex( char * text_md_name, HexParam_t * src_str,
- HexParam_t * hex_hash_string )
+void md_hex( char * text_md_name, data_t * src_str,
+ data_t * hex_hash_string )
{
char md_name[100];
unsigned char output[100];
@@ -174,7 +174,7 @@
/* BEGIN_CASE */
void md_text_multi( char * text_md_name, char * text_src_string,
- HexParam_t * hex_hash_string )
+ data_t * hex_hash_string )
{
char md_name[100];
unsigned char src_str[1000];
@@ -225,8 +225,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void md_hex_multi( char * text_md_name, HexParam_t * src_str,
- HexParam_t * hex_hash_string )
+void md_hex_multi( char * text_md_name, data_t * src_str,
+ data_t * hex_hash_string )
{
char md_name[100];
unsigned char output[100];
@@ -272,8 +272,8 @@
/* BEGIN_CASE */
void mbedtls_md_hmac( char * text_md_name, int trunc_size,
- HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_hash_string )
+ data_t * key_str, data_t * src_str,
+ data_t * hex_hash_string )
{
char md_name[100];
unsigned char output[100];
@@ -294,8 +294,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void md_hmac_multi( char * text_md_name, int trunc_size, HexParam_t * key_str,
- HexParam_t * src_str, HexParam_t * hex_hash_string )
+void md_hmac_multi( char * text_md_name, int trunc_size, data_t * key_str,
+ data_t * src_str, data_t * hex_hash_string )
{
char md_name[100];
unsigned char output[100];
@@ -340,7 +340,7 @@
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO */
void mbedtls_md_file( char * text_md_name, char * filename,
- HexParam_t * hex_hash_string )
+ data_t * hex_hash_string )
{
char md_name[100];
unsigned char output[100];
diff --git a/tests/suites/test_suite_mdx.function b/tests/suites/test_suite_mdx.function
index ddfe369..02004ef 100644
--- a/tests/suites/test_suite_mdx.function
+++ b/tests/suites/test_suite_mdx.function
@@ -6,7 +6,7 @@
/* END_HEADER */
/* BEGIN_CASE depends_on:MBEDTLS_MD2_C */
-void md2_text( char * text_src_string, HexParam_t * hex_hash_string )
+void md2_text( char * text_src_string, data_t * hex_hash_string )
{
int ret;
unsigned char src_str[100];
@@ -25,7 +25,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_MD4_C */
-void md4_text( char * text_src_string, HexParam_t * hex_hash_string )
+void md4_text( char * text_src_string, data_t * hex_hash_string )
{
int ret;
unsigned char src_str[100];
@@ -44,7 +44,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_MD5_C */
-void md5_text( char * text_src_string, HexParam_t * hex_hash_string )
+void md5_text( char * text_src_string, data_t * hex_hash_string )
{
int ret;
unsigned char src_str[100];
@@ -63,7 +63,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RIPEMD160_C */
-void ripemd160_text( char * text_src_string, HexParam_t * hex_hash_string )
+void ripemd160_text( char * text_src_string, data_t * hex_hash_string )
{
int ret;
unsigned char src_str[100];
diff --git a/tests/suites/test_suite_mpi.function b/tests/suites/test_suite_mpi.function
index 4b7a048..4754c6e 100644
--- a/tests/suites/test_suite_mpi.function
+++ b/tests/suites/test_suite_mpi.function
@@ -53,7 +53,7 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_mpi_read_binary( HexParam_t * buf, int radix_A, char * input_A )
+void mbedtls_mpi_read_binary( data_t * buf, int radix_A, char * input_A )
{
mbedtls_mpi X;
unsigned char str[1000];
@@ -73,7 +73,7 @@
/* BEGIN_CASE */
void mbedtls_mpi_write_binary( int radix_X, char * input_X,
- HexParam_t * input_A, int output_size,
+ data_t * input_A, int output_size,
int result )
{
mbedtls_mpi X;
@@ -104,7 +104,7 @@
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO */
void mbedtls_mpi_read_file( int radix_X, char * input_file,
- HexParam_t * input_A, int result )
+ data_t * input_A, int result )
{
mbedtls_mpi X;
unsigned char buf[1000];
diff --git a/tests/suites/test_suite_pem.function b/tests/suites/test_suite_pem.function
index dcd53d6..947f1fb 100644
--- a/tests/suites/test_suite_pem.function
+++ b/tests/suites/test_suite_pem.function
@@ -6,7 +6,7 @@
/* END_HEADER */
/* BEGIN_CASE depends_on:MBEDTLS_PEM_WRITE_C */
-void mbedtls_pem_write_buffer( char * start, char * end, HexParam_t * buf,
+void mbedtls_pem_write_buffer( char * start, char * end, data_t * buf,
char * result_str )
{
unsigned char *check_buf = NULL;
diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function
index 23e3a69..9005ddb 100644
--- a/tests/suites/test_suite_pk.function
+++ b/tests/suites/test_suite_pk.function
@@ -121,9 +121,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */
-void pk_rsa_verify_test_vec( HexParam_t * message_str, int digest, int mod,
+void pk_rsa_verify_test_vec( data_t * message_str, int digest, int mod,
int radix_N, char * input_N, int radix_E,
- char * input_E, HexParam_t * result_str,
+ char * input_E, data_t * result_str,
int result )
{
unsigned char hash_result[1000];
@@ -154,10 +154,10 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */
-void pk_rsa_verify_ext_test_vec( HexParam_t * message_str, int digest,
+void pk_rsa_verify_ext_test_vec( data_t * message_str, int digest,
int mod, int radix_N, char * input_N,
int radix_E, char * input_E,
- HexParam_t * result_str, int pk_type,
+ data_t * result_str, int pk_type,
int mgf1_hash_id, int salt_len, int result )
{
unsigned char hash_result[1000];
@@ -213,8 +213,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ECDSA_C */
-void pk_ec_test_vec( int type, int id, HexParam_t * key, HexParam_t * hash,
- HexParam_t * sig, int ret )
+void pk_ec_test_vec( int type, int id, data_t * key, data_t * hash,
+ data_t * sig, int ret )
{
mbedtls_pk_context pk;
mbedtls_ecp_keypair *eckey;
@@ -266,9 +266,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */
-void pk_rsa_encrypt_test_vec( HexParam_t * message, int mod, int radix_N,
+void pk_rsa_encrypt_test_vec( data_t * message, int mod, int radix_N,
char * input_N, int radix_E, char * input_E,
- HexParam_t * result, int ret )
+ data_t * result, int ret )
{
unsigned char output[1000];
rnd_pseudo_info rnd_info;
@@ -300,10 +300,10 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */
-void pk_rsa_decrypt_test_vec( HexParam_t * cipher, int mod, int radix_P,
+void pk_rsa_decrypt_test_vec( data_t * cipher, int mod, int radix_P,
char * input_P, int radix_Q, char * input_Q,
int radix_N, char * input_N, int radix_E,
- char * input_E, HexParam_t * clear, int ret )
+ char * input_E, data_t * clear, int ret )
{
unsigned char output[1000];
rnd_pseudo_info rnd_info;
diff --git a/tests/suites/test_suite_pkcs1_v15.function b/tests/suites/test_suite_pkcs1_v15.function
index 9cf3b19..83f417c 100644
--- a/tests/suites/test_suite_pkcs1_v15.function
+++ b/tests/suites/test_suite_pkcs1_v15.function
@@ -11,8 +11,8 @@
/* BEGIN_CASE */
void pkcs1_rsaes_v15_encrypt( int mod, int radix_N, char * input_N,
int radix_E, char * input_E, int hash,
- HexParam_t * message_str, HexParam_t * rnd_buf,
- HexParam_t * result_hex_str, int result )
+ data_t * message_str, data_t * rnd_buf,
+ data_t * result_hex_str, int result )
{
unsigned char output[1000];
mbedtls_rsa_context ctx;
@@ -50,8 +50,8 @@
void pkcs1_rsaes_v15_decrypt( int mod, int radix_P, char * input_P,
int radix_Q, char * input_Q, int radix_N,
char * input_N, int radix_E, char * input_E,
- int hash, HexParam_t * result_hex_str,
- char * seed, HexParam_t * message_str,
+ int hash, data_t * result_hex_str,
+ char * seed, data_t * message_str,
int result )
{
unsigned char output[1000];
@@ -97,8 +97,8 @@
void pkcs1_rsassa_v15_sign( int mod, int radix_P, char * input_P, int radix_Q,
char * input_Q, int radix_N, char * input_N,
int radix_E, char * input_E, int digest, int hash,
- HexParam_t * message_str, HexParam_t * rnd_buf,
- HexParam_t * result_hex_str, int result )
+ data_t * message_str, data_t * rnd_buf,
+ data_t * result_hex_str, int result )
{
unsigned char hash_result[1000];
unsigned char output[1000];
@@ -147,8 +147,8 @@
/* BEGIN_CASE */
void pkcs1_rsassa_v15_verify( int mod, int radix_N, char * input_N,
int radix_E, char * input_E, int digest,
- int hash, HexParam_t * message_str, char * salt,
- HexParam_t * result_str, int result )
+ int hash, data_t * message_str, char * salt,
+ data_t * result_str, int result )
{
unsigned char hash_result[1000];
mbedtls_rsa_context ctx;
diff --git a/tests/suites/test_suite_pkcs1_v21.function b/tests/suites/test_suite_pkcs1_v21.function
index dd40886..99be08a 100644
--- a/tests/suites/test_suite_pkcs1_v21.function
+++ b/tests/suites/test_suite_pkcs1_v21.function
@@ -11,8 +11,8 @@
/* BEGIN_CASE */
void pkcs1_rsaes_oaep_encrypt( int mod, int radix_N, char * input_N,
int radix_E, char * input_E, int hash,
- HexParam_t * message_str, HexParam_t * rnd_buf,
- HexParam_t * result_hex_str, int result )
+ data_t * message_str, data_t * rnd_buf,
+ data_t * result_hex_str, int result )
{
unsigned char output[1000];
mbedtls_rsa_context ctx;
@@ -50,8 +50,8 @@
void pkcs1_rsaes_oaep_decrypt( int mod, int radix_P, char * input_P,
int radix_Q, char * input_Q, int radix_N,
char * input_N, int radix_E, char * input_E,
- int hash, HexParam_t * result_hex_str,
- char * seed, HexParam_t * message_str,
+ int hash, data_t * result_hex_str,
+ char * seed, data_t * message_str,
int result )
{
unsigned char output[1000];
@@ -98,8 +98,8 @@
void pkcs1_rsassa_pss_sign( int mod, int radix_P, char * input_P, int radix_Q,
char * input_Q, int radix_N, char * input_N,
int radix_E, char * input_E, int digest, int hash,
- HexParam_t * message_str, HexParam_t * rnd_buf,
- HexParam_t * result_hex_str, int result )
+ data_t * message_str, data_t * rnd_buf,
+ data_t * result_hex_str, int result )
{
unsigned char hash_result[1000];
unsigned char output[1000];
@@ -149,8 +149,8 @@
/* BEGIN_CASE */
void pkcs1_rsassa_pss_verify( int mod, int radix_N, char * input_N,
int radix_E, char * input_E, int digest,
- int hash, HexParam_t * message_str, char * salt,
- HexParam_t * result_str, int result )
+ int hash, data_t * message_str, char * salt,
+ data_t * result_str, int result )
{
unsigned char hash_result[1000];
mbedtls_rsa_context ctx;
@@ -185,8 +185,8 @@
int radix_E, char * input_E,
int msg_digest_id, int ctx_hash,
int mgf_hash, int salt_len,
- HexParam_t * message_str,
- HexParam_t * result_str, int result_simple,
+ data_t * message_str,
+ data_t * result_str, int result_simple,
int result_full )
{
unsigned char hash_result[1000];
diff --git a/tests/suites/test_suite_pkcs5.function b/tests/suites/test_suite_pkcs5.function
index 0dcbb0a..26f1d33 100644
--- a/tests/suites/test_suite_pkcs5.function
+++ b/tests/suites/test_suite_pkcs5.function
@@ -8,8 +8,8 @@
*/
/* BEGIN_CASE */
-void pbkdf2_hmac( int hash, HexParam_t * pw_str, HexParam_t * salt_str,
- int it_cnt, int key_len, HexParam_t * result_key_string )
+void pbkdf2_hmac( int hash, data_t * pw_str, data_t * salt_str,
+ int it_cnt, int key_len, data_t * result_key_string )
{
mbedtls_md_context_t ctx;
const mbedtls_md_info_t *info;
@@ -32,8 +32,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ASN1_PARSE_C */
-void mbedtls_pkcs5_pbes2( int params_tag, HexParam_t *params_hex, HexParam_t *pw,
- HexParam_t *data, int ref_ret, HexParam_t *ref_out )
+void mbedtls_pkcs5_pbes2( int params_tag, data_t *params_hex, data_t *pw,
+ data_t *data, int ref_ret, data_t *ref_out )
{
int my_ret;
mbedtls_asn1_buf params;
diff --git a/tests/suites/test_suite_pkparse.function b/tests/suites/test_suite_pkparse.function
index 920f936..3eb0397 100644
--- a/tests/suites/test_suite_pkparse.function
+++ b/tests/suites/test_suite_pkparse.function
@@ -114,7 +114,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_RSA_C */
-void pk_parse_key( HexParam_t * buf, char * result_str, int result )
+void pk_parse_key( data_t * buf, char * result_str, int result )
{
mbedtls_pk_context pk;
unsigned char output[2000];
diff --git a/tests/suites/test_suite_rsa.function b/tests/suites/test_suite_rsa.function
index 83f7353..c43ef20 100644
--- a/tests/suites/test_suite_rsa.function
+++ b/tests/suites/test_suite_rsa.function
@@ -18,11 +18,11 @@
*/
/* BEGIN_CASE */
-void mbedtls_rsa_pkcs1_sign( HexParam_t * message_str, int padding_mode,
+void mbedtls_rsa_pkcs1_sign( data_t * message_str, int padding_mode,
int digest, int mod, int radix_P, char * input_P,
int radix_Q, char * input_Q, int radix_N,
char * input_N, int radix_E, char * input_E,
- HexParam_t * result_hex_str, int result )
+ data_t * result_hex_str, int result )
{
unsigned char hash_result[1000];
unsigned char output[1000];
@@ -69,10 +69,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_rsa_pkcs1_verify( HexParam_t * message_str, int padding_mode,
+void mbedtls_rsa_pkcs1_verify( data_t * message_str, int padding_mode,
int digest, int mod, int radix_N,
char * input_N, int radix_E, char * input_E,
- HexParam_t * result_str, int result )
+ data_t * result_str, int result )
{
unsigned char hash_result[1000];
mbedtls_rsa_context ctx;
@@ -103,11 +103,11 @@
/* BEGIN_CASE */
-void rsa_pkcs1_sign_raw( HexParam_t * hash_result,
+void rsa_pkcs1_sign_raw( data_t * hash_result,
int padding_mode, int mod, int radix_P,
char * input_P, int radix_Q, char * input_Q,
int radix_N, char * input_N, int radix_E,
- char * input_E, HexParam_t * result_hex_str )
+ char * input_E, data_t * result_hex_str )
{
unsigned char output[1000];
mbedtls_rsa_context ctx;
@@ -174,10 +174,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void rsa_pkcs1_verify_raw( HexParam_t * hash_result,
+void rsa_pkcs1_verify_raw( data_t * hash_result,
int padding_mode, int mod, int radix_N,
char * input_N, int radix_E, char * input_E,
- HexParam_t * result_str, int correct )
+ data_t * result_str, int correct )
{
unsigned char output[1000];
mbedtls_rsa_context ctx;
@@ -235,10 +235,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_rsa_pkcs1_encrypt( HexParam_t * message_str, int padding_mode,
+void mbedtls_rsa_pkcs1_encrypt( data_t * message_str, int padding_mode,
int mod, int radix_N, char * input_N,
int radix_E, char * input_E,
- HexParam_t * result_hex_str, int result )
+ data_t * result_hex_str, int result )
{
unsigned char output[1000];
mbedtls_rsa_context ctx;
@@ -276,10 +276,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void rsa_pkcs1_encrypt_bad_rng( HexParam_t * message_str, int padding_mode,
+void rsa_pkcs1_encrypt_bad_rng( data_t * message_str, int padding_mode,
int mod, int radix_N, char * input_N,
int radix_E, char * input_E,
- HexParam_t * result_hex_str, int result )
+ data_t * result_hex_str, int result )
{
unsigned char output[1000];
mbedtls_rsa_context ctx;
@@ -314,11 +314,11 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_rsa_pkcs1_decrypt( HexParam_t * message_str, int padding_mode,
+void mbedtls_rsa_pkcs1_decrypt( data_t * message_str, int padding_mode,
int mod, int radix_P, char * input_P,
int radix_Q, char * input_Q, int radix_N,
char * input_N, int radix_E, char * input_E,
- int max_output, HexParam_t * result_hex_str,
+ int max_output, data_t * result_hex_str,
int result )
{
unsigned char output[1000];
@@ -363,9 +363,9 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_rsa_public( HexParam_t * message_str, int mod, int radix_N,
+void mbedtls_rsa_public( data_t * message_str, int mod, int radix_N,
char * input_N, int radix_E, char * input_E,
- HexParam_t * result_hex_str, int result )
+ data_t * result_hex_str, int result )
{
unsigned char output[1000];
mbedtls_rsa_context ctx, ctx2; /* Also test mbedtls_rsa_copy() while at it */
@@ -415,10 +415,10 @@
/* END_CASE */
/* BEGIN_CASE */
-void mbedtls_rsa_private( HexParam_t * message_str, int mod, int radix_P,
+void mbedtls_rsa_private( data_t * message_str, int mod, int radix_P,
char * input_P, int radix_Q, char * input_Q,
int radix_N, char * input_N, int radix_E,
- char * input_E, HexParam_t * result_hex_str,
+ char * input_E, data_t * result_hex_str,
int result )
{
unsigned char output[1000];
@@ -1123,9 +1123,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CTR_DRBG_C:MBEDTLS_ENTROPY_C */
-void mbedtls_rsa_export_raw( HexParam_t *input_N, HexParam_t *input_P,
- HexParam_t *input_Q, HexParam_t *input_D,
- HexParam_t *input_E, int is_priv,
+void mbedtls_rsa_export_raw( data_t *input_N, data_t *input_P,
+ data_t *input_Q, data_t *input_D,
+ data_t *input_E, int is_priv,
int successive )
{
/* Exported buffers */
@@ -1218,9 +1218,9 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CTR_DRBG_C:MBEDTLS_ENTROPY_C:ENTROPY_HAVE_STRONG */
-void mbedtls_rsa_import_raw( HexParam_t *input_N,
- HexParam_t *input_P, HexParam_t *input_Q,
- HexParam_t *input_D, HexParam_t *input_E,
+void mbedtls_rsa_import_raw( data_t *input_N,
+ data_t *input_P, data_t *input_Q,
+ data_t *input_D, data_t *input_E,
int successive,
int is_priv,
int res_check,
diff --git a/tests/suites/test_suite_shax.function b/tests/suites/test_suite_shax.function
index 186fb87..147ae0e 100644
--- a/tests/suites/test_suite_shax.function
+++ b/tests/suites/test_suite_shax.function
@@ -5,7 +5,7 @@
/* END_HEADER */
/* BEGIN_CASE depends_on:MBEDTLS_SHA1_C */
-void mbedtls_sha1( HexParam_t * src_str, HexParam_t * hex_hash_string )
+void mbedtls_sha1( data_t * src_str, data_t * hex_hash_string )
{
unsigned char output[41];
@@ -19,7 +19,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_SHA256_C */
-void sha224( HexParam_t * src_str, HexParam_t * hex_hash_string )
+void sha224( data_t * src_str, data_t * hex_hash_string )
{
unsigned char output[57];
@@ -33,7 +33,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_SHA256_C */
-void mbedtls_sha256( HexParam_t * src_str, HexParam_t * hex_hash_string )
+void mbedtls_sha256( data_t * src_str, data_t * hex_hash_string )
{
unsigned char output[65];
@@ -47,7 +47,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_SHA512_C */
-void sha384( HexParam_t * src_str, HexParam_t * hex_hash_string )
+void sha384( data_t * src_str, data_t * hex_hash_string )
{
unsigned char output[97];
@@ -61,7 +61,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_SHA512_C */
-void mbedtls_sha512( HexParam_t * src_str, HexParam_t * hex_hash_string )
+void mbedtls_sha512( data_t * src_str, data_t * hex_hash_string )
{
unsigned char output[129];
diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function
index eed5183..326f22d 100644
--- a/tests/suites/test_suite_ssl.function
+++ b/tests/suites/test_suite_ssl.function
@@ -9,7 +9,7 @@
*/
/* BEGIN_CASE depends_on:MBEDTLS_SSL_DTLS_ANTI_REPLAY */
-void ssl_dtls_replay( HexParam_t * prevs, HexParam_t * new, int ret )
+void ssl_dtls_replay( data_t * prevs, data_t * new, int ret )
{
uint32_t len = 0;
mbedtls_ssl_context ssl;
diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function
index 2e28308..df95f63 100644
--- a/tests/suites/test_suite_x509parse.function
+++ b/tests/suites/test_suite_x509parse.function
@@ -440,7 +440,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C */
-void x509parse_crt( HexParam_t * buf, char * result_str, int result )
+void x509parse_crt( data_t * buf, char * result_str, int result )
{
mbedtls_x509_crt crt;
unsigned char output[2000];
@@ -467,7 +467,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_CRL_PARSE_C */
-void x509parse_crl( HexParam_t * buf, char * result_str, int result )
+void x509parse_crl( data_t * buf, char * result_str, int result )
{
mbedtls_x509_crl crl;
unsigned char output[2000];
@@ -494,7 +494,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_CSR_PARSE_C */
-void mbedtls_x509_csr_parse( HexParam_t * csr_der, char * ref_out, int ref_ret )
+void mbedtls_x509_csr_parse( data_t * csr_der, char * ref_out, int ref_ret )
{
mbedtls_x509_csr csr;
char my_out[1000];
@@ -621,7 +621,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_USE_C */
-void x509_oid_desc( HexParam_t * buf, char * ref_desc )
+void x509_oid_desc( data_t * buf, char * ref_desc )
{
mbedtls_x509_buf oid;
const char *desc = NULL;
@@ -649,7 +649,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_USE_C */
-void x509_oid_numstr( HexParam_t * oid_buf, char * numstr, int blen, int ret )
+void x509_oid_numstr( data_t * oid_buf, char * numstr, int blen, int ret )
{
mbedtls_x509_buf oid;
char num_buf[100];
@@ -689,7 +689,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO:MBEDTLS_X509_CRT_PARSE_C:MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */
-void x509_check_extended_key_usage( char * crt_file, HexParam_t * oid, int ret
+void x509_check_extended_key_usage( char * crt_file, data_t * oid, int ret
)
{
mbedtls_x509_crt crt;
@@ -737,7 +737,7 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C:MBEDTLS_X509_RSASSA_PSS_SUPPORT */
-void x509_parse_rsassa_pss_params( HexParam_t * hex_params, int params_tag,
+void x509_parse_rsassa_pss_params( data_t * hex_params, int params_tag,
int ref_msg_md, int ref_mgf_md,
int ref_salt_len, int ref_ret )
{
diff --git a/tests/suites/test_suite_xtea.function b/tests/suites/test_suite_xtea.function
index 94c6ff5..a24a420 100644
--- a/tests/suites/test_suite_xtea.function
+++ b/tests/suites/test_suite_xtea.function
@@ -8,8 +8,8 @@
*/
/* BEGIN_CASE */
-void xtea_encrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string )
+void xtea_encrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_xtea_context ctx;
@@ -25,8 +25,8 @@
/* END_CASE */
/* BEGIN_CASE */
-void xtea_decrypt_ecb( HexParam_t * key_str, HexParam_t * src_str,
- HexParam_t * hex_dst_string )
+void xtea_decrypt_ecb( data_t * key_str, data_t * src_str,
+ data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_xtea_context ctx;
@@ -42,8 +42,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void xtea_encrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void xtea_encrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_xtea_context ctx;
@@ -60,8 +60,8 @@
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_CIPHER_MODE_CBC */
-void xtea_decrypt_cbc( HexParam_t * key_str, HexParam_t * iv_str,
- HexParam_t * src_str, HexParam_t * hex_dst_string )
+void xtea_decrypt_cbc( data_t * key_str, data_t * iv_str,
+ data_t * src_str, data_t * hex_dst_string )
{
unsigned char output[100];
mbedtls_xtea_context ctx;