diff options
Diffstat (limited to 'src/lib/libcrypto/man/BN_add_word.3')
-rw-r--r-- | src/lib/libcrypto/man/BN_add_word.3 | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BN_add_word.3 b/src/lib/libcrypto/man/BN_add_word.3 new file mode 100644 index 0000000000..930aae4d32 --- /dev/null +++ b/src/lib/libcrypto/man/BN_add_word.3 | |||
@@ -0,0 +1,123 @@ | |||
1 | .Dd $Mdocdate: February 23 2015 $ | ||
2 | .Dt BN_ADD_WORD 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BN_add_word , | ||
6 | .Nm BN_sub_word , | ||
7 | .Nm BN_mul_word , | ||
8 | .Nm BN_div_word , | ||
9 | .Nm BN_mod_word | ||
10 | .Nd arithmetic functions on BIGNUMs with integers | ||
11 | .Sh SYNOPSIS | ||
12 | .In openssl/bn.h | ||
13 | .Ft int | ||
14 | .Fo BN_add_word | ||
15 | .Fa "BIGNUM *a" | ||
16 | .Fa "BN_ULONG w" | ||
17 | .Fc | ||
18 | .Ft int | ||
19 | .Fo BN_sub_word | ||
20 | .Fa "BIGNUM *a" | ||
21 | .Fa "BN_ULONG w" | ||
22 | .Fc | ||
23 | .Ft int | ||
24 | .Fo BN_mul_word | ||
25 | .Fa "BIGNUM *a" | ||
26 | .Fa "BN_ULONG w" | ||
27 | .Fc | ||
28 | .Ft BN_ULONG | ||
29 | .Fo BN_div_word | ||
30 | .Fa "BIGNUM *a" | ||
31 | .Fa "BN_ULONG w" | ||
32 | .Fc | ||
33 | .Ft BN_ULONG | ||
34 | .Fo BN_mod_word | ||
35 | .Fa "const BIGNUM *a" | ||
36 | .Fa "BN_ULONG w" | ||
37 | .Fc | ||
38 | .Sh DESCRIPTION | ||
39 | These functions perform arithmetic operations on BIGNUMs with unsigned | ||
40 | integers. | ||
41 | They are much more efficient than the normal BIGNUM arithmetic | ||
42 | operations. | ||
43 | .Pp | ||
44 | .Fn BN_add_word | ||
45 | adds | ||
46 | .Fa w | ||
47 | to | ||
48 | .Fa a | ||
49 | .Pq Li a+=w . | ||
50 | .Pp | ||
51 | .Fn BN_sub_word | ||
52 | subtracts | ||
53 | .Fa w | ||
54 | from | ||
55 | .Fa a | ||
56 | .Pq Li a-=w . | ||
57 | .Pp | ||
58 | .Fn BN_mul_word | ||
59 | multiplies | ||
60 | .Fa a | ||
61 | and | ||
62 | .Fa w | ||
63 | .Pq Li a*=w . | ||
64 | .Pp | ||
65 | .Fn BN_div_word | ||
66 | divides | ||
67 | .Fa a | ||
68 | by | ||
69 | .Fa w | ||
70 | .Pq Li a/=w | ||
71 | and returns the remainder. | ||
72 | .Pp | ||
73 | .Fn BN_mod_word | ||
74 | returns the remainder of | ||
75 | .Fa a | ||
76 | divided by | ||
77 | .Fa w | ||
78 | .Pq Li a%w . | ||
79 | .Pp | ||
80 | For | ||
81 | .Fn BN_div_word | ||
82 | and | ||
83 | .Fn BN_mod_word , | ||
84 | .Fa w | ||
85 | must not be 0. | ||
86 | .Sh RETURN VALUES | ||
87 | .Fn BN_add_word , | ||
88 | .Fn BN_sub_word , | ||
89 | and | ||
90 | .Fn BN_mul_word | ||
91 | return 1 for success, 0 on error. | ||
92 | The error codes can be obtained by | ||
93 | .Xr ERR_get_error 3 . | ||
94 | .Pp | ||
95 | .Fn BN_mod_word | ||
96 | and | ||
97 | .Fn BN_div_word | ||
98 | return | ||
99 | .Fa a Ns % Ns Fa w | ||
100 | on success and | ||
101 | .Pq Vt BN_ULONG Ns -1 | ||
102 | if an error occurred. | ||
103 | .Sh SEE ALSO | ||
104 | .Xr bn 3 , | ||
105 | .Xr BN_add 3 , | ||
106 | .Xr ERR_get_error 3 | ||
107 | .Sh HISTORY | ||
108 | .Fn BN_add_word | ||
109 | and | ||
110 | .Fn BN_mod_word | ||
111 | are available in all versions of SSLeay and OpenSSL. | ||
112 | .Fn BN_div_word | ||
113 | was added in SSLeay 0.8, and | ||
114 | .Fn BN_sub_word | ||
115 | and | ||
116 | .Fn BN_mul_word | ||
117 | in SSLeay 0.9.0. | ||
118 | .Pp | ||
119 | Before 0.9.8a, the return value for | ||
120 | .Fn BN_div_word | ||
121 | and | ||
122 | .Fn BN_mod_word | ||
123 | in case of an error was 0. | ||