projects/linux·blob master · refs

29 lines · 641 B

1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright 2026 Google LLC
4 */
5#include <crypto/sm3.h>
6#include "sm3-testvecs.h"
7
8#define HASH sm3
9#define HASH_CTX sm3_ctx
10#define HASH_SIZE SM3_DIGEST_SIZE
11#define HASH_INIT sm3_init
12#define HASH_UPDATE sm3_update
13#define HASH_FINAL sm3_final
14#include "hash-test-template.h"
15
16static struct kunit_case sm3_test_cases[] = {
17 HASH_KUNIT_CASES,
18 KUNIT_CASE(benchmark_hash),
19 {},
20};
21
22static struct kunit_suite sm3_test_suite = {
23 .name = "sm3",
24 .test_cases = sm3_test_cases,
25};
26kunit_test_suite(sm3_test_suite);
27
28MODULE_DESCRIPTION("KUnit tests and benchmark for SM3");
29MODULE_LICENSE("GPL");