]>
Commit | Line | Data |
---|---|---|
dd8dec69 UM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
e1b78bc6 RL |
5 | BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment |
6 | operations | |
dd8dec69 UM |
7 | |
8 | =head1 SYNOPSIS | |
9 | ||
10 | #include <openssl/bn.h> | |
11 | ||
98186eb4 | 12 | void BN_zero(BIGNUM *a); |
dd8dec69 UM |
13 | int BN_one(BIGNUM *a); |
14 | ||
98499135 | 15 | const BIGNUM *BN_value_one(void); |
dd8dec69 | 16 | |
b713c4ff RS |
17 | int BN_set_word(BIGNUM *a, BN_ULONG w); |
18 | unsigned BN_ULONG BN_get_word(BIGNUM *a); | |
dd8dec69 UM |
19 | |
20 | =head1 DESCRIPTION | |
21 | ||
b713c4ff RS |
22 | B<BN_ULONG> is a macro that will be an unsigned integral type optimized |
23 | for the most efficient implementation on the local platform. | |
24 | ||
dd8dec69 UM |
25 | BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and |
26 | B<w> respectively. BN_zero() and BN_one() are macros. | |
27 | ||
28 | BN_value_one() returns a B<BIGNUM> constant of value 1. This constant | |
29 | is useful for use in comparisons and assignment. | |
30 | ||
b713c4ff | 31 | BN_get_word() returns B<a>, if it can be represented as a B<BN_ULONG>. |
dd8dec69 UM |
32 | |
33 | =head1 RETURN VALUES | |
34 | ||
b713c4ff RS |
35 | BN_get_word() returns the value B<a>, or all-bits-set if B<a> cannot |
36 | be represented as a single integer. | |
dd8dec69 | 37 | |
b3696a55 | 38 | BN_one() and BN_set_word() return 1 on success, 0 otherwise. |
dd8dec69 | 39 | BN_value_one() returns the constant. |
b3696a55 | 40 | BN_zero() never fails and returns no value. |
dd8dec69 UM |
41 | |
42 | =head1 BUGS | |
43 | ||
b713c4ff RS |
44 | If a B<BIGNUM> is equal to the value of all-bits-set, it will collide |
45 | with the error condition returned by BN_get_word() which uses that | |
46 | as an error value. | |
47 | ||
48 | B<BN_ULONG> should probably be a typedef. | |
15701211 | 49 | |
dd8dec69 UM |
50 | =head1 SEE ALSO |
51 | ||
9e183d22 | 52 | L<BN_bn2bin(3)> |
dd8dec69 | 53 | |
b3696a55 RS |
54 | =head1 HISTORY |
55 | ||
56 | In OpenSSL 0.9.8, BN_zero() was changed to not return a value; previous | |
57 | versions returned an int. | |
58 | ||
e2f92610 RS |
59 | =head1 COPYRIGHT |
60 | ||
b713c4ff | 61 | Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 62 | |
4746f25a | 63 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
64 | this file except in compliance with the License. You can obtain a copy |
65 | in the file LICENSE in the source distribution or at | |
66 | L<https://www.openssl.org/source/license.html>. | |
67 | ||
68 | =cut |