DSA_SIZE(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… DSA_SIZE(3ossl) β€” your lil' guide to DSA sizes & bits

okay so bestie, this is the DSA_SIZE(3ossl) page from the OpenSSL manual set, and before you get excited β€” yes, everything on it is deprecated. like, deprecated deprecated. but you still gotta know what it does, so let's go πŸŽ€


✨ NAME ✨

DSA_size, DSA_bits, DSA_security_bits β€” the girlies that tell you a DSA signature size, a key's bits, or its security bits πŸ’…


🌸 SYNOPSIS 🌸

First things first, you gotta pull in the header:

#include <openssl/dsa.h>

Now, hear me out β€” the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7):

int DSA_bits(const DSA *dsa);

int DSA_size(const DSA *dsa);

int DSA_security_bits(const DSA *dsa);

πŸ¦‹ DESCRIPTION πŸ¦‹

So. All of the functions described on this page are deprecated. every single one. 😭 Applications should instead use EVP_PKEY_get_bits(3), EVP_PKEY_get_security_bits(3) and EVP_PKEY_get_size(3). that's the vibe, that's the main character API now ✨

  • DSA_bits() β€” returns the number of bits in key dsa: literally the number of bits in the p parameter. no cap, that's it.
  • DSA_size() β€” returns the maximum size of an ASN.1 encoded DSA signature for key dsa, in bytes. it's giving "how much memory do I need to allocate for a DSA signature" energy 🫢
  • DSA_security_bits() β€” returns the number of security bits of the given dsa key. see BN_security_bits(3) for the deets.

πŸ”₯ RETURN VALUES πŸ”₯

  • DSA_security_bits() β€” returns the number of security bits in the key, or -1 if dsa doesn't hold any key parameters. (that -1 is the "no keys, no thoughts, head empty" answer πŸ’€)
  • DSA_bits() β€” returns the number of bits in the key, or -1 if dsa doesn't hold any key parameters.
  • DSA_size() β€” returns the signature size in bytes, or -1 if dsa doesn't hold any key parameters.

πŸ‘‘ SEE ALSO πŸ‘‘

EVP_PKEY_get_bits(3), EVP_PKEY_get_security_bits(3), EVP_PKEY_get_size(3), DSA_new(3), DSA_sign(3)

go read these, bestie, they're the glow-up versions 🌈


🧚 HISTORY 🧚

All of these functions were deprecated in OpenSSL 3.0. that's the whole history lesson, short and iconic πŸ’œ


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 🫢 don't come for me, I just report the deprecations πŸ’…

and that's a wrap, bestie β€” page DSA_SIZE(3ossl) from the OpenSSL 3.5.0 release, dated 2026-09-25. mwah πŸ’‹ ⭐

πŸ“¦ where this page comes from