crypto_alloc_skcipher(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– crypto_alloc_skcipher(9) πŸ’–

okay so this is a page straight out of the Kernel API Manual, bestie β€” we're talking kernel crypto internals, and honestly? it's giving main character energy. stick with me 🫢


✨ NAME ✨

crypto_alloc_skcipher β€” allocate symmetric key cipher handle

like, you're literally getting yourself a handle for a symmetric key cipher. that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

struct crypto_skcipher * crypto_alloc_skcipher (const char *alg_name ,
u32 type , u32 mask );

look at her. iconic signature. no cap, write it exactly like that ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • alg_name β€” this is the cra_name / name or the cra_driver_name / driver name of the skcipher cipher. so like, either name works, you just gotta tell her which cipher you want πŸ¦‹
  • type β€” specifies the type of the cipher. yes ma'am, the type πŸ’œ
  • mask β€” specifies the mask for the cipher. that's the mask, bestie, that's it πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

So what does she actually do? She allocates a cipher handle for an skcipher. That's the whole plot πŸ“

The returned struct crypto_skcipher is the cipher handle that is required for any subsequent API invocation for that skcipher. Translation: you literally cannot do the follow-up calls without her. she's the key to the whole thing πŸ”‘


⭐ RETURN ⭐

  • allocated cipher handle in case of success β€” slay, you got your handle πŸ‘‘
  • IS_ERR is true in case of an error β€” and then PTR_ERR returns the error code, so check it, fr fr 😭
bestie please actually check the return value. IS_ERR true means error, and PTR_ERR hands you the error code. don't skip the vibe check πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./include/crypto/skcipher.h, plus this whole little family right here:


and that's the whole page, periodt πŸ’… this lil gem lives in ./include/crypto and it's dated October 2026, and the page itself is crypto_alloc_skcipher(9) β€” go forth and allocate responsibly, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from