DSA_SIZE(3SSL)
π DSA_SIZE β bestie edition
okay so this is a page from the OpenSSL manual, third section of the SSL-ish library family, and no cap it's a short one. It's all about three lil deprecated DSA helper functions: DSA_size, DSA_bits, and DSA_security_bits. Let's get into it π«Ά
β¨ NAME β¨
DSA_size, DSA_bits, DSA_security_bits β get your DSA signature size, your key bits, or your security bits. three little queries, one page, one vibe πΈ
β¨ SYNOPSIS β¨
First things first, bestie, you gotta include the header:
#include <openssl/dsa.h>
β οΈ okay so listen: the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by definingOPENSSL_API_COMPATwith a suitable version value. Go readopenssl_user_macros(7)for the deets, iykyk.
int DSA_bits(const DSA *dsa);
int DSA_size(const DSA *dsa);
int DSA_security_bits(const DSA *dsa);
β¨ DESCRIPTION β¨
okay so lowkey the first thing you need to know: ALL of the functions described on this page are deprecated. Like, every single one π If you're writing an application, pleaseee instead use EVP_PKEY_get_bits(3), EVP_PKEY_get_security_bits(3), and EVP_PKEY_get_size(3). That's the slay route. That's the main character move. π
But for the record, here's what each one did:
DSA_bits()β returns the number of bits in keydsa. And like, specifically? it's the number of bits in thepparameter. that's it. that's the number. πDSA_size()β returns the maximum size of an ASN.1 encoded DSA signature for keydsa, in bytes. Real talk: this is your girl for figuring out how much memory you need to allocate for a DSA signature. Girl math but make it malloc. β¨DSA_security_bits()β returns the number of security bits of the givendsakey. If you're curious where that comes from, go peek atBN_security_bits(3). π¦
β¨ RETURN VALUES β¨
here's the tea, three separate flavors of it:
DSA_security_bits()β returns the number of security bits in the key, or-1ifdsadoesn't hold any key parameters. πDSA_bits()β returns the number of bits in the key, or-1ifdsadoesn't hold any key parameters. πDSA_size()β returns the signature size in bytes, or-1ifdsadoesn't hold any key parameters. π
so like... -1 three times. not me being the messenger of bad news every single time. anyway π«Ά
β¨ SEE ALSO β¨
go read these too bestie, they're the glow-up versions:
β¨ HISTORY β¨
All of these functions were deprecated in OpenSSL 3.0. periodt. that's the whole history section. iconic of them honestly. π
β¨ COPYRIGHT β¨
Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
ok that's the whole page bestie!! π remember: deprecated means deprec-ATED, so go use theEVP_PKEYgirlies instead, and may your-1never appear π
this was OpenSSL 4.0.3, dated 2026-09-29, straight from the DSA_SIZE(3SSL) era. mwah, love u, bye ππ¦β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms