| 1 | |
| 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 |
|
| 16 | static struct kunit_case sm3_test_cases[] = {
|
| 17 | HASH_KUNIT_CASES,
|
| 18 | KUNIT_CASE(benchmark_hash),
|
| 19 | {},
|
| 20 | };
|
| 21 |
|
| 22 | static struct kunit_suite sm3_test_suite = {
|
| 23 | .name = "sm3",
|
| 24 | .test_cases = sm3_test_cases,
|
| 25 | };
|
| 26 | kunit_test_suite(sm3_test_suite);
|
| 27 |
|
| 28 | MODULE_DESCRIPTION("KUnit tests and benchmark for SM3");
|
| 29 | MODULE_LICENSE("GPL");
|