OLD | NEW |
1 /* | 1 /* |
2 * mplogic.h | 2 * mplogic.h |
3 * | 3 * |
4 * Bitwise logical operations on MPI values | 4 * Bitwise logical operations on MPI values |
5 * | 5 * |
6 * This Source Code Form is subject to the terms of the Mozilla Public | 6 * This Source Code Form is subject to the terms of the Mozilla Public |
7 * License, v. 2.0. If a copy of the MPL was not distributed with this | 7 * License, v. 2.0. If a copy of the MPL was not distributed with this |
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
9 /* $Id$ */ | |
10 | 9 |
11 #ifndef _H_MPLOGIC_ | 10 #ifndef _H_MPLOGIC_ |
12 #define _H_MPLOGIC_ | 11 #define _H_MPLOGIC_ |
13 | 12 |
14 #include "mpi.h" | 13 #include "mpi.h" |
15 | 14 |
16 /* | 15 /* |
17 The logical operations treat an mp_int as if it were a bit vector, | 16 The logical operations treat an mp_int as if it were a bit vector, |
18 without regard to its sign (an mp_int is represented in a signed | 17 without regard to its sign (an mp_int is represented in a signed |
19 magnitude format). Values are treated as if they had an infinite | 18 magnitude format). Values are treated as if they had an infinite |
(...skipping 24 matching lines...) Expand all Loading... |
44 mp_err mpl_parity(mp_int *a); /* determine parity */ | 43 mp_err mpl_parity(mp_int *a); /* determine parity */ |
45 | 44 |
46 /* Get & Set the value of a bit */ | 45 /* Get & Set the value of a bit */ |
47 | 46 |
48 mp_err mpl_set_bit(mp_int *a, mp_size bitNum, mp_size value); | 47 mp_err mpl_set_bit(mp_int *a, mp_size bitNum, mp_size value); |
49 mp_err mpl_get_bit(const mp_int *a, mp_size bitNum); | 48 mp_err mpl_get_bit(const mp_int *a, mp_size bitNum); |
50 mp_err mpl_get_bits(const mp_int *a, mp_size lsbNum, mp_size numBits); | 49 mp_err mpl_get_bits(const mp_int *a, mp_size lsbNum, mp_size numBits); |
51 mp_err mpl_significant_bits(const mp_int *a); | 50 mp_err mpl_significant_bits(const mp_int *a); |
52 | 51 |
53 #endif /* end _H_MPLOGIC_ */ | 52 #endif /* end _H_MPLOGIC_ */ |
OLD | NEW |