OpenBSD manual page server

Manual Page Search Parameters

BN_COPY(3) Library Functions Manual BN_COPY(3)

BN_copy, BN_dup, BN_with_flagscopy BIGNUMs

#include <openssl/bn.h>

BIGNUM *
BN_copy(BIGNUM *to, const BIGNUM *from);

BIGNUM *
BN_dup(const BIGNUM *from);

void
BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags);

() copies from to to.

() creates a new BIGNUM containing the value from.

() creates a shallow copy of b in dest. It places significant restrictions on the copied data. Applications that do not adhere to these restrictions may encounter unexpected side effects or crashes. For that reason, use of this function is discouraged.

Any flags provided in flags will be set in dest in addition to any flags already set in b. For example, this can be used to create a temporary copy of a BIGNUM with the BN_FLG_CONSTTIME flag set for constant time operations.

The temporary copy in dest will share some internal state with b. For this reason, the following restrictions apply to the use of dest:

BN_copy() returns to on success or NULL on error. BN_dup() returns the new BIGNUM or NULL on error. The error codes can be obtained by ERR_get_error(3).

BN_new(3), BN_set_flags(3)

BN_copy() and BN_dup() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.

BN_with_flags() first appeared in OpenSSL 0.9.7h and 0.9.8a and has been available since OpenBSD 4.0.

December 6, 2021 OpenBSD-7.4