Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

Sortix nightly manual

This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.

NAME

RSA_size, RSA_bits — get the RSA modulus size

SYNOPSIS

#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.
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org