1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos BN_CTX_start, BN_CTX_get, BN_CTX_end - use temporary BIGNUM variables 6 1.1 christos 7 1.1 christos =head1 SYNOPSIS 8 1.1 christos 9 1.1 christos #include <openssl/bn.h> 10 1.1 christos 11 1.1 christos void BN_CTX_start(BN_CTX *ctx); 12 1.1 christos 13 1.1 christos BIGNUM *BN_CTX_get(BN_CTX *ctx); 14 1.1 christos 15 1.1 christos void BN_CTX_end(BN_CTX *ctx); 16 1.1 christos 17 1.1 christos =head1 DESCRIPTION 18 1.1 christos 19 1.1 christos These functions are used to obtain temporary B<BIGNUM> variables from 20 1.1 christos a B<BN_CTX> (which can been created by using L<BN_CTX_new(3)>) 21 1.1 christos in order to save the overhead of repeatedly creating and 22 1.1 christos freeing B<BIGNUM>s in functions that are called from inside a loop. 23 1.1 christos 24 1.1 christos A function must call BN_CTX_start() first. Then, BN_CTX_get() may be 25 1.1 christos called repeatedly to obtain temporary B<BIGNUM>s. All BN_CTX_get() 26 1.1 christos calls must be made before calling any other functions that use the 27 1.1 christos B<ctx> as an argument. 28 1.1 christos 29 1.1 christos Finally, BN_CTX_end() must be called before returning from the function. 30 1.1.1.2 christos If B<ctx> is NULL, nothing is done. 31 1.1 christos When BN_CTX_end() is called, the B<BIGNUM> pointers obtained from 32 1.1 christos BN_CTX_get() become invalid. 33 1.1 christos 34 1.1 christos =head1 RETURN VALUES 35 1.1 christos 36 1.1 christos BN_CTX_start() and BN_CTX_end() return no values. 37 1.1 christos 38 1.1 christos BN_CTX_get() returns a pointer to the B<BIGNUM>, or B<NULL> on error. 39 1.1 christos Once BN_CTX_get() has failed, the subsequent calls will return B<NULL> 40 1.1 christos as well, so it is sufficient to check the return value of the last 41 1.1 christos BN_CTX_get() call. In case of an error, an error code is set, which 42 1.1 christos can be obtained by L<ERR_get_error(3)>. 43 1.1 christos 44 1.1 christos 45 1.1 christos =head1 SEE ALSO 46 1.1 christos 47 1.1 christos L<BN_CTX_new(3)> 48 1.1 christos 49 1.1 christos =head1 COPYRIGHT 50 1.1 christos 51 1.1.1.3 christos Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. 52 1.1 christos 53 1.1.1.3 christos Licensed under the Apache License 2.0 (the "License"). You may not use 54 1.1 christos this file except in compliance with the License. You can obtain a copy 55 1.1 christos in the file LICENSE in the source distribution or at 56 1.1 christos L<https://www.openssl.org/source/license.html>. 57 1.1 christos 58 1.1 christos =cut 59