unit-tests: NTRU test to check a special branch
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 8 Dec 2013 09:18:33 +0000 (10:18 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 8 Dec 2013 09:18:33 +0000 (10:18 +0100)
src/libstrongswan/tests/suites/test_ntru.c

index 91aa27c..75cf81e 100644 (file)
@@ -533,7 +533,14 @@ START_TEST(test_ntru_trits)
 
        trits = chunk_create(mask->get_trits(mask), mask->get_size(mask));
        ck_assert(chunk_equals(trits, mgf1_tests[_i].trits));
+       mask->destroy(mask);
+
+       /* generate a multiple of 5 trits */
+       mask = ntru_trits_create(10, mgf1_tests[_i].alg, mgf1_tests[_i].seed);
+       ck_assert(mask);
 
+       trits = chunk_create(mask->get_trits(mask), mask->get_size(mask));
+       ck_assert(chunk_equals(trits, chunk_create(mgf1_tests[_i].trits.ptr, 10)));
        mask->destroy(mask);
 }
 END_TEST