vli_num_bits(9)
π vli_num_bits(9) β the Kernel API Manual, bestie edition
Okay so real talk: this is a page from the Kernel API Manual, and the star of the show is vli_num_bits(9). If you've ever wondered "how many bits do I actually need to hold this vli," this function is literally the answer. No cap. β¨
πΈ NAME πΈ
vli_num_bits β Counts the number of bits required for vli.
That's it. That's the whole job. It counts bits. It's giving "small but mighty" energy and honestly? Iconic. π
β¨ SYNOPSIS β¨
unsigned int vli_num_bits (const u64 *vli , unsigned int ndigits );
Look at that signature. Clean. Precise. unsigned int going in, unsigned int coming out, const u64 * holding it down in the middle. Periodt. π
π¦ ARGUMENTS π¦
Here's what you're feeding it, bestie:
vliβ vli to check. This is the thing you're asking about. The main character, if you will. π«Άndigitsβ Length of the vli. Because a pointer alone isn't gonna tell us how long the thing is β we need the digits count too. Important detail, don't skip it. π
π₯ RETURN π₯
The number of bits required to represent vli.
That's the whole return value β a single unsigned int telling you exactly how many bits you need. No struct, no error code, no out-params, just a nice tidy number. Slay. β
π SEE ALSO π
Alright, gather round, because there's a whole friend group here and they all live in the kernel file ./include/crypto/internal/ecc.h:
ecc_swap_digits(9)ecc_digits_from_bytes(9)ecc_is_key_valid(9)ecc_gen_privkey(9)ecc_make_pub_key(9)crypto_ecdh_shared_secret(9)ecc_is_pubkey_valid_partial(9)ecc_is_pubkey_valid_full(9)vli_is_zero(9)vli_cmp(9)vli_sub(9)vli_from_be64(9)vli_from_le64(9)vli_mod_inv(9)vli_mod_mult_slow(9)ecc_alloc_point(9)ecc_free_point(9)ecc_point_is_zero(9)ecc_point_mult_shamir(9)
That's the whole squad β ECC key stuff, point math, the other vli_* besties, all of it. Go say hi. π
Heads up: this page comes from ./include/crypto/internal, and the version you're reading is dated October 2026. Make sure you're looking at the right one, k? π
And that's the page!! Sending you off with a big sparkly goodbye from the Kernel API Manual gang β ./include/crypto/internal, October 2026, 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