p3_miden_dev_utils/lib.rs
1//! Shared development utilities for p3-miden crates.
2//!
3//! This crate provides:
4//! - **Configurations**: Field/hash combinations (BabyBear+Poseidon2, etc.)
5//! - **Benchmark utilities**: Criterion config, matrix generation
6//! - **Test fixtures**: Seeds, matrix scenarios, constants
7//!
8//! # For Tests
9//!
10//! Import from a specific config module to get type aliases and constructors:
11//!
12//! ```ignore
13//! use p3_miden_dev_utils::configs::baby_bear_poseidon2::*;
14//!
15//! #[test]
16//! fn test_example() {
17//! let challenger = test_challenger();
18//! // F, EF, P, WIDTH, RATE, DIGEST are available
19//! }
20//! ```
21//!
22//! # For Benchmarks
23//!
24//! Use trait-based dispatch for generic benchmarks:
25//!
26//! ```ignore
27//! use p3_miden_dev_utils::{
28//! BenchScenario, BabyBearPoseidon2, GoldilocksPoseidon2,
29//! bench::criterion_config, fixtures::LOG_HEIGHTS,
30//! };
31//!
32//! fn bench_generic<S: BenchScenario>(c: &mut Criterion) {
33//! let mmcs = S::packed_mmcs();
34//! // ...
35//! }
36//! ```
37
38#![no_std]
39extern crate alloc;
40
41// =============================================================================
42// Modules
43// =============================================================================
44
45#[cfg(not(target_arch = "wasm32"))]
46pub mod bench;
47pub mod configs;
48pub mod fixtures;
49pub mod matrix;
50
51// =============================================================================
52// Re-exports at crate root for convenience
53// =============================================================================
54
55// Traits
56// Bench utilities (only on std targets)
57#[cfg(not(target_arch = "wasm32"))]
58pub use bench::{PARALLEL_STR, criterion_config, criterion_config_long};
59// Scenario structs
60pub use configs::{BabyBearKeccak, BabyBearPoseidon2, GoldilocksKeccak, GoldilocksPoseidon2};
61pub use configs::{BenchScenario, PcsScenario};
62// Common fixtures
63pub use fixtures::{BENCH_SEED, LOG_HEIGHTS, RELATIVE_SPECS, TEST_SEED};
64// Matrix utilities
65pub use matrix::{
66 concatenate_matrices, generate_flat_matrix, generate_matrices_from_specs, random_lde_matrix,
67 total_elements, total_elements_flat,
68};