SYMMETRIC KEY CIPHER API(9)
π Symmetric Key Cipher API π
okay so bestie, this is the Symmetric Key Cipher API, straight out of the Kernel API Manual, section 9 β and it's literally the whole playbook for hanging out with ciphers of type CRYPTO_ALG_TYPE_SKCIPHER (you'll spot them listed as type "skcipher" in /proc/crypto, iykyk π).
so here's the tea about asynchronous cipher operations β: the function invocation for a cipher request returns immediately, before the operation is even finished. the cipher request gets scheduled as a separate kernel thread, so it's load-balanced across the different CPUs via the process scheduler β main character energy, honestly. and because the kernel crypto API needs to be able to tell the caller when a cipher request is done, you have to provide a callback function. that function gets invoked with the cipher handle when the request completes. no callback, no update. periodt π
now, to support that asynchronous operation, you've gotta hand the kernel crypto API more info than just the cipher handle β and that extra info is given by filling in the skcipher_request data structure. π¦
for the symmetric key cipher API, the state is maintained with the tfm cipher handle. a single tfm can be used across multiple calls and in parallel β highkey slay. π
for asynchronous block cipher calls, context data that's supplied and only used by the caller can be referenced in the request data structure, in addition to the IV used for the cipher request. keeping that state information around is important for a crypto driver implementer to have, because when you call the callback function upon completion of the cipher operation, that callback might need some info about which operation just finished β especially if it kicked off multiple in parallel. that state information is unused by the kernel crypto API. β
β¨ SEE ALSO β¨
- Kernel file
./include/crypto/skcipher.h struct skcipher_request(9)struct skcipher_alg(9)struct lskcipher_alg(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_lskcipher_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)
and that's the whole page, bestie π mwah π β brought to you by ./include/crypto, dated October 2026, and yes it's still called Symmetric Key Cipher API(9). byeeee π«Άβ¨
π¦ 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