xref: /onnv-gate/usr/src/common/openssl/doc/crypto/BN_zero.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
6*2175Sjp161948operations
7*2175Sjp161948
8*2175Sjp161948=head1 SYNOPSIS
9*2175Sjp161948
10*2175Sjp161948 #include <openssl/bn.h>
11*2175Sjp161948
12*2175Sjp161948 int BN_zero(BIGNUM *a);
13*2175Sjp161948 int BN_one(BIGNUM *a);
14*2175Sjp161948
15*2175Sjp161948 const BIGNUM *BN_value_one(void);
16*2175Sjp161948
17*2175Sjp161948 int BN_set_word(BIGNUM *a, unsigned long w);
18*2175Sjp161948 unsigned long BN_get_word(BIGNUM *a);
19*2175Sjp161948
20*2175Sjp161948=head1 DESCRIPTION
21*2175Sjp161948
22*2175Sjp161948BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
23*2175Sjp161948B<w> respectively.  BN_zero() and BN_one() are macros.
24*2175Sjp161948
25*2175Sjp161948BN_value_one() returns a B<BIGNUM> constant of value 1. This constant
26*2175Sjp161948is useful for use in comparisons and assignment.
27*2175Sjp161948
28*2175Sjp161948BN_get_word() returns B<a>, if it can be represented as an unsigned
29*2175Sjp161948long.
30*2175Sjp161948
31*2175Sjp161948=head1 RETURN VALUES
32*2175Sjp161948
33*2175Sjp161948BN_get_word() returns the value B<a>, and 0xffffffffL if B<a> cannot
34*2175Sjp161948be represented as an unsigned long.
35*2175Sjp161948
36*2175Sjp161948BN_zero(), BN_one() and BN_set_word() return 1 on success, 0 otherwise.
37*2175Sjp161948BN_value_one() returns the constant.
38*2175Sjp161948
39*2175Sjp161948=head1 BUGS
40*2175Sjp161948
41*2175Sjp161948Someone might change the constant.
42*2175Sjp161948
43*2175Sjp161948If a B<BIGNUM> is equal to 0xffffffffL it can be represented as an
44*2175Sjp161948unsigned long but this value is also returned on error.
45*2175Sjp161948
46*2175Sjp161948=head1 SEE ALSO
47*2175Sjp161948
48*2175Sjp161948L<bn(3)|bn(3)>, L<BN_bn2bin(3)|BN_bn2bin(3)>
49*2175Sjp161948
50*2175Sjp161948=head1 HISTORY
51*2175Sjp161948
52*2175Sjp161948BN_zero(), BN_one() and BN_set_word() are available in all versions of
53*2175Sjp161948SSLeay and OpenSSL. BN_value_one() and BN_get_word() were added in
54*2175Sjp161948SSLeay 0.8.
55*2175Sjp161948
56*2175Sjp161948BN_value_one() was changed to return a true const BIGNUM * in OpenSSL
57*2175Sjp1619480.9.7.
58*2175Sjp161948
59*2175Sjp161948=cut
60