crypto_krb5_how_much_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_size gets 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 😭:


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