diff options
Diffstat (limited to 'src/lib/libcrypto/man/BN_cmp.3')
-rw-r--r-- | src/lib/libcrypto/man/BN_cmp.3 | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BN_cmp.3 b/src/lib/libcrypto/man/BN_cmp.3 new file mode 100644 index 0000000000..b0a03b25ce --- /dev/null +++ b/src/lib/libcrypto/man/BN_cmp.3 | |||
@@ -0,0 +1,99 @@ | |||
1 | .Dd $Mdocdate: February 23 2015 $ | ||
2 | .Dt BN_CMP 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BN_cmp , | ||
6 | .Nm BN_ucmp , | ||
7 | .Nm BN_is_zero , | ||
8 | .Nm BN_is_one , | ||
9 | .Nm BN_is_word , | ||
10 | .Nm BN_is_odd | ||
11 | .Nd BIGNUM comparison and test functions | ||
12 | .Sh SYNOPSIS | ||
13 | .In openssl/bn.h | ||
14 | .Ft int | ||
15 | .Fo BN_cmp | ||
16 | .Fa "BIGNUM *a" | ||
17 | .Fa "BIGNUM *b" | ||
18 | .Fc | ||
19 | .Ft int | ||
20 | .Fo BN_ucmp | ||
21 | .Fa "BIGNUM *a" | ||
22 | .Fa "BIGNUM *b" | ||
23 | .Fc | ||
24 | .Ft int | ||
25 | .Fo BN_is_zero | ||
26 | .Fa "BIGNUM *a" | ||
27 | .Fc | ||
28 | .Ft int | ||
29 | .Fo BN_is_one | ||
30 | .Fa "BIGNUM *a" | ||
31 | .Fc | ||
32 | .Ft int | ||
33 | .Fo BN_is_word | ||
34 | .Fa "BIGNUM *a" | ||
35 | .Fa "BN_ULONG w" | ||
36 | .Fc | ||
37 | .Ft int | ||
38 | .Fo BN_is_odd | ||
39 | .Fa "BIGNUM *a" | ||
40 | .Fc | ||
41 | .Sh DESCRIPTION | ||
42 | .Fn BN_cmp | ||
43 | compares the numbers | ||
44 | .Fa a | ||
45 | and | ||
46 | .Fa b . | ||
47 | .Fn BN_ucmp | ||
48 | compares their absolute values. | ||
49 | .Pp | ||
50 | .Fn BN_is_zero , | ||
51 | .Fn BN_is_one | ||
52 | and | ||
53 | .Fn BN_is_word | ||
54 | test if | ||
55 | .Fa a | ||
56 | equals 0, 1, or | ||
57 | .Fa w | ||
58 | respectively. | ||
59 | .Fn BN_is_odd | ||
60 | tests if a is odd. | ||
61 | .Pp | ||
62 | .Fn BN_is_zero , | ||
63 | .Fn BN_is_one , | ||
64 | .Fn BN_is_word , | ||
65 | and | ||
66 | .Fn BN_is_odd | ||
67 | are macros. | ||
68 | .Sh RETURN VALUES | ||
69 | .Fn BN_cmp | ||
70 | returns -1 if | ||
71 | .Fa a Ns < Ns Fa b , | ||
72 | 0 if | ||
73 | .Fa a Ns == Ns Fa b , | ||
74 | and 1 if | ||
75 | .Fa a Ns > Ns Fa b . | ||
76 | .Fn BN_ucmp | ||
77 | is the same using the absolute values of | ||
78 | .Fa a | ||
79 | and | ||
80 | .Fa b . | ||
81 | .Pp | ||
82 | .Fn BN_is_zero , | ||
83 | .Fn BN_is_one , | ||
84 | .Fn BN_is_word , | ||
85 | and | ||
86 | .Fn BN_is_odd | ||
87 | return 1 if the condition is true, 0 otherwise. | ||
88 | .Sh SEE ALSO | ||
89 | .Xr bn 3 | ||
90 | .Sh HISTORY | ||
91 | .Fn BN_cmp , | ||
92 | .Fn BN_ucmp , | ||
93 | .Fn BN_is_zero , | ||
94 | .Fn BN_is_one | ||
95 | and | ||
96 | .Fn BN_is_word | ||
97 | are available in all versions of SSLeay and OpenSSL. | ||
98 | .Fn BN_is_odd | ||
99 | was added in SSLeay 0.8. | ||