crypto_lskcipher_setkey(9)
π crypto_lskcipher_setkey(9) β like, the kernel API manual page, bestie β¨
Okay so this is a page from the Kernel API Manual, and the function we're talking about is crypto_lskcipher_setkey β yes the (9) is part of the name, that's just how kernel docs do π
β¨ NAME β¨
crypto_lskcipher_setkey β set the key for a cipher, that's the whole vibe π
πΈ SYNOPSIS πΈ
int crypto_lskcipher_setkey (struct crypto_lskcipher *tfm , const u8
*key , unsigned int keylen );
Like, it returns an int, bestie, and you hand it three things β periodt π
π¦ ARGUMENTS π¦
tfmβ the cipher handle, your main character π«Άkeyβ the buffer holding the key, no cap πkeylenβ length of the key, in bytes (yes, bytes, don't come at me with bits π)
π DESCRIPTION π
So the caller-provided key gets set for the lskcipher that's referenced by the cipher handle. That's it. That's the whole thing β¨
But wait β important lore: the key length literally determines the cipher type. It's giving "your key's size is its whole personality" ngl. Many block ciphers implement different cipher modes depending on the key size β iconic examples being AES-128 vs AES-192 vs. AES-256. So when you provide a 16 byte key for an AES cipher handle, AES-128 is what gets performed. Sixteen bytes in, AES-128 out, slay π
β RETURN β
0if setting the key was successful π< 0if an error occurred π
π SEE ALSO π
So here's the whole friendship group, literally all of them, in the order the page gives them β and I mean the Kernel file reference too, don't skip it π
Kernel file ./include/crypto/skcipher.h, struct skcipher_request(9), struct skcipher_alg(9), struct lskcipher_alg(9), Symmetric Key Cipher API(9), crypto_alloc_skcipher(9), crypto_alloc_lskcipher(9), crypto_free_skcipher(9), crypto_free_lskcipher(9), crypto_has_skcipher(9), crypto_skcipher_ivsize(9), crypto_lskcipher_ivsize(9), crypto_skcipher_blocksize(9), crypto_lskcipher_blocksize(9), crypto_skcipher_chunksize(9), crypto_lskcipher_chunksize(9), crypto_skcipher_statesize(9), crypto_lskcipher_statesize(9), crypto_skcipher_setkey(9), crypto_skcipher_reqtfm(9), crypto_skcipher_encrypt(9), crypto_skcipher_decrypt(9), crypto_skcipher_export(9), crypto_skcipher_import(9), crypto_lskcipher_encrypt(9), crypto_lskcipher_decrypt(9), Symmetric Key Cipher Request Handle(9), crypto_skcipher_reqsize(9), skcipher_request_set_tfm(9), skcipher_request_alloc(9), skcipher_request_free(9), skcipher_request_set_callback(9), skcipher_request_set_crypt(9)
okay that's the whole page, mwah π This one's from the ./include/crypto source, dated October 2026 β so yeah, remember to cite her correctly, iykyk π§π
π¦ 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