---
name: "libressl-DSA_size"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-DSA_size"
---

# libressl-DSA\_size(3)

get DSA signature or key size

## NAME

**DSA\_size**, **DSA\_bits** – get DSA signature or key size

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/dsa.h\>**

*int*\

**DSA\_size**(*const DSA \*dsa*);

*int*\

**DSA\_bits**(*const DSA \*dsa*);

## DESCRIPTION

**DSA\_size**() returns the maximum size of an ASN.1 encoded DSA signature for the key *dsa* in bytes. It can be used to determine how much memory must be allocated for a DSA signature.

*dsa-\>q* must not be NULL.

**DSA\_bits**() returns the number of significant bits in the public domain parameter *p* contained in *dsa*. This is also the number of bits in the public key.

## RETURN VALUES

**DSA\_size**() returns the size of the signature in bytes.

**DSA\_bits**() returns the size of the public key in bits.

## SEE ALSO

DSA\_get0\_pqg(3), DSA\_new(3), DSA\_security\_bits(3), DSA\_sign(3)

## HISTORY

**DSA\_size**() first appeared in SSLeay 0.6.0 and has been available since OpenBSD 2.4.

**DSA\_bits**() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 7.1.
