KCAPI_CIPHER_INIT(3)
β¨ KCAPI_CIPHER_INIT β¨
okay so bestie, welcome to kcapi_cipher_init from the libkcapi crew β this is the one that initializes a cipher handle for you π it's a libkcapi manual page (section 3, programming interface energy) and we're gonna get you fluent in it, no cap.
πΈ SYNOPSIS πΈ
int kcapi_cipher_init(struct kcapi_handle ** handle,
const char * ciphername, uint32_t flags);
like. three args. one int back. she's simple, she's iconic, she slays π
π ARGUMENTS π
handleβ[out]bestie this is the output, it's where the cipher handle gets filled in during the call π«Ά you bring the pointer-to-pointer, she fills it with the goods.ciphernameβ[in]the kernel crypto API cipher name, exactly as specified in/proc/cryptoβ¨ copy it character for character, do not freestyle, do not improvise, do not get cute with it.flagsβ[in]the flags that specify the type of cipher handle you want π¦ this is where you tell her what kind of handle vibe you're going for.
π DESCRIPTION π
so what does she actually do? This function provides the initialization of a symmetric cipher handle and β the main character moment β establishes the connection to the kernel π₯
On success, a pointer to a kcapi_handle object is returned in *handle. and then?? you should call kcapi_cipher_destroy afterwards to free resources π§ like, that's the clean-up era, don't skip it, we don't leave handles lying around, that's not the vibe.
Return values, and listen close because these matter:
- returns
0upon success π -ENOENTβ algorithm not available π-EOPNOTSUPPβ AF_ALG family not available π-EINVALβ accept syscall failed-ENOMEMβ cipher handle cannot be allocated π
bestie if you get a negative number back, that's not a win. check which one it is, she's telling you exactly what went wrong. periodt.
π AUTHOR π
Stephan Mueller <smueller@chronox.de> β Author. the icon, the legend, the one who wrote it fr fr π
π COPYRIGHT π
that's all she wrote β the copyright vibes belong to the libkcapi Manual, version 1.5.0, dated July 2025 β
and that's the whole page, bestie π go forth and kcapi_cipher_init, remember your kcapi_cipher_destroy, and stay iconic β¨π
π¦
π¦ where this page comes from
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms