diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-05-14 20:04:57 +0300 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-05-14 20:27:22 +0300 |
commit | 391d8746d0625ea4a2375db3a961aa2584603400 (patch) | |
tree | d4d6209b3d191e326098a23a3d2c578156eec75a | |
parent | 91dd219b99336f519ac9e9f5bb13df4627550e47 (diff) |
kasumi_test.c: fix incomplete check
Previously the 'passed' variable in test_expansion() was being
overwritten on every call of _compare_mem(), so only the result
of last call influenced the test result.
Change-Id: Ibf3ab453c20c7eeec234b95bfe14b497c572c35f
-rw-r--r-- | tests/kasumi/kasumi_test.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/kasumi/kasumi_test.c b/tests/kasumi/kasumi_test.c index a4b1f8d1..f0f173ba 100644 --- a/tests/kasumi/kasumi_test.c +++ b/tests/kasumi/kasumi_test.c @@ -24,14 +24,14 @@ inline static void test_expansion(uint8_t * test_key, uint16_t * _KLi1, uint16_t { _kasumi_key_expand(test_key, _KLi1, _KLi2, _KOi1, _KOi2, _KOi3, _KIi1, _KIi2, _KIi3); int passed = 1; - passed = _compare_mem((uint8_t *)_KLi1, (uint8_t *)_KLi1_r, 16); - passed = _compare_mem((uint8_t *)_KLi2, (uint8_t *)_KLi2_r, 16); - passed = _compare_mem((uint8_t *)_KOi1, (uint8_t *)_KOi1_r, 16); - passed = _compare_mem((uint8_t *)_KOi2, (uint8_t *)_KOi2_r, 16); - passed = _compare_mem((uint8_t *)_KOi3, (uint8_t *)_KOi3_r, 16); - passed = _compare_mem((uint8_t *)_KIi1, (uint8_t *)_KIi1_r, 16); - passed = _compare_mem((uint8_t *)_KIi2, (uint8_t *)_KIi2_r, 16); - passed = _compare_mem((uint8_t *)_KIi3, (uint8_t *)_KIi3_r, 16); + passed &= _compare_mem((uint8_t *)_KLi1, (uint8_t *)_KLi1_r, 16); + passed &= _compare_mem((uint8_t *)_KLi2, (uint8_t *)_KLi2_r, 16); + passed &= _compare_mem((uint8_t *)_KOi1, (uint8_t *)_KOi1_r, 16); + passed &= _compare_mem((uint8_t *)_KOi2, (uint8_t *)_KOi2_r, 16); + passed &= _compare_mem((uint8_t *)_KOi3, (uint8_t *)_KOi3_r, 16); + passed &= _compare_mem((uint8_t *)_KIi1, (uint8_t *)_KIi1_r, 16); + passed &= _compare_mem((uint8_t *)_KIi2, (uint8_t *)_KIi2_r, 16); + passed &= _compare_mem((uint8_t *)_KIi3, (uint8_t *)_KIi3_r, 16); printf(passed ? " OK. " : "FAILED!"); } |