diff options
author | Constanza Heath <[email protected]> | 2015-08-28 15:37:24 -0700 |
---|---|---|
committer | Constanza Heath <[email protected]> | 2015-08-28 15:37:24 -0700 |
commit | e54fd9649bf37d89c6681b93ede37fa8140d21ef (patch) | |
tree | 8e1a3e3c9bd263845dc8e92ecdbe352ef7f70e1e /tests/test_hmac.c | |
parent | bd69052b351fe1e18449077c1362591bb59efc27 (diff) |
Add preface of tc_ to public functions, structs, and macros
Signed-off-by: Constanza Heath <[email protected]>
Diffstat (limited to 'tests/test_hmac.c')
-rw-r--r-- | tests/test_hmac.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/test_hmac.c b/tests/test_hmac.c index 82e76bb..d22c955 100644 --- a/tests/test_hmac.c +++ b/tests/test_hmac.c @@ -42,15 +42,15 @@ #include <stdint.h> void do_hmac_test ( - HmacState_t h, + TCHmacState_t h, uint32_t testnum, const uint8_t *data, size_t datalen, const uint8_t *expected, size_t expectedlen) { uint8_t digest[32]; - (void) hmac_init (h); - (void) hmac_update (h, data, datalen); - (void) hmac_final (digest, SHA256_DIGEST_SIZE, h); + (void) tc_hmac_init (h); + (void) tc_hmac_update (h, data, datalen); + (void) tc_hmac_final (digest, TC_SHA256_DIGEST_SIZE, h); check_result(testnum, expected, expectedlen, digest, sizeof(digest), 1); } @@ -69,10 +69,10 @@ void test_1 (void) { 0xaf, 0x0b, 0xf1, 0x2b, 0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, 0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7 }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 1, data, sizeof (data), expected, sizeof(expected)); } @@ -92,10 +92,10 @@ void test_2 (void) { 0x08, 0x95, 0x75, 0xc7, 0x5a, 0x00, 0x3f, 0x08, 0x9d, 0x27, 0x39, 0x83, 0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43 }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 2, data, sizeof (data), expected, sizeof(expected)); } @@ -118,10 +118,10 @@ void test_3 (void) { 0xd0, 0x91, 0x81, 0xa7, 0x29, 0x59, 0x09, 0x8b, 0x3e, 0xf8, 0xc1, 0x22, 0xd9, 0x63, 0x55, 0x14, 0xce, 0xd5, 0x65, 0xfe }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 3, data, sizeof (data), expected, sizeof(expected)); } @@ -145,10 +145,10 @@ void test_4 (void) { 0x99, 0xf2, 0x08, 0x3a, 0x85, 0xf0, 0xfa, 0xa3, 0xe5, 0x78, 0xf8, 0x07, 0x7a, 0x2e, 0x3f, 0xf4, 0x67, 0x29, 0x66, 0x5b }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 4, data, sizeof (data), expected, sizeof(expected)); } @@ -168,10 +168,10 @@ void test_5 (void) { 0x29, 0x55, 0x55, 0x2b, 0xfa, 0x6f, 0x7c, 0x0a, 0x6a, 0x8a, 0xef, 0x8b, 0x93, 0xf8, 0x60, 0xaa, 0xb0, 0xcd, 0x20, 0xc5 }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 5, data, sizeof (data), expected, sizeof(expected)); } @@ -203,10 +203,10 @@ void test_6 (void) { 0xcb, 0xf5, 0xb7, 0x7f, 0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14, 0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54 }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 6, data, sizeof (data), expected, sizeof(expected)); } @@ -246,10 +246,10 @@ void test_7 (void) { 0xd5, 0xb0, 0xe9, 0x44, 0xbf, 0xdc, 0x63, 0x64, 0x4f, 0x07, 0x13, 0x93, 0x8a, 0x7f, 0x51, 0x53, 0x5c, 0x3a, 0x35, 0xe2 }; - struct hmac_state_struct h; + struct tc_hmac_state_struct h; (void) memset (&h, 0x00, sizeof (h)); - (void) hmac_set_key (&h, key, sizeof (key)); + (void) tc_hmac_set_key (&h, key, sizeof (key)); do_hmac_test (&h, 7, data, sizeof (data), expected, sizeof(expected)); } |