diff options
Diffstat (limited to 'src/lib/libcrypto/man/BN_CTX_start.3')
-rw-r--r-- | src/lib/libcrypto/man/BN_CTX_start.3 | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BN_CTX_start.3 b/src/lib/libcrypto/man/BN_CTX_start.3 new file mode 100644 index 0000000000..986208ba1a --- /dev/null +++ b/src/lib/libcrypto/man/BN_CTX_start.3 | |||
@@ -0,0 +1,85 @@ | |||
1 | .Dd $Mdocdate: February 23 2015 $ | ||
2 | .Dt BN_CTX_START 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BN_CTX_start , | ||
6 | .Nm BN_CTX_get , | ||
7 | .Nm BN_CTX_end | ||
8 | .Nd use temporary BIGNUM variables | ||
9 | .Sh SYNOPSIS | ||
10 | .In openssl/bn.h | ||
11 | .Ft void | ||
12 | .Fo BN_CTX_start | ||
13 | .Fa "BN_CTX *ctx" | ||
14 | .Fc | ||
15 | .Ft BIGNUM * | ||
16 | .Fo BN_CTX_get | ||
17 | .Fa "BN_CTX *ctx" | ||
18 | .Fc | ||
19 | .Ft void | ||
20 | .Fo BN_CTX_end | ||
21 | .Fa "BN_CTX *ctx" | ||
22 | .Fc | ||
23 | .Sh DESCRIPTION | ||
24 | These functions are used to obtain temporary | ||
25 | .Vt BIGNUM | ||
26 | variables from a | ||
27 | .Vt BN_CTX | ||
28 | (which can been created by using | ||
29 | .Xr BN_CTX_new 3 ) | ||
30 | in order to save the overhead of repeatedly creating and freeing | ||
31 | .Vt BIGNUM Ns s | ||
32 | in functions that are called from inside a loop. | ||
33 | .Pp | ||
34 | A function must call | ||
35 | .Fn BN_CTX_start | ||
36 | first. | ||
37 | Then, | ||
38 | .Fn BN_CTX_get | ||
39 | may be called repeatedly to obtain temporary | ||
40 | .Vt BIGNUM Ns s. | ||
41 | All | ||
42 | .Fn BN_CTX_get | ||
43 | calls must be made before calling any other functions that use the | ||
44 | .Fa ctx | ||
45 | as an argument. | ||
46 | .Pp | ||
47 | Finally, | ||
48 | .Fn BN_CTX_end | ||
49 | must be called before returning from the function. | ||
50 | When | ||
51 | .Fn BN_CTX_end | ||
52 | is called, the | ||
53 | .Vt BIGNUM | ||
54 | pointers obtained from | ||
55 | .Fn BN_CTX_get | ||
56 | become invalid. | ||
57 | .Sh RETURN VALUES | ||
58 | .Fn BN_CTX_start | ||
59 | and | ||
60 | .Fn BN_CTX_end | ||
61 | return no values. | ||
62 | .Pp | ||
63 | .Fn BN_CTX_get | ||
64 | returns a pointer to the | ||
65 | .Vt BIGNUM , | ||
66 | or | ||
67 | .Dv NULL | ||
68 | on error. | ||
69 | Once | ||
70 | .Fn BN_CTX_get | ||
71 | has failed, the subsequent calls will return | ||
72 | .Dv NULL | ||
73 | as well, so it is sufficient to check the return value of the last | ||
74 | .Fn BN_CTX_get | ||
75 | call. | ||
76 | In case of an error, an error code is set, which can be obtained by | ||
77 | .Xr ERR_get_error 3 . | ||
78 | .Sh SEE ALSO | ||
79 | .Xr BN_CTX_new 3 | ||
80 | .Sh HISTORY | ||
81 | .Fn BN_CTX_start , | ||
82 | .Fn BN_CTX_get , | ||
83 | and | ||
84 | .Fn BN_CTX_end | ||
85 | were added in OpenSSL 0.9.5. | ||