crypto_kpp_maxsize(9)
π 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 withcrypto_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:
struct kpp_request(9)struct crypto_kpp(9)struct kpp_alg(9)Generic Key-agreement Protocol Primitives API(9)crypto_alloc_kpp(9)crypto_free_kpp(9)kpp_request_alloc(9)kpp_request_free(9)kpp_request_set_callback(9)kpp_request_set_input(9)kpp_request_set_output(9)struct kpp_secret(9)crypto_kpp_set_secret(9)crypto_kpp_generate_public_key(9)crypto_kpp_compute_shared_secret(9)
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
- 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