Manual pages for EVP_Open* and EVP_Seal*
[openssl.git] / doc / crypto / BN_CTX_start.pod
1 =pod
2
3 =head1 NAME
4
5 BN_CTX_start, BN_CTX_get, BN_CTX_end - use temporary BIGNUM variables
6
7 =head1 SYNOPSIS
8
9  #include <openssl/bn.h>
10
11  void BN_CTX_start(BN_CTX *ctx);
12
13  BIGNUM *BN_CTX_get(BN_CTX *ctx);
14
15  void BN_CTX_end(BN_CTX *ctx);
16
17 =head1 DESCRIPTION
18
19 These functions are used to obtain temporary B<BIGNUM> variables from
20 a B<BN_CTX> in order to save the overhead of repeatedly creating and
21 freeing B<BIGNUM>s in functions that are called from inside a loop.
22
23 A function must call BN_CTX_start() first. Then, BN_CTX_get() may be
24 called repeatedly to obtain temporary B<BIGNUM>s. All BN_CTX_get()
25 calls must be made before calling any other functions that use the
26 B<ctx> as an argument.
27
28 Finally, BN_CTX_end() must be called before returning from the function.
29 When BN_CTX_end() is called, the B<BIGNUM> pointers obtained from
30 BN_CTX_get() become invalid.
31
32 =head1 RETURN VALUES
33
34 BN_CTX_start() and BN_CTX_end() return no values.
35
36 BN_CTX_get() returns a pointer to the B<BIGNUM>, or B<NULL> on error.
37 Once BN_CTX_get() has failed, the subsequent calls will return B<NULL>
38 as well, so it is sufficient to check the return value of the last
39 BN_CTX_get() call. In case of an error, an error code is set, which
40 can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
41
42
43 =head1 SEE ALSO
44
45 L<BN_CTX_new(3)|BN_CTX_new(3)>
46
47 =head1 HISTORY
48
49 BN_CTX_start(), BN_CTX_get() and BN_CTX_end() were added in OpenSSL 0.9.5.
50
51 =cut