[package]
name = "crypto-bigint"
version = "0.7.5"
description = """
Pure Rust implementation of a big integer library which has been designed from
the ground-up for use in cryptographic applications. Provides constant-time,
no_std-friendly implementations of modern formulas using const generics.
"""
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
repository = "https://github.com/RustCrypto/crypto-bigint"
categories = ["algorithms", "cryptography", "data-structures", "mathematics", "no-std"]
keywords = ["arbitrary", "crypto", "bignum", "integer", "precision"]
readme = "README.md"
resolver = "2"
edition = "2024"
rust-version = "1.85"
exclude = [".clippy.toml", ".codecov.yml", ".github", ".gitignore"]

[dependencies]
cpubits = "0.1"
ctutils = "0.4"
num-traits = { version = "0.2.19", default-features = false }

# optional dependencies
der = { version = "0.8", optional = true, default-features = false }
hybrid-array = { version = "0.4.12", optional = true }
getrandom = { version = "0.4", optional = true, features = ["sys_rng"] }
rand_core = { version = "0.10", optional = true, default-features = false }
rlp = { version = "0.6", optional = true, default-features = false }
serdect = { version = "0.4", optional = true, default-features = false }
subtle = { version = "2.6", optional = true, default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

[dev-dependencies]
chacha20 = { version = "0.10", default-features = false, features = ["rng"] }
hex-literal = "1"
num-bigint = "0.4"
num-integer = "0.1"
num-modular = { version = "0.6", features = ["num-bigint", "num-integer", "num-traits"] }
rand_core = "0.10"

[target.'cfg(any(unix, windows))'.dev-dependencies]
criterion = { version = "0.7", features = ["html_reports"] }
proptest = "1.11"

[features]
default = ["rand_core"]
alloc = ["serdect?/alloc"]

der = ["dep:der", "hybrid-array"]
extra-sizes = []
getrandom = ["dep:getrandom", "rand_core"]
rand_core = ["dep:rand_core"]
serde = ["dep:serdect"]
subtle = ["dep:subtle", "ctutils/subtle", "hybrid-array?/subtle"]

[lints.rust]
missing_copy_implementations = "warn"
missing_debug_implementations = "warn"
missing_docs = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unsafe_code = "deny"
unused_lifetimes = "warn"
unused_qualifications = "warn"

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ['cfg(cpubits, values("16", "32", "64"))']

[lints.clippy]
borrow_as_ptr = "warn"
cast_lossless = "warn"
cast_possible_truncation = "warn"
cast_possible_wrap = "warn"
cast_precision_loss = "warn"
cast_sign_loss = "warn"
checked_conversions = "warn"
doc_markdown = "warn"
from_iter_instead_of_collect = "warn"
implicit_saturating_sub = "warn"
integer_division_remainder_used = "warn" # not constant time (see Kyberslash)
manual_assert = "warn"
map_unwrap_or = "warn"
many_single_char_names = "allow"
missing_errors_doc = "warn"
missing_panics_doc = "warn"
mod_module_files = "warn"
must_use_candidate = "warn"
needless_range_loop = "allow"
panic_in_result_fn = "warn"
ptr_as_ptr = "warn"
redundant_closure_for_method_calls = "warn"
ref_as_ptr = "warn"
return_self_not_must_use = "warn"
semicolon_if_nothing_returned = "warn"
trivially_copy_pass_by_ref = "warn"
std_instead_of_alloc = "warn"
std_instead_of_core = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_comment = "warn"
unwrap_in_result = "warn"

[[bench]]
name = "boxed_monty"
harness = false
required-features = ["alloc"]

[[bench]]
name = "boxed_uint"
harness = false
required-features = ["alloc"]

[[bench]]
name = "const_monty"
harness = false

[[bench]]
name = "limb"
harness = false

[[bench]]
name = "monty"
harness = false

[[bench]]
name = "uint"
harness = false

[[bench]]
name = "int"
harness = false

[profile.dev]
opt-level = 2

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.typos.default]
extend-ignore-re = ["([0-9A-Fa-f]{16,})"]
