Skip to content

Commit efb267b

Browse files
authored
rustdoc: rewrite "Usage" intro (#520)
Provide a more comprehensive overview of the main types in the crate
1 parent 5e1c2b6 commit efb267b

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/lib.rs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,24 @@
2020

2121
//! ## Usage
2222
//!
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.
3341
//!
3442
//! ### `const fn` usage
3543
//!

0 commit comments

Comments
 (0)