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