5 BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
10 #include <openssl/bn.h>
12 void BN_zero(BIGNUM *a);
13 int BN_one(BIGNUM *a);
15 const BIGNUM *BN_value_one(void);
17 int BN_set_word(BIGNUM *a, BN_ULONG w);
18 unsigned BN_ULONG BN_get_word(BIGNUM *a);
22 B<BN_ULONG> is a macro that will be an unsigned integral type optimized
23 for the most efficient implementation on the local platform.
25 BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
26 B<w> respectively. BN_zero() and BN_one() are macros.
28 BN_value_one() returns a B<BIGNUM> constant of value 1. This constant
29 is useful for use in comparisons and assignment.
31 BN_get_word() returns B<a>, if it can be represented as a B<BN_ULONG>.
35 BN_get_word() returns the value B<a>, or all-bits-set if B<a> cannot
36 be represented as a single integer.
38 BN_one() and BN_set_word() return 1 on success, 0 otherwise.
39 BN_value_one() returns the constant.
40 BN_zero() never fails and returns no value.
44 If a B<BIGNUM> is equal to the value of all-bits-set, it will collide
45 with the error condition returned by BN_get_word() which uses that
48 B<BN_ULONG> should probably be a typedef.
56 In OpenSSL 0.9.8, BN_zero() was changed to not return a value; previous
57 versions returned an int.
61 Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
63 Licensed under the Apache License 2.0 (the "License"). You may not use
64 this file except in compliance with the License. You can obtain a copy
65 in the file LICENSE in the source distribution or at
66 L<https://www.openssl.org/source/license.html>.