lskcipher_a...tance_simple(9)
π lskcipher_alloc_instance_simple β the glow-up for simple block ciphers
okay so bestie, welcome to the Kernel API Manual β¨ and today's main character is lskcipher_alloc_instance_simple, aka the function whose name is so long the header just gave up halfway (lskcipher_a...tance_simple(9) β girl, same π). She's here to set you up with a whole fresh instance for a simple block cipher mode, no cap.
π SYNOPSIS π
struct lskcipher_instance * lskcipher_alloc_instance_simple (struct
crypto_template *tmpl , struct rtattr **tb );
like, that's the whole vibe. two args in, one shiny instance out π¦
πΈ ARGUMENTS πΈ
tmplβ the template being instantiated. this is the blueprint, the Pinterest board, the vision board for what you're building π«Άtbβ the template parameters. all the little knobs and details that get passed along β¨
π DESCRIPTION π
So what does she actually do? She allocates an lskcipher_instance for a simple block cipher mode of operation, like cbc or ecb β y'know, the classics π
The way that the instance context comes out is that it has literally just a single crypto_spawn, and that one is for the underlying cipher. That's it. one spawn. minimalist queen β¨
Now, the good stuff gets inherited from the underlying cipher β specifically:
{min,max}_keysizeπivsizeblocksizealignmaskpriorityπ
...all set from the underlying cipher, but heads up β they can totally be overridden if needed. no cap, you're allowed to change them π
And the tfm context? It defaults to struct crypto_lskcipher * π¦ plus she installs the default ->setkey, ->init, and ->exit methods for you. built-in bestie behaviour, honestly π
β RETURN β
She returns a pointer to the new instance, or an ERR_PTR if things went sideways π β so like, check your returns, babe.
π¨ important: the caller still needs to register the instance. she hands you the keys but she does not drive the car. you're on your own for that part, iykyk π«Ά
π§ SEE ALSO π§
- Kernel file
./crypto/lskcipher.cβ go read it, it's giving lore π
okay that's the whole page, periodt π this little gem lives over in ./crypto and the manual's dated October 2026 β go forth and instantiate 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