Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Cosgrove <[email protected]>
  • Loading branch information
tom-cosgrove-arm committed Sep 4, 2023
1 parent ba3b14d commit a240fe3
Show file tree
Hide file tree
Showing 18 changed files with 108 additions and 108 deletions.
16 changes: 8 additions & 8 deletions tests/suites/test_suite_aria.function
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void aria_encrypt_ecb(data_t *key_str, data_t *src_str,
}

TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);
}

exit:
Expand Down Expand Up @@ -253,7 +253,7 @@ void aria_decrypt_ecb(data_t *key_str, data_t *src_str,
}

TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);
}

exit:
Expand All @@ -278,7 +278,7 @@ void aria_encrypt_cbc(data_t *key_str, data_t *iv_str,
output) == cbc_result);
if (cbc_result == 0) {
TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);
}

exit:
Expand All @@ -303,7 +303,7 @@ void aria_decrypt_cbc(data_t *key_str, data_t *iv_str,
output) == cbc_result);
if (cbc_result == 0) {
TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);
}

exit:
Expand All @@ -330,7 +330,7 @@ void aria_encrypt_cfb128(data_t *key_str, data_t *iv_str,
== result);

TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);

exit:
mbedtls_aria_free(&ctx);
Expand All @@ -356,7 +356,7 @@ void aria_decrypt_cfb128(data_t *key_str, data_t *iv_str,
== result);

TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);

exit:
mbedtls_aria_free(&ctx);
Expand All @@ -382,7 +382,7 @@ void aria_encrypt_ctr(data_t *key_str, data_t *iv_str,
== result);

TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);

exit:
mbedtls_aria_free(&ctx);
Expand All @@ -408,7 +408,7 @@ void aria_decrypt_ctr(data_t *key_str, data_t *iv_str,
== result);

TEST_MEMORY_COMPARE(output, expected_output->len,
expected_output->x, expected_output->len);
expected_output->x, expected_output->len);

exit:
mbedtls_aria_free(&ctx);
Expand Down
8 changes: 4 additions & 4 deletions tests/suites/test_suite_asn1write.function
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int generic_write_finish_step(generic_write_data_t *data,
TEST_ASSERT(data->p >= data->start);
TEST_ASSERT(data->p <= data->end);
TEST_MEMORY_COMPARE(data->p, (size_t) (data->end - data->p),
expected->x, expected->len);
expected->x, expected->len);
}
ok = 1;

Expand Down Expand Up @@ -441,7 +441,7 @@ void test_asn1_write_bitstrings(data_t *bitstring, int bits,
TEST_EQUAL(mbedtls_asn1_get_bitstring(&data.p, data.end,
&read), 0);
TEST_MEMORY_COMPARE(read.p, read.len,
masked_bitstring, byte_length);
masked_bitstring, byte_length);
TEST_EQUAL(read.unused_bits, 8 * byte_length - value_bits);
}
#endif /* MBEDTLS_ASN1_PARSE_C */
Expand Down Expand Up @@ -546,7 +546,7 @@ void store_named_data_val_found(int old_len, int new_len)

if (new_val != NULL) {
TEST_MEMORY_COMPARE(found->val.p, found->val.len,
new_val, (size_t) new_len);
new_val, (size_t) new_len);
}
if (new_len == 0) {
TEST_ASSERT(found->val.p == NULL);
Expand Down Expand Up @@ -588,7 +588,7 @@ void store_named_data_val_new(int new_len, int set_new_val)
} else {
TEST_ASSERT(found->val.p != new_val);
TEST_MEMORY_COMPARE(found->val.p, found->val.len,
new_val, (size_t) new_len);
new_val, (size_t) new_len);
}

exit:
Expand Down
6 changes: 3 additions & 3 deletions tests/suites/test_suite_chacha20.function
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void chacha20_crypt(data_t *key_str,
output) == 0);

TEST_MEMORY_COMPARE(output, expected_output_str->len,
expected_output_str->x, expected_output_str->len);
expected_output_str->x, expected_output_str->len);

/*
* Test the streaming API
Expand All @@ -45,7 +45,7 @@ void chacha20_crypt(data_t *key_str,
TEST_ASSERT(mbedtls_chacha20_update(&ctx, src_str->len, src_str->x, output) == 0);

TEST_MEMORY_COMPARE(output, expected_output_str->len,
expected_output_str->x, expected_output_str->len);
expected_output_str->x, expected_output_str->len);

/*
* Test the streaming API again, piecewise
Expand All @@ -61,7 +61,7 @@ void chacha20_crypt(data_t *key_str,
src_str->x + 1, output + 1) == 0);

TEST_MEMORY_COMPARE(output, expected_output_str->len,
expected_output_str->x, expected_output_str->len);
expected_output_str->x, expected_output_str->len);

mbedtls_chacha20_free(&ctx);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/suites/test_suite_ecp.function
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ void ecp_muladd(int id,
TEST_ASSERT(len <= MBEDTLS_ECP_MAX_PT_LEN);

TEST_MEMORY_COMPARE(expected_result->x, expected_result->len,
actual_result, len);
actual_result, len);

exit:
mbedtls_ecp_group_free(&grp);
Expand Down Expand Up @@ -1357,7 +1357,7 @@ void mbedtls_ecp_read_key(int grp_id, data_t *in_key, int expected, int canonica
TEST_ASSERT(ret == 0);

TEST_MEMORY_COMPARE(in_key->x, in_key->len,
buf, in_key->len);
buf, in_key->len);
} else {
unsigned char export1[MBEDTLS_ECP_MAX_BYTES];
unsigned char export2[MBEDTLS_ECP_MAX_BYTES];
Expand All @@ -1372,7 +1372,7 @@ void mbedtls_ecp_read_key(int grp_id, data_t *in_key, int expected, int canonica
TEST_ASSERT(ret == 0);

TEST_MEMORY_COMPARE(export1, in_key->len,
export2, in_key->len);
export2, in_key->len);
}
}

Expand Down Expand Up @@ -1449,7 +1449,7 @@ void genkey_mx_known_answer(int bits, data_t *seed, data_t *expected)
* - Other bits must be random (by testing with different RNG outputs,
* we validate that those bits are indeed influenced by the RNG). */
TEST_MEMORY_COMPARE(expected->x, expected->len,
actual, expected->len);
actual, expected->len);
}

exit:
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/test_suite_hkdf.function
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void test_hkdf(int md_alg, data_t *ikm, data_t *salt, data_t *info,
TEST_ASSERT(ret == 0);

TEST_MEMORY_COMPARE(okm, expected_okm->len,
expected_okm->x, expected_okm->len);
expected_okm->x, expected_okm->len);
}
/* END_CASE */

Expand Down
4 changes: 2 additions & 2 deletions tests/suites/test_suite_mps.function
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ void mbedtls_mps_reader_reclaim_data_left(int option)
TEST_ASSERT(mbedtls_mps_reader_get(&rd, sizeof(buf) / 2,
&tmp, NULL) == 0);
TEST_MEMORY_COMPARE(tmp, sizeof(buf) / 2,
buf + sizeof(buf) / 2,
sizeof(buf) / 2);
buf + sizeof(buf) / 2,
sizeof(buf) / 2);
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/test_suite_pkcs12.function
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void pkcs12_derive_key(int md_type, int key_size_arg,

if (expected_status == 0) {
TEST_MEMORY_COMPARE(expected_output->x, expected_output->len,
output_data, key_size);
output_data, key_size);
}

exit:
Expand Down
4 changes: 2 additions & 2 deletions tests/suites/test_suite_pkwrite.function
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void pk_write_public_from_private(char *priv_key_file, char *pub_key_file)
derived_key_len), pub_key_len);

TEST_MEMORY_COMPARE(derived_key_raw, derived_key_len,
pub_key_raw, pub_key_len);
pub_key_raw, pub_key_len);

#if defined(MBEDTLS_USE_PSA_CRYPTO)
mbedtls_platform_zeroize(derived_key_raw, derived_key_len);
Expand All @@ -163,7 +163,7 @@ void pk_write_public_from_private(char *priv_key_file, char *pub_key_file)
derived_key_len), pub_key_len);

TEST_MEMORY_COMPARE(derived_key_raw, derived_key_len,
pub_key_raw, pub_key_len);
pub_key_raw, pub_key_len);
#endif /* MBEDTLS_USE_PSA_CRYPTO */

exit:
Expand Down
8 changes: 4 additions & 4 deletions tests/suites/test_suite_poly1305.function
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void mbedtls_poly1305(data_t *key, data_t *expected_mac, data_t *src_str)
src_str->len, mac) == 0);

TEST_MEMORY_COMPARE(mac, expected_mac->len,
expected_mac->x, expected_mac->len);
expected_mac->x, expected_mac->len);

/*
* Test the streaming API
Expand All @@ -37,7 +37,7 @@ void mbedtls_poly1305(data_t *key, data_t *expected_mac, data_t *src_str)
TEST_ASSERT(mbedtls_poly1305_finish(&ctx, mac) == 0);

TEST_MEMORY_COMPARE(mac, expected_mac->len,
expected_mac->x, expected_mac->len);
expected_mac->x, expected_mac->len);

/*
* Test the streaming API again, piecewise
Expand All @@ -54,7 +54,7 @@ void mbedtls_poly1305(data_t *key, data_t *expected_mac, data_t *src_str)
TEST_ASSERT(mbedtls_poly1305_finish(&ctx, mac) == 0);

TEST_MEMORY_COMPARE(mac, expected_mac->len,
expected_mac->x, expected_mac->len);
expected_mac->x, expected_mac->len);
}

/*
Expand All @@ -70,7 +70,7 @@ void mbedtls_poly1305(data_t *key, data_t *expected_mac, data_t *src_str)
TEST_ASSERT(mbedtls_poly1305_finish(&ctx, mac) == 0);

TEST_MEMORY_COMPARE(mac, expected_mac->len,
expected_mac->x, expected_mac->len);
expected_mac->x, expected_mac->len);
}

mbedtls_poly1305_free(&ctx);
Expand Down
Loading

0 comments on commit a240fe3

Please sign in to comment.