Botan: src/math/mp/mp_types.h Source File

Botan 1.10.12

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

mp_types.h
Go to the documentation of this file.
1 /*
2 * Low Level MPI Types
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_MPI_TYPES_H__
9 #define BOTAN_MPI_TYPES_H__
10
11 #include <botan/types.h>
12
13 namespace Botan {
14
15 #if (BOTAN_MP_WORD_BITS == 8)
16 typedef byte word;
17 #elif (BOTAN_MP_WORD_BITS == 16)
18 typedef u16bit word;
19 #elif (BOTAN_MP_WORD_BITS == 32)
20 typedef u32bit word;
21 #elif (BOTAN_MP_WORD_BITS == 64)
22 typedef u64bit word;
23 #else
24 #error BOTAN_MP_WORD_BITS must be 8, 16, 32, or 64
25 #endif
26
27 const word MP_WORD_MASK = ~static_cast<word>(0);
28 const word MP_WORD_TOP_BIT = static_cast<word>(1) << (8*sizeof(word) - 1);
29 const word MP_WORD_MAX = MP_WORD_MASK;
30
31 }
32
33 #endif
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::u64bit
unsigned long long u64bit
Definition: types.h:49
Botan::u16bit
unsigned short u16bit
Definition: types.h:27
Botan
Definition: algo_base.h:14
Botan::MP_WORD_MASK
const word MP_WORD_MASK
Definition: mp_types.h:27
Botan::MP_WORD_MAX
const word MP_WORD_MAX
Definition: mp_types.h:29
Botan::MP_WORD_TOP_BIT
const word MP_WORD_TOP_BIT
Definition: mp_types.h:28
Botan::u32bit
unsigned int u32bit
Definition: types.h:32