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