crypto_cipher_encrypt_one(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 the struct crypto_cipher * you already set up (and set a key on, presumably β€” that part's on you, see crypto_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 🌈


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