---
name: "libressl-RSA_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-RSA_size"
---

# libressl-RSA\_size(3)

get the RSA modulus size

## NAME

**RSA\_size**, **RSA\_bits** – get the RSA modulus size

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*int*\

**RSA\_size**(*const RSA \*rsa*);

*int*\

**RSA\_bits**(*const RSA \*rsa*);

## DESCRIPTION

**RSA\_size**() returns the RSA modulus size in bytes. It can be used to determine how much memory must be allocated for an RSA encrypted value.

**RSA\_bits**() returns the number of significant bits.

*rsa* and *rsa-\>n* must not be NULL.

## RETURN VALUES

The size.

## SEE ALSO

BN\_num\_bits(3), RSA\_get0\_key(3), RSA\_new(3), RSA\_security\_bits(3)

## HISTORY

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

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