|
20 | 20 |
|
21 | 21 | //! ## Usage
|
22 | 22 | //!
|
23 |
| -//! This crate defines a [`Uint`] type which is const generic around an inner |
24 |
| -//! [`Limb`] array, where a [`Limb`] is a newtype for a word-sized integer. |
25 |
| -//! Thus large integers are represented as arrays of smaller integers which |
26 |
| -//! are sized appropriately for the CPU, giving us some assurances of how |
27 |
| -//! arithmetic operations over those smaller integers will behave. |
28 |
| -//! |
29 |
| -//! To obtain appropriately sized integers regardless of what a given CPU's |
30 |
| -//! word size happens to be, a number of portable type aliases are provided for |
31 |
| -//! integer sizes commonly used in cryptography, for example: |
32 |
| -//! [`U128`], [`U384`], [`U256`], [`U2048`], [`U3072`], [`U4096`]. |
| 23 | +//! The core types of `crypto-bigint` are as follows: |
| 24 | +//! |
| 25 | +//! - [`Uint`]: stack-allocated big integer type, const generic around a number of [`Limb`]s. |
| 26 | +//! Type aliases are provided for various sizes, e.g. [`U128`], [`U384`], [`U256`], [`U2048`], |
| 27 | +//! [`U3072`], [`U4096`]. |
| 28 | +//! - [`BoxedUint`]: heap-allocated big integer type. Requires the `alloc` crate feature is enabled. |
| 29 | +//! |
| 30 | +//! Big integer types in this crate use a 32-bit or 64-bit saturated representation, depending on |
| 31 | +//! the underlying CPU's pointer width. |
| 32 | +//! |
| 33 | +//! The following types for modular arithmetic are available under the [`modular`] submodule: |
| 34 | +//! |
| 35 | +//! - [`modular::ConstMontyForm`]: stack-allocated type-safe modular arithmetic using Montgomery |
| 36 | +//! form suitable for cases where the modulus is known at compile-time. |
| 37 | +//! - [`modular::MontyForm`]: stack-allocated modular arithmetic using Montgomery form for cases |
| 38 | +//! where the modulus is only known at runtime. |
| 39 | +//! - [`modular::BoxedMontyForm`]: heap-allocated modular arithmetic using Montgomery form. |
| 40 | +//! Requires the `alloc` crate feature is enabled. |
33 | 41 | //!
|
34 | 42 | //! ### `const fn` usage
|
35 | 43 | //!
|
|
0 commit comments