Blame doc/man3/BN_new.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
BN_new, BN_secure_new, BN_clear, BN_free, BN_clear_free - allocate and free BIGNUMs
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/bn.h>
Packit c4476c
Packit c4476c
 BIGNUM *BN_new(void);
Packit c4476c
Packit c4476c
 BIGNUM *BN_secure_new(void);
Packit c4476c
Packit c4476c
 void BN_clear(BIGNUM *a);
Packit c4476c
Packit c4476c
 void BN_free(BIGNUM *a);
Packit c4476c
Packit c4476c
 void BN_clear_free(BIGNUM *a);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
BN_new() allocates and initializes a B<BIGNUM> structure.
Packit c4476c
BN_secure_new() does the same except that the secure heap
Packit c4476c
L<OPENSSL_secure_malloc(3)> is used to store the value.
Packit c4476c
Packit c4476c
BN_clear() is used to destroy sensitive data such as keys when they
Packit c4476c
are no longer needed. It erases the memory used by B and sets it
Packit c4476c
to the value 0.
Packit c4476c
If B is NULL, nothing is done.
Packit c4476c
Packit c4476c
BN_free() frees the components of the B<BIGNUM>, and if it was created
Packit c4476c
by BN_new(), also the structure itself. BN_clear_free() additionally
Packit c4476c
overwrites the data before the memory is returned to the system.
Packit c4476c
If B is NULL, nothing is done.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
BN_new() and BN_secure_new()
Packit c4476c
return a pointer to the B<BIGNUM> initialised to the value 0.
Packit c4476c
If the allocation fails,
Packit c4476c
they return B<NULL> and set an error code that can be obtained
Packit c4476c
by L<ERR_get_error(3)>.
Packit c4476c
Packit c4476c
BN_clear(), BN_free() and BN_clear_free() have no return values.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ERR_get_error(3)>, L<OPENSSL_secure_malloc(3)>
Packit c4476c
Packit c4476c
=head1 HISTORY
Packit c4476c
Packit c4476c
BN_init() was removed in OpenSSL 1.1.0; use BN_new() instead.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut