mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-24 00:55:36 +00:00
Minor modifications to hkdf test
1. Fix comment grammar. 2. Rename `okm_string` to `okm_hex`.
This commit is contained in:
parent
1a3a7e5fc7
commit
bc93219f66
|
@ -20,10 +20,10 @@ void test_hkdf( int md_alg, char *hex_ikm_string, char *hex_salt_string,
|
||||||
unsigned char expected_okm[128] = { '\0' };
|
unsigned char expected_okm[128] = { '\0' };
|
||||||
unsigned char okm[128] = { '\0' };
|
unsigned char okm[128] = { '\0' };
|
||||||
/*
|
/*
|
||||||
* okm_string is the string representation of okm,
|
* okm_hex is the string representation of okm,
|
||||||
* so its size is twice as the size of okm.
|
* so its size is twice the size of okm.
|
||||||
*/
|
*/
|
||||||
unsigned char okm_string[256] = { '\0' };
|
unsigned char okm_hex[256] = { '\0' };
|
||||||
|
|
||||||
const mbedtls_md_info_t *md = mbedtls_md_info_from_type( md_alg );
|
const mbedtls_md_info_t *md = mbedtls_md_info_from_type( md_alg );
|
||||||
TEST_ASSERT( md != NULL );
|
TEST_ASSERT( md != NULL );
|
||||||
|
@ -38,8 +38,8 @@ void test_hkdf( int md_alg, char *hex_ikm_string, char *hex_salt_string,
|
||||||
TEST_ASSERT( ret == 0 );
|
TEST_ASSERT( ret == 0 );
|
||||||
|
|
||||||
// Run hexify on it so that it looks nicer if the assertion fails
|
// Run hexify on it so that it looks nicer if the assertion fails
|
||||||
hexify( okm_string, okm, okm_len );
|
hexify( okm_hex, okm, okm_len );
|
||||||
TEST_ASSERT( !strcmp( (char *)okm_string, hex_okm_string ) );
|
TEST_ASSERT( !strcmp( (char *)okm_hex, hex_okm_string ) );
|
||||||
}
|
}
|
||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue