BN_copy.3ssl - Man Page

copy BIGNUMs

Synopsis

 #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);

Description

BN_copy() copies from to to. BN_dup() creates a new BIGNUM containing the value from.

BN_with_flags creates a temporary shallow copy of b in dest. It places significant restrictions on the copied data. Applications that do no 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 might commonly 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:

Return Values

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

See Also

ERR_get_error(3)

Referenced By

The man pages BN_dup.3ssl(3) and BN_with_flags.3ssl(3) are aliases of BN_copy.3ssl(3).

2024-01-25 1.1.1q OpenSSL