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