crypto/testmgr.h
Source file repositories/reference/linux-study-clean/crypto/testmgr.h
File Facts
- System
- Linux kernel
- Corpus path
crypto/testmgr.h- Extension
.h- Size
- 1446569 bytes
- Lines
- 37445
- Domain
- Kernel Services
- Bucket
- crypto
- 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
linux/oid_registry.hcrypto/internal/ecc.h
Detected Declarations
struct hash_testvecstruct cipher_testvecstruct aead_testvecstruct drbg_testvecstruct akcipher_testvecstruct sig_testvecstruct kpp_testvecstruct comp_testvec
Annotated Snippet
struct hash_testvec {
const char *key;
const char *plaintext;
const char *digest;
unsigned int psize;
unsigned short ksize;
int setkey_error;
int digest_error;
bool fips_skip;
};
/*
* cipher_testvec: structure to describe a symmetric cipher test
* @key: Pointer to key
* @klen: Length of @key in bytes
* @iv: Pointer to IV. If NULL, an all-zeroes IV is used.
* @iv_out: Pointer to output IV, if applicable for the cipher.
* @ptext: Pointer to plaintext
* @ctext: Pointer to ciphertext
* @len: Length of @ptext and @ctext in bytes
* @wk: Does the test need CRYPTO_TFM_REQ_FORBID_WEAK_KEYS?
* ( e.g. test needs to fail due to a weak key )
* @fips_skip: Skip the test vector in FIPS mode
* @setkey_error: Expected error from setkey()
* @crypt_error: Expected error from encrypt() and decrypt()
*/
struct cipher_testvec {
const char *key;
const char *iv;
const char *iv_out;
const char *ptext;
const char *ctext;
unsigned char wk; /* weak key flag */
unsigned short klen;
unsigned int len;
bool fips_skip;
int setkey_error;
int crypt_error;
};
/*
* aead_testvec: structure to describe an AEAD test
* @key: Pointer to key
* @iv: Pointer to IV. If NULL, an all-zeroes IV is used.
* @ptext: Pointer to plaintext
* @assoc: Pointer to associated data
* @ctext: Pointer to the full authenticated ciphertext. For AEADs that
* produce a separate "ciphertext" and "authentication tag", these
* two parts are concatenated: ciphertext || tag.
* @novrfy: If set, this is an inauthentic input test: only decryption is
* tested, and it is expected to fail with either -EBADMSG or
* @crypt_error if it is nonzero.
* @wk: Does the test need CRYPTO_TFM_REQ_FORBID_WEAK_KEYS?
* (e.g. setkey() needs to fail due to a weak key)
* @klen: Length of @key in bytes
* @plen: Length of @ptext in bytes
* @alen: Length of @assoc in bytes
* @clen: Length of @ctext in bytes
* @setkey_error: Expected error from setkey(). If set, neither encryption nor
* decryption is tested.
* @setauthsize_error: Expected error from setauthsize(). If set, neither
* encryption nor decryption is tested.
* @crypt_error: When @novrfy=0, the expected error from encrypt(). When
* @novrfy=1, an optional alternate error code that is acceptable
* for decrypt() to return besides -EBADMSG.
*/
struct aead_testvec {
const char *key;
const char *iv;
const char *ptext;
const char *assoc;
const char *ctext;
unsigned char novrfy;
unsigned char wk;
unsigned char klen;
unsigned int plen;
unsigned int clen;
unsigned int alen;
int setkey_error;
int setauthsize_error;
int crypt_error;
};
struct drbg_testvec {
/* Instantiate */
const unsigned char *entropy;
size_t entropylen;
const unsigned char *pers;
size_t perslen;
Annotation
- Immediate include surface: `linux/oid_registry.h`, `crypto/internal/ecc.h`.
- Detected declarations: `struct hash_testvec`, `struct cipher_testvec`, `struct aead_testvec`, `struct drbg_testvec`, `struct akcipher_testvec`, `struct sig_testvec`, `struct kpp_testvec`, `struct comp_testvec`.
- Atlas domain: Kernel Services / crypto.
- 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.