lib/crypto/gf128mul.c
Source file repositories/reference/linux-study-clean/lib/crypto/gf128mul.c
File Facts
- System
- Linux kernel
- Corpus path
lib/crypto/gf128mul.c- Extension
.c- Size
- 10666 bytes
- Lines
- 292
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
crypto/gf128mul.hlinux/export.hlinux/kernel.hlinux/module.hlinux/slab.h
Detected Declarations
function Licensefunction gf128mul_x8_lle_tifunction gf128mul_x8_bbefunction gf128mul_x8_blefunction gf128mul_llefunction GFfunction gf128mul_free_64kfunction gf128mul_64k_bbeexport gf128mul_x8_bleexport gf128mul_lleexport gf128mul_init_64k_bbeexport gf128mul_free_64kexport gf128mul_64k_bbe
Annotated Snippet
if (!t->t[i]) {
gf128mul_free_64k(t);
t = NULL;
goto out;
}
}
t->t[0]->t[1] = *g;
for (j = 1; j <= 64; j <<= 1)
gf128mul_x_bbe(&t->t[0]->t[j + j], &t->t[0]->t[j]);
for (i = 0;;) {
for (j = 2; j < 256; j += j)
for (k = 1; k < j; ++k)
be128_xor(&t->t[i]->t[j + k],
&t->t[i]->t[j], &t->t[i]->t[k]);
if (++i >= 16)
break;
for (j = 128; j > 0; j >>= 1) {
t->t[i]->t[j] = t->t[i - 1]->t[j];
gf128mul_x8_bbe(&t->t[i]->t[j]);
}
}
out:
return t;
}
EXPORT_SYMBOL(gf128mul_init_64k_bbe);
void gf128mul_free_64k(struct gf128mul_64k *t)
{
int i;
for (i = 0; i < 16; i++)
kfree_sensitive(t->t[i]);
kfree_sensitive(t);
}
EXPORT_SYMBOL(gf128mul_free_64k);
void gf128mul_64k_bbe(be128 *a, const struct gf128mul_64k *t)
{
u8 *ap = (u8 *)a;
be128 r[1];
int i;
*r = t->t[0]->t[ap[15]];
for (i = 1; i < 16; ++i)
be128_xor(r, r, &t->t[i]->t[ap[15 - i]]);
*a = *r;
}
EXPORT_SYMBOL(gf128mul_64k_bbe);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Functions for multiplying elements of GF(2^128)");
Annotation
- Immediate include surface: `crypto/gf128mul.h`, `linux/export.h`, `linux/kernel.h`, `linux/module.h`, `linux/slab.h`.
- Detected declarations: `function License`, `function gf128mul_x8_lle_ti`, `function gf128mul_x8_bbe`, `function gf128mul_x8_ble`, `function gf128mul_lle`, `function GF`, `function gf128mul_free_64k`, `function gf128mul_64k_bbe`, `export gf128mul_x8_ble`, `export gf128mul_lle`.
- Atlas domain: Kernel Services / lib.
- Implementation status: integration 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.