crypto_alloc_cipher(9)
π crypto_alloc_cipher(9)
okay so bestie, welcome to the Kernel API Manual entry for crypto_alloc_cipher β this is the moment where you get yourself a single block cipher handle, and honestly? iconic behavior. let's get into it π
β¨ NAME β¨
crypto_alloc_cipher β allocate single block cipher handle π
πΈ SYNOPSIS πΈ
struct crypto_cipher * crypto_alloc_cipher (const char *alg_name , u32
type , u32 mask );
like, that's the whole vibe. one function, three args, returns you a struct crypto_cipher *. no cap. β¨
π¦ ARGUMENTS π¦
alg_nameβ this one's the cra_name / name or the cra_driver_name / driver name of the single block cipher. so you either give it the cute generic name or the specific driver name, your call, main character energy either way π«Άtypeβ specifies the type of the cipher. yep, that's the parameter. that's what it does πmaskβ specifies the mask for the cipher. also exactly what it says on the tin πΈ
π DESCRIPTION π
so what we're doing here is allocating a cipher handle for a single block cipher. the returned struct crypto_cipher is the cipher handle β and bestie, you literally need it for any subsequent API invocation for that single block cipher. like, it's not optional. it's the key to the whole group chat π₯
β RETURN β
- on success? you get the allocated cipher handle. slay π
- on error?
IS_ERRis true, andPTR_ERRreturns the error code. so always, always check β don't just start using it and expect the universe to be nice to you π
fr fr, run your IS_ERR check. the kernel does not do vibes-based error handling.
π SEE ALSO π
- Kernel file
./include/crypto/internal/cipher.h Single Block Cipher API(9)crypto_free_cipher(9)crypto_has_cipher(9)crypto_cipher_blocksize(9)crypto_cipher_setkey(9)crypto_cipher_encrypt_one(9)crypto_cipher_decrypt_one(9)
like a whole little friend group of cipher functions, iykyk π§
and that's the page!! π this one lives in ./include/crypto/internal, dated October 2026, and it's filed under crypto_alloc_cipher(9) β go forth and allocate responsibly, bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms