1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | BN_add_word, BN_sub_word, BN_mul_word, BN_div_word, BN_mod_word - arithmetic
|
---|
6 | functions on BIGNUMs with integers
|
---|
7 |
|
---|
8 | =head1 SYNOPSIS
|
---|
9 |
|
---|
10 | #include <openssl/bn.h>
|
---|
11 |
|
---|
12 | int BN_add_word(BIGNUM *a, BN_ULONG w);
|
---|
13 |
|
---|
14 | int BN_sub_word(BIGNUM *a, BN_ULONG w);
|
---|
15 |
|
---|
16 | int BN_mul_word(BIGNUM *a, BN_ULONG w);
|
---|
17 |
|
---|
18 | BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
|
---|
19 |
|
---|
20 | BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
|
---|
21 |
|
---|
22 | =head1 DESCRIPTION
|
---|
23 |
|
---|
24 | These functions perform arithmetic operations on BIGNUMs with unsigned
|
---|
25 | integers. They are much more efficient than the normal BIGNUM
|
---|
26 | arithmetic operations.
|
---|
27 |
|
---|
28 | BN_add_word() adds B<w> to B<a> (C<a+=w>).
|
---|
29 |
|
---|
30 | BN_sub_word() subtracts B<w> from B<a> (C<a-=w>).
|
---|
31 |
|
---|
32 | BN_mul_word() multiplies B<a> and B<w> (C<a*=w>).
|
---|
33 |
|
---|
34 | BN_div_word() divides B<a> by B<w> (C<a/=w>) and returns the remainder.
|
---|
35 |
|
---|
36 | BN_mod_word() returns the remainder of B<a> divided by B<w> (C<a%w>).
|
---|
37 |
|
---|
38 | For BN_div_word() and BN_mod_word(), B<w> must not be 0.
|
---|
39 |
|
---|
40 | =head1 RETURN VALUES
|
---|
41 |
|
---|
42 | BN_add_word(), BN_sub_word() and BN_mul_word() return 1 for success, 0
|
---|
43 | on error. The error codes can be obtained by L<ERR_get_error(3)>.
|
---|
44 |
|
---|
45 | BN_mod_word() and BN_div_word() return B<a>%B<w> on success and
|
---|
46 | B<(BN_ULONG)-1> if an error occurred.
|
---|
47 |
|
---|
48 | =head1 SEE ALSO
|
---|
49 |
|
---|
50 | L<ERR_get_error(3)>, L<BN_add(3)>
|
---|
51 |
|
---|
52 | =head1 COPYRIGHT
|
---|
53 |
|
---|
54 | Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
|
---|
55 |
|
---|
56 | Licensed under the OpenSSL license (the "License"). You may not use
|
---|
57 | this file except in compliance with the License. You can obtain a copy
|
---|
58 | in the file LICENSE in the source distribution or at
|
---|
59 | L<https://www.openssl.org/source/license.html>.
|
---|
60 |
|
---|
61 | =cut
|
---|