include/crypto/utils.h
Source file repositories/reference/linux-study-clean/include/crypto/utils.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/utils.h- Extension
.h- Size
- 1940 bytes
- Lines
- 74
- 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.
Dependency Surface
linux/unaligned.hlinux/compiler_attributes.hlinux/types.h
Detected Declarations
function crypto_xorfunction crypto_xor_cpyfunction crypto_memneq
Annotated Snippet
while (size > 0) {
l = get_unaligned(d) ^ get_unaligned(s++);
put_unaligned(l, d++);
size -= sizeof(unsigned long);
}
} else {
__crypto_xor(dst, dst, src, size);
}
}
static inline void crypto_xor_cpy(u8 *dst, const u8 *src1, const u8 *src2,
unsigned int size)
{
if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) &&
__builtin_constant_p(size) &&
(size % sizeof(unsigned long)) == 0) {
unsigned long *d = (unsigned long *)dst;
unsigned long *s1 = (unsigned long *)src1;
unsigned long *s2 = (unsigned long *)src2;
unsigned long l;
while (size > 0) {
l = get_unaligned(s1++) ^ get_unaligned(s2++);
put_unaligned(l, d++);
size -= sizeof(unsigned long);
}
} else {
__crypto_xor(dst, src1, src2, size);
}
}
noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size);
/**
* crypto_memneq - Compare two areas of memory without leaking
* timing information.
*
* @a: One area of memory
* @b: Another area of memory
* @size: The size of the area.
*
* Returns 0 when data is equal, 1 otherwise.
*/
static inline int crypto_memneq(const void *a, const void *b, size_t size)
{
return __crypto_memneq(a, b, size) != 0UL ? 1 : 0;
}
#endif /* _CRYPTO_UTILS_H */
Annotation
- Immediate include surface: `linux/unaligned.h`, `linux/compiler_attributes.h`, `linux/types.h`.
- Detected declarations: `function crypto_xor`, `function crypto_xor_cpy`, `function crypto_memneq`.
- 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.