crypto_krb5_how_much_data(9)
π crypto_krb5_how_much_data β a Kernel API Manual moment (section 9, bestie)
okay so this is <rainbow>crypto_krb5_how_much_data(9)</rainbow> from the Kernel API Manual, and it's literally the "how many snacks fit in this bag" function but for crypto buffers π
β¨ NAME β¨
crypto_krb5_how_much_data β work out how much data can fit in an amount of buffer π«Ά
β¨ SYNOPSIS β¨
size_t crypto_krb5_how_much_data (const struct krb5_enctype *krb5 , enum
krb5_crypto_mode mode , size_t *_buffer_size , size_t *_offset );
like, that's the whole vibe. one call, four args, size_t coming back at you π
β¨ ARGUMENTS β¨
krb5β the encoding to use π« (the main character struct,const struct krb5_enctype *)modeβ the mode in which to operated (checksum/encrypt) π yes "operated", that's what the og says, we're keeping it, no cap_buffer_sizeβ how much buffer we want to allow for (may be reduced) π§ heads up: this lil pointer's value can get shrunk, so don't be shocked_offsetβ where to place the offset into the buffer πΈ
β¨ DESCRIPTION β¨
so the whole job is: calculate how much data can be fitted into a given amount of buffer β and honestly? it ate.
it allows for a confounder, padding and checksum as appropriate π₯ like it does the math on all the extra stuff that has to fit too, so you don't get caught lacking.
here's the rundown of what comes back out, because there's three separate things happening and you need all of them:
- the amount of data that will fit is returned π
- the amount of buffer required is shrunk to allow for alignment π (yes, your
_buffer_sizegets reduced, that's the "may be reduced" from up top, iykyk) - the offset into the buffer at which the data will start is placed in
*_offsetπ¦
lowkey important: that buffer size going down is by design, not a bug. don't come for her π
β¨ SEE ALSO β¨
kernel file <purple>./crypto/krb5/krb5_api.c</purple> plus the whole friend group π:
crypto_krb5_find_enctype(9)crypto_krb5_how_much_buffer(9)crypto_krb5_where_is_the_data(9)crypto_krb5_check_data_len(9)crypto_krb5_prepare_encryption(9)crypto_krb5_prepare_checksum(9)crypto_krb5_encrypt(9)crypto_krb5_decrypt(9)crypto_krb5_get_mic(9)crypto_krb5_verify_mic(9)
and that's the page!! π brought to you by <pink>./crypto/krb5</pink>, dated <hotpink>October 2026</hotpink> β mwah, go read the whole krb5 squad, 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