crypto_kpp_maxsize(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– crypto_kpp_maxsize β€” the Kernel API Manual page, but make it make sense πŸ’–

okay so bestie, you're in the crypto_kpp_maxsize(9) page of the Kernel API Manual, and honestly? it's a tiny one. one function, one job, one very important warning. let's get into it πŸŽ€


✨ NAME ✨

crypto_kpp_maxsize β€” literally just "Get len for output buffer". that's the whole assignment. she tells you how big your output buffer needs to be. slay πŸ’…


✨ SYNOPSIS ✨

unsigned int crypto_kpp_maxsize (struct crypto_kpp *tfm );

yep, that's it. one arg, returns an unsigned int. no cap 🧚


✨ ARGUMENTS ✨

  • tfm β€” the KPP tfm handle, and it has to be one you allocated with crypto_alloc_kpp. like, that specific allocation function. don't show up with some random handle, she will know πŸ™ˆ

✨ DESCRIPTION ✨

so the function returns the output buffer size required for a given key. that's the vibe check it performs: you hand it the tfm, it hands you back a number, and that number is how many bytes your output buffer needs. iconic, honestly πŸ¦‹

BUT β€” and this is the main character energy part β€” the function assumes that the key is already set in the transformation. like, it's not checking. it's not verifying. it's just trusting you. 😭

⚠️ fr fr, pay attention: if you call this function without a setkey, or after a setkey that failed, you will end up in a NULL dereference. that's not a vibe. that's a crash. πŸ’€

so like… set your key first. successfully. then ask for the size. in that order. periodt.


🌈 SEE ALSO 🌈

bestie there is a whole friend group of related functions and structs, and the kernel doc wants you to know all of them. also there's a kernel file you should peek at: ./include/crypto/kpp.h πŸ‘‘

so the full squad is:

ngl, reading the whole list in one sitting is a lot, but iykyk β€” they all slot together like a little crypto key-agreement friend group 🫢


and that's the page!! short, sweet, slightly dangerous if you skip the setkey step πŸ’€

sign-off time, because the footer said so: this one lives in ./include/crypto, it's dated October 2026, and it goes out to you as crypto_kpp_maxsize(9). mwah πŸ’‹ ⭐ 🌸

πŸ“¦ where this page comes from