include/crypto/gf128hash.h
Source file repositories/reference/linux-study-clean/include/crypto/gf128hash.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/gf128hash.h- Extension
.h- Size
- 8147 bytes
- Lines
- 277
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
crypto/ghash.hlinux/string.hlinux/types.h
Detected Declarations
struct polyval_elemstruct ghash_keystruct polyval_keystruct ghash_ctxstruct polyval_ctxfunction ghash_initfunction polyval_initfunction polyval_import_blkalignedfunction polyval_export_blkalignedfunction ghashfunction polyval
Annotated Snippet
struct polyval_elem {
union {
u8 bytes[POLYVAL_BLOCK_SIZE];
struct {
__le64 lo;
__le64 hi;
};
};
};
/**
* struct ghash_key - Prepared key for GHASH
*
* Use ghash_preparekey() to initialize this.
*/
struct ghash_key {
#if defined(CONFIG_CRYPTO_LIB_GF128HASH_ARCH) && defined(CONFIG_PPC64)
/** @htable: GHASH key format used by the POWER8 assembly code */
u64 htable[4][2];
#elif defined(CONFIG_CRYPTO_LIB_GF128HASH_ARCH) && \
(defined(CONFIG_RISCV) || defined(CONFIG_S390))
/** @h_raw: The hash key H, in GHASH format */
u8 h_raw[GHASH_BLOCK_SIZE];
#endif
/** @h: The hash key H, in POLYVAL format */
struct polyval_elem h;
};
/**
* struct polyval_key - Prepared key for POLYVAL
*
* This may contain just the raw key H, or it may contain precomputed key
* powers, depending on the platform's POLYVAL implementation. Use
* polyval_preparekey() to initialize this.
*
* By H^i we mean H^(i-1) * H * x^-128, with base case H^1 = H. I.e. the
* exponentiation repeats the POLYVAL dot operation, with its "extra" x^-128.
*/
struct polyval_key {
#if defined(CONFIG_CRYPTO_LIB_GF128HASH_ARCH) && \
(defined(CONFIG_ARM64) || defined(CONFIG_X86))
/** @h_powers: Powers of the hash key H^8 through H^1 */
struct polyval_elem h_powers[8];
#else
/** @h: The hash key H */
struct polyval_elem h;
#endif
};
/**
* struct ghash_ctx - Context for computing a GHASH value
* @key: Pointer to the prepared GHASH key. The user of the API is
* responsible for ensuring that the key lives as long as the context.
* @acc: The accumulator. It is stored in POLYVAL format rather than GHASH
* format, since most implementations want it in POLYVAL format.
* @partial: Number of data bytes processed so far modulo GHASH_BLOCK_SIZE
*/
struct ghash_ctx {
const struct ghash_key *key;
struct polyval_elem acc;
size_t partial;
};
/**
* struct polyval_ctx - Context for computing a POLYVAL value
* @key: Pointer to the prepared POLYVAL key. The user of the API is
* responsible for ensuring that the key lives as long as the context.
* @acc: The accumulator
* @partial: Number of data bytes processed so far modulo POLYVAL_BLOCK_SIZE
*/
struct polyval_ctx {
const struct polyval_key *key;
struct polyval_elem acc;
size_t partial;
};
/**
* ghash_preparekey() - Prepare a GHASH key
* @key: (output) The key structure to initialize
* @raw_key: The raw hash key
*
* Initialize a GHASH key structure from a raw key.
*
* Context: Any context.
*/
void ghash_preparekey(struct ghash_key *key,
const u8 raw_key[GHASH_BLOCK_SIZE]);
/**
* polyval_preparekey() - Prepare a POLYVAL key
Annotation
- Immediate include surface: `crypto/ghash.h`, `linux/string.h`, `linux/types.h`.
- Detected declarations: `struct polyval_elem`, `struct ghash_key`, `struct polyval_key`, `struct ghash_ctx`, `struct polyval_ctx`, `function ghash_init`, `function polyval_init`, `function polyval_import_blkaligned`, `function polyval_export_blkaligned`, `function ghash`.
- Atlas domain: Repository Root And Misc / include.
- 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.