lskcipher_a...tance_simple(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ”‘
  • ivsize
  • blocksize
  • alignmask
  • priority πŸ‘‘

...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