crypto_akcip...sync_encrypt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– crypto_akcipher_sync_encrypt β€” from the Kernel API Manual, bestie πŸ’–

okay so real talk, this is a page straight out of the Kernel API Manual and it's about one very specific little function that does exactly one thing and does it slay. no cap. let's get into it 🫢


✨ NAME ✨

crypto_akcipher_sync_encrypt β€” literally just invoke public key encrypt operation. that's the whole job. main character energy, minimal responsibilities πŸ’…


🌸 SYNOPSIS 🌸

int crypto_akcipher_sync_encrypt (struct crypto_akcipher *tfm , const
void *src , unsigned int slen , void *dst , unsigned int dlen );

look at her. five params, one int return, zero drama. copy it exactly, don't freestyle it πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tfm β€” the AKCIPHER tfm handle, and bestie it has to be allocated with crypto_alloc_akcipher. no homemade handles, iykyk ✨
  • src β€” source buffer. where the plaintext vibe lives πŸ’œ
  • slen β€” source length. yes you must tell her how big, she's not a mind reader 😭
  • dst β€” destination obuffer. (the page literally says obuffer and honestly? we respect the typo. it stays. periodt πŸ’€)
  • dlen β€” destination length. again with the measurements, she likes to know 🌸

🧚 DESCRIPTION 🧚

so what does it actually do? the function invokes the specific public key encrypt operation for a given public key algorithm. that's it. that's the tea β˜•

it's the sync wrapper β€” you hand it the tfm, the source buffer + length, the destination buffer + length, and it goes and runs whichever public key algorithm is wired up underneath. lowkey iconic, highkey straightforward 🌈


⭐ RETURN ⭐

  • zero on success πŸŽ‰ (zero is the good number here, don't panic)
  • error code in case of error πŸ’€
no in-between. it works or it hands you an error code. that's the vibe check.

πŸ‘‘ SEE ALSO πŸ‘‘

all the siblings and cousins, fr fr β€” and the kernel file they all live in: ./include/crypto/akcipher.h

go read them too, they're all eating πŸ”₯


sign-off bestie πŸŽ€: this gem lives in ./include/crypto, dated October 2026, and it's filed under crypto_akcip...sync_encrypt(9) (yes the header truncates it like that, we don't make the rules πŸ’…). now go encrypt something, you absolute legend πŸ’–βœ¨

πŸ“¦ where this page comes from