159191Skris=pod
259191Skris
359191Skris=head1 NAME
459191Skris
568651SkrisBN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
668651Skrisoperations
759191Skris
859191Skris=head1 SYNOPSIS
959191Skris
1059191Skris #include <openssl/bn.h>
1159191Skris
1259191Skris int BN_zero(BIGNUM *a);
1359191Skris int BN_one(BIGNUM *a);
1459191Skris
15109998Smarkm const BIGNUM *BN_value_one(void);
1659191Skris
17331638Sjkim int BN_set_word(BIGNUM *a, BN_ULONG w);
18331638Sjkim BN_ULONG BN_get_word(BIGNUM *a);
1959191Skris
2059191Skris=head1 DESCRIPTION
2159191Skris
22331638SjkimB<BN_ULONG> is a macro that will be an unsigned integral type optimied
23331638Sjkimfor the most efficient implementation on the local platform.
24331638Sjkim
2559191SkrisBN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
2659191SkrisB<w> respectively.  BN_zero() and BN_one() are macros.
2759191Skris
2859191SkrisBN_value_one() returns a B<BIGNUM> constant of value 1. This constant
2959191Skrisis useful for use in comparisons and assignment.
3059191Skris
31331638SjkimBN_get_word() returns B<a>, if it can be represented as a B<BN_ULONG>.
3259191Skris
3359191Skris=head1 RETURN VALUES
3459191Skris
35331638SjkimBN_get_word() returns the value B<a>, or all-bits-set if B<a> cannot
36331638Sjkimbe represented as a B<BN_ULONG>.
3759191Skris
3859191SkrisBN_zero(), BN_one() and BN_set_word() return 1 on success, 0 otherwise.
3959191SkrisBN_value_one() returns the constant.
4059191Skris
4159191Skris=head1 BUGS
4259191Skris
43331638SjkimIf a B<BIGNUM> is equal to the value of all-bits-set, it will collide
44331638Sjkimwith the error condition returned by BN_get_word() which uses that
45331638Sjkimas an error value.
4659191Skris
47331638SjkimB<BN_ULONG> should probably be a typedef.
4859191Skris
4959191Skris=head1 SEE ALSO
5059191Skris
5159191SkrisL<bn(3)|bn(3)>, L<BN_bn2bin(3)|BN_bn2bin(3)>
5259191Skris
5359191Skris=head1 HISTORY
5459191Skris
5559191SkrisBN_zero(), BN_one() and BN_set_word() are available in all versions of
5659191SkrisSSLeay and OpenSSL. BN_value_one() and BN_get_word() were added in
5759191SkrisSSLeay 0.8.
5859191Skris
59109998SmarkmBN_value_one() was changed to return a true const BIGNUM * in OpenSSL
60109998Smarkm0.9.7.
61109998Smarkm
6259191Skris=cut
63