DH_SIZE(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’– DH_SIZE(3) β€” get the Diffie-Hellman prime size, bestie πŸ’–

okay so this is the libcrypto page from the Library Functions Manual, and it is literally here to answer the iconic question: how big is this Diffie-Hellman prime? no cap, that's the whole vibe. πŸ’…

🌸 NAME 🌸

DH_size, DH_bits β€” get Diffie-Hellman prime size

✨ SYNOPSIS ✨

library β€œlibcrypto” #include <openssl/dh.h>

int
DH_size(const DH *dh);

int
DH_bits(const DH *dh);

πŸ¦‹ DESCRIPTION πŸ¦‹

DH_size() returns the Diffie-Hellman prime size in bytes. bestie, it can be used to determine how much memory must be allocated for the shared secret computed by DH_compute_key(3). so like, it's giving β€œhow much room do I need for this secret?” energy. πŸŽ€

DH_bits() returns the number of significant bits in the key. slay. ✨

⚠️ real talk: dh and dh->p must not be NULL. do not play with that, fr fr. πŸ’€

🫢 SEE ALSO 🫢

go read those if you want the full lore, iykyk. 🌈

πŸ‘‘ HISTORY πŸ‘‘

DH_size() first appeared in SSLeay 0.5.1 and has been available since OpenBSD 2.4. iconic behavior. πŸ’–

DH_bits() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 6.3. main character entrance, honestly. ⭐


mwah πŸ’‹ this cutie little page is from Debian, dated June 8, 2025 β€” bye bestie, go check your prime sizes responsibly! πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from