Lines Matching defs:test

5  * KUnit test of SunRPC's GSS Kerberos mechanism. Subsystem
9 #include <kunit/test.h>
43 static void kdf_case(struct kunit *test)
45 const struct gss_krb5_test_param *param = test->param_value;
53 kunit_skip(test, "Encryption type is not available");
55 derivedkey.data = kunit_kzalloc(test, param->expected_result->len,
57 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, derivedkey.data);
63 KUNIT_ASSERT_EQ(test, err, 0);
66 KUNIT_EXPECT_EQ_MSG(test,
72 static void checksum_case(struct kunit *test)
74 const struct gss_krb5_test_param *param = test->param_value;
87 kunit_skip(test, "Encryption type is not available");
90 Kc.data = kunit_kzalloc(test, Kc.len, GFP_KERNEL);
91 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, Kc.data);
94 KUNIT_ASSERT_EQ(test, err, 0);
97 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, tfm);
99 KUNIT_ASSERT_EQ(test, err, 0);
101 buf.head[0].iov_base = kunit_kzalloc(test, buf.head[0].iov_len, GFP_KERNEL);
102 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buf.head[0].iov_base);
106 checksum.data = kunit_kzalloc(test, checksum.len, GFP_KERNEL);
107 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, checksum.data);
111 KUNIT_ASSERT_EQ(test, err, 0);
114 KUNIT_EXPECT_EQ_MSG(test,
141 * This test material is copyright (C) The Internet Society (2005).
303 static void rfc3961_nfold_case(struct kunit *test)
305 const struct gss_krb5_test_param *param = test->param_value;
309 result = kunit_kzalloc(test, 4096, GFP_KERNEL);
310 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, result);
317 KUNIT_EXPECT_EQ_MSG(test,
340 * Some test vectors for CBC with ciphertext stealing, using an
343 * This test material is copyright (C) The Internet Society (2005).
524 * It does not apply a confounder or test the result of HMAC over the
527 static void rfc3962_encrypt_case(struct kunit *test)
529 const struct gss_krb5_test_param *param = test->param_value;
539 kunit_skip(test, "Encryption type is not available");
542 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
544 KUNIT_ASSERT_EQ(test, err, 0);
547 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cts_tfm);
549 KUNIT_ASSERT_EQ(test, err, 0);
551 iv = kunit_kzalloc(test, crypto_sync_skcipher_ivsize(cts_tfm), GFP_KERNEL);
552 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, iv);
554 text = kunit_kzalloc(test, param->plaintext->len, GFP_KERNEL);
555 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, text);
566 KUNIT_ASSERT_EQ(test, err, 0);
569 KUNIT_EXPECT_EQ_MSG(test,
572 KUNIT_EXPECT_EQ_MSG(test,
576 KUNIT_EXPECT_EQ_MSG(test,
780 .desc = "camellia128-cts-cmac checksum test 1",
788 .desc = "camellia128-cts-cmac checksum test 2",
796 .desc = "camellia256-cts-cmac checksum test 3",
804 .desc = "camellia256-cts-cmac checksum test 4",
1114 static void rfc6803_encrypt_case(struct kunit *test)
1116 const struct gss_krb5_test_param *param = test->param_value;
1135 kunit_skip(test, "Encryption type is not available");
1141 Ke.data = kunit_kzalloc(test, Ke.len, GFP_KERNEL);
1142 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, Ke.data);
1145 KUNIT_ASSERT_EQ(test, err, 0);
1148 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
1150 KUNIT_ASSERT_EQ(test, err, 0);
1153 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cts_tfm);
1155 KUNIT_ASSERT_EQ(test, err, 0);
1159 text = kunit_kzalloc(test, len, GFP_KERNEL);
1160 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, text);
1171 checksum.data = kunit_kzalloc(test, checksum.len, GFP_KERNEL);
1172 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, checksum.data);
1175 Ki.data = kunit_kzalloc(test, Ki.len, GFP_KERNEL);
1176 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, Ki.data);
1180 KUNIT_ASSERT_EQ(test, err, 0);
1182 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ahash_tfm);
1184 KUNIT_ASSERT_EQ(test, err, 0);
1188 KUNIT_ASSERT_EQ(test, err, 0);
1191 KUNIT_ASSERT_EQ(test, err, 0);
1194 KUNIT_EXPECT_EQ_MSG(test, param->expected_result->len,
1197 KUNIT_EXPECT_EQ_MSG(test,
1201 KUNIT_EXPECT_EQ_MSG(test,
1241 * This test material is copyright (c) 2016 IETF Trust and the
1339 * This test material is copyright (c) 2016 IETF Trust and the
1390 * This test material is copyright (c) 2016 IETF Trust and the
1609 static void rfc8009_encrypt_case(struct kunit *test)
1611 const struct gss_krb5_test_param *param = test->param_value;
1629 kunit_skip(test, "Encryption type is not available");
1634 Ke.data = kunit_kzalloc(test, Ke.len, GFP_KERNEL);
1635 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, Ke.data);
1639 KUNIT_ASSERT_EQ(test, err, 0);
1642 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
1644 KUNIT_ASSERT_EQ(test, err, 0);
1647 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cts_tfm);
1649 KUNIT_ASSERT_EQ(test, err, 0);
1652 text = kunit_kzalloc(test, len, GFP_KERNEL);
1653 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, text);
1664 checksum.data = kunit_kzalloc(test, checksum.len, GFP_KERNEL);
1665 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, checksum.data);
1668 Ki.data = kunit_kzalloc(test, Ki.len, GFP_KERNEL);
1669 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, Ki.data);
1673 KUNIT_ASSERT_EQ(test, err, 0);
1676 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ahash_tfm);
1678 KUNIT_ASSERT_EQ(test, err, 0);
1682 KUNIT_ASSERT_EQ(test, err, 0);
1684 KUNIT_ASSERT_EQ(test, err, 0);
1687 KUNIT_EXPECT_EQ_MSG(test,
1690 KUNIT_EXPECT_EQ_MSG(test,
1695 KUNIT_EXPECT_EQ_MSG(test, memcmp(param->expected_hmac->data,
1734 "This is the plaintext for the encryption self-test.");
1738 .desc = "aes128-cts-hmac-sha1-96 encryption self-test",
1744 .desc = "aes256-cts-hmac-sha1-96 encryption self-test",
1750 .desc = "camellia128-cts-cmac encryption self-test",
1756 .desc = "camellia256-cts-cmac encryption self-test",
1762 .desc = "aes128-cts-hmac-sha256-128 encryption self-test",
1768 .desc = "aes256-cts-hmac-sha384-192 encryption self-test",
1784 static void encrypt_selftest_case(struct kunit *test)
1786 const struct gss_krb5_test_param *param = test->param_value;
1796 kunit_skip(test, "Encryption type is not available");
1799 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
1801 KUNIT_ASSERT_EQ(test, err, 0);
1804 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cts_tfm);
1806 KUNIT_ASSERT_EQ(test, err, 0);
1808 text = kunit_kzalloc(test, roundup(param->plaintext->len,
1811 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, text);
1821 KUNIT_ASSERT_EQ(test, err, 0);
1823 KUNIT_ASSERT_EQ(test, err, 0);
1826 KUNIT_EXPECT_EQ_MSG(test,
1829 KUNIT_EXPECT_EQ_MSG(test,
1848 .name = "Encryption test suite",