xref: /netbsd-src/crypto/external/bsd/openssl/dist/doc/man3/BN_zero.pod (revision b0d1725196a7921d003d2c66a14f186abda4176b)
113d40330Schristos=pod
213d40330Schristos
313d40330Schristos=head1 NAME
413d40330Schristos
513d40330SchristosBN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
613d40330Schristosoperations
713d40330Schristos
813d40330Schristos=head1 SYNOPSIS
913d40330Schristos
1013d40330Schristos #include <openssl/bn.h>
1113d40330Schristos
1213d40330Schristos void BN_zero(BIGNUM *a);
1313d40330Schristos int BN_one(BIGNUM *a);
1413d40330Schristos
1513d40330Schristos const BIGNUM *BN_value_one(void);
1613d40330Schristos
1713d40330Schristos int BN_set_word(BIGNUM *a, BN_ULONG w);
1813d40330Schristos unsigned BN_ULONG BN_get_word(BIGNUM *a);
1913d40330Schristos
2013d40330Schristos=head1 DESCRIPTION
2113d40330Schristos
2213d40330SchristosB<BN_ULONG> is a macro that will be an unsigned integral type optimized
2313d40330Schristosfor the most efficient implementation on the local platform.
2413d40330Schristos
2513d40330SchristosBN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
2613d40330SchristosB<w> respectively.  BN_zero() and BN_one() are macros.
2713d40330Schristos
2813d40330SchristosBN_value_one() returns a B<BIGNUM> constant of value 1. This constant
2913d40330Schristosis useful for use in comparisons and assignment.
3013d40330Schristos
3113d40330SchristosBN_get_word() returns B<a>, if it can be represented as a B<BN_ULONG>.
3213d40330Schristos
3313d40330Schristos=head1 RETURN VALUES
3413d40330Schristos
3513d40330SchristosBN_get_word() returns the value B<a>, or all-bits-set if B<a> cannot
3613d40330Schristosbe represented as a single integer.
3713d40330Schristos
3813d40330SchristosBN_one() and BN_set_word() return 1 on success, 0 otherwise.
3913d40330SchristosBN_value_one() returns the constant.
4013d40330SchristosBN_zero() never fails and returns no value.
4113d40330Schristos
4213d40330Schristos=head1 BUGS
4313d40330Schristos
4413d40330SchristosIf a B<BIGNUM> is equal to the value of all-bits-set, it will collide
4513d40330Schristoswith the error condition returned by BN_get_word() which uses that
4613d40330Schristosas an error value.
4713d40330Schristos
4813d40330SchristosB<BN_ULONG> should probably be a typedef.
4913d40330Schristos
5013d40330Schristos=head1 SEE ALSO
5113d40330Schristos
5213d40330SchristosL<BN_bn2bin(3)>
5313d40330Schristos
5413d40330Schristos=head1 HISTORY
5513d40330Schristos
5613d40330SchristosIn OpenSSL 0.9.8, BN_zero() was changed to not return a value; previous
5713d40330Schristosversions returned an int.
5813d40330Schristos
5913d40330Schristos=head1 COPYRIGHT
6013d40330Schristos
6113d40330SchristosCopyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
6213d40330Schristos
63*b0d17251SchristosLicensed under the Apache License 2.0 (the "License").  You may not use
6413d40330Schristosthis file except in compliance with the License.  You can obtain a copy
6513d40330Schristosin the file LICENSE in the source distribution or at
6613d40330SchristosL<https://www.openssl.org/source/license.html>.
6713d40330Schristos
6813d40330Schristos=cut
69