summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BN_add_word.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/BN_add_word.3')
-rw-r--r--src/lib/libcrypto/man/BN_add_word.3123
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
39These functions perform arithmetic operations on BIGNUMs with unsigned
40integers.
41They are much more efficient than the normal BIGNUM arithmetic
42operations.
43.Pp
44.Fn BN_add_word
45adds
46.Fa w
47to
48.Fa a
49.Pq Li a+=w .
50.Pp
51.Fn BN_sub_word
52subtracts
53.Fa w
54from
55.Fa a
56.Pq Li a-=w .
57.Pp
58.Fn BN_mul_word
59multiplies
60.Fa a
61and
62.Fa w
63.Pq Li a*=w .
64.Pp
65.Fn BN_div_word
66divides
67.Fa a
68by
69.Fa w
70.Pq Li a/=w
71and returns the remainder.
72.Pp
73.Fn BN_mod_word
74returns the remainder of
75.Fa a
76divided by
77.Fa w
78.Pq Li a%w .
79.Pp
80For
81.Fn BN_div_word
82and
83.Fn BN_mod_word ,
84.Fa w
85must not be 0.
86.Sh RETURN VALUES
87.Fn BN_add_word ,
88.Fn BN_sub_word ,
89and
90.Fn BN_mul_word
91return 1 for success, 0 on error.
92The error codes can be obtained by
93.Xr ERR_get_error 3 .
94.Pp
95.Fn BN_mod_word
96and
97.Fn BN_div_word
98return
99.Fa a Ns % Ns Fa w
100on success and
101.Pq Vt BN_ULONG Ns -1
102if 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
109and
110.Fn BN_mod_word
111are available in all versions of SSLeay and OpenSSL.
112.Fn BN_div_word
113was added in SSLeay 0.8, and
114.Fn BN_sub_word
115and
116.Fn BN_mul_word
117in SSLeay 0.9.0.
118.Pp
119Before 0.9.8a, the return value for
120.Fn BN_div_word
121and
122.Fn BN_mod_word
123in case of an error was 0.