lib/crypto/tests/md5_kunit.c
Source file repositories/reference/linux-study-clean/lib/crypto/tests/md5_kunit.c
File Facts
- System
- Linux kernel
- Corpus path
lib/crypto/tests/md5_kunit.c- Extension
.c- Size
- 996 bytes
- Lines
- 40
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
crypto/md5.hmd5-testvecs.hhash-test-template.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2025 Google LLC
*/
#include <crypto/md5.h>
#include "md5-testvecs.h"
#define HASH md5
#define HASH_CTX md5_ctx
#define HASH_SIZE MD5_DIGEST_SIZE
#define HASH_INIT md5_init
#define HASH_UPDATE md5_update
#define HASH_FINAL md5_final
#define HMAC_KEY hmac_md5_key
#define HMAC_CTX hmac_md5_ctx
#define HMAC_PREPAREKEY hmac_md5_preparekey
#define HMAC_INIT hmac_md5_init
#define HMAC_UPDATE hmac_md5_update
#define HMAC_FINAL hmac_md5_final
#define HMAC hmac_md5
#define HMAC_USINGRAWKEY hmac_md5_usingrawkey
#include "hash-test-template.h"
static struct kunit_case hash_test_cases[] = {
HASH_KUNIT_CASES,
KUNIT_CASE(benchmark_hash),
{},
};
static struct kunit_suite hash_test_suite = {
.name = "md5",
.test_cases = hash_test_cases,
.suite_init = hash_suite_init,
.suite_exit = hash_suite_exit,
};
kunit_test_suite(hash_test_suite);
MODULE_DESCRIPTION("KUnit tests and benchmark for MD5 and HMAC-MD5");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `crypto/md5.h`, `md5-testvecs.h`, `hash-test-template.h`.
- Atlas domain: Kernel Services / lib.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.