crypto_cipher_encrypt_one(9)
β¨ crypto_cipher_encrypt_one(9) β¨
okay bestie, welcome to the Kernel API Manual β this one's about crypto_cipher_encrypt_one, and it's literally the simplest little glow-up in the whole crypto subsystem. one block in, one block out, no drama π
πΈ NAME πΈ
crypto_cipher_encrypt_one β encrypt one block of plaintext π«Ά
π SYNOPSIS π
void crypto_cipher_encrypt_one (struct crypto_cipher *tfm , u8 *dst ,
const u8 *src );
that's it. three args. she's compact and she knows it β¨
π ARGUMENTS π
tfmβ the cipher handle, aka your main character. this is thestruct crypto_cipher *you already set up (and set a key on, presumably β that part's on you, seecrypto_cipher_setkey(9)).dstβ points to the buffer that will be filled with the ciphertext. this is where the magic lands πͺsrcβ buffer holding the plaintext to be encrypted. the raw material, the before picture πΈ
π¦ DESCRIPTION π¦
so what does she actually do? she invokes the encryption operation of one block. one. single. block. no more, no less, no "oh but what about a whole file" β that's not her job, bestie π
β οΈ real talk though: the caller must ensure that the plaintext and ciphertext buffers are at least one block in size. that's on you, not on her. she is not checking. she is not resize-checking. she trusts you completely and that is both iconic and slightly terrifying π
if you need to know how big "one block" even is, that's what crypto_cipher_blocksize(9) is for, iykyk π
π SEE ALSO π
- Kernel file
./include/crypto/internal/cipher.h Single Block Cipher API(9)crypto_alloc_cipher(9)crypto_free_cipher(9)crypto_has_cipher(9)crypto_cipher_blocksize(9)crypto_cipher_setkey(9)crypto_cipher_decrypt_one(9)β the reverse-uno card, if you ever need it π₯
and that's the whole page, bestie β no cap, she's short and sweet π
sign-off szn: this one lives in ./include/crypto/internal, dated October 2026, and yes the page footer still says crypto_cipher_encrypt_one(9) because we stay on brand π go encrypt exactly one block and slay, periodt β¨π§
π¦ 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