KCAPI_PBKDF_ITERATIO(3)

✨ kcapi_pbkdf_iteration_count ✨

okay bestie, so this is a page from the libkcapi manual (section 3, the library-functions girlies πŸ’…) β€” and it's literally about figuring out how many rounds a PBKDF should do on your machine. no cap.


🌸 NAME 🌸

kcapi_pbkdf_iteration_count β€” Calculate numbers of iterations for a PBKDF

like... she counts. that's the whole job. iconic honestly.


πŸŽ€ SYNOPSIS πŸŽ€

uint32_t kcapi_pbkdf_iteration_count(const char * hashname,
                                     uint64_t timeshresh);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • hashname β€” [in] the kernel crypto API name of a keyed hash, bestie. think stuff like hmac(sha1). that's the vibe.
  • timeshresh β€” [in] a time duration in nanoseconds β€” the PBKDF operation has to take at least this long, no shortcuts. and okay here's the tea: if you pass 0, she doesn't just shrug, she uses a default of (1<<27) nanoseconds. noted. πŸ“

πŸ’– DESCRIPTION πŸ’–

so what she does is: she measures the time the PBKDF operation actually takes, across different round counts, for the keyed message digest type you handed her. like a little science experiment but make it crypto πŸ§ͺ✨

the result? take it as the iteration count for a PBKDF operation. that's the whole point, that's the assignment, she ate.

🚨 and now the important part, don't skip: if an error occurs with the PBKDF calculation, a value of 1<<18 is returned. so if you see that number, that's not a flex, that's a problem bestie. 😭

and she returns the number of iterations a PBKDF should take on this computer. yes, this computer. it's giving very personalized. πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de> β€” Author.

(thank you king, we love a credited author 🫢)


part of the libkcapi Manual, version 1.5.0.


and that's the whole page bestie, hope it slayed πŸ’–

okay so real talk for the sign-off: this was the libkcapi Manual, version 1.5.0, dated July 2025 β€” that's the source and the version and the date, all accounted for, nothing skipped, periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from