[code-style] apply clang-format

This commit is contained in:
Jonathan Hui
2018-02-09 21:43:42 +00:00
parent f8e866c65c
commit 69d98d4a53
401 changed files with 13393 additions and 13112 deletions
+6 -10
View File
@@ -42,17 +42,14 @@ void TestHmacSha256(void)
{
const char *key;
const char *data;
uint8_t hash[ot::Crypto::HmacSha256::kHashSize];
} tests[] =
{
uint8_t hash[ot::Crypto::HmacSha256::kHashSize];
} tests[] = {
{
"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
"Hi There",
{
0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53,
0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b,
0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7,
0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7,
0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53, 0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b,
0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, 0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7,
},
},
{
@@ -67,7 +64,7 @@ void TestHmacSha256(void)
// Make sure hmac is destructed before freeing instance.
{
ot::Crypto::HmacSha256 hmac;
uint8_t hash[ot::Crypto::HmacSha256::kHashSize];
uint8_t hash[ot::Crypto::HmacSha256::kHashSize];
VerifyOrQuit(instance != NULL, "Null OpenThread instance");
@@ -77,8 +74,7 @@ void TestHmacSha256(void)
hmac.Update(reinterpret_cast<const uint8_t *>(tests[i].data), static_cast<uint16_t>(strlen(tests[i].data)));
hmac.Finish(hash);
VerifyOrQuit(memcmp(hash, tests[i].hash, sizeof(tests[i].hash)) == 0,
"HMAC-SHA-256 failed\n");
VerifyOrQuit(memcmp(hash, tests[i].hash, sizeof(tests[i].hash)) == 0, "HMAC-SHA-256 failed\n");
}
}