Skip to main content

Crate p3_miden_dev_utils

Crate p3_miden_dev_utils 

Source
Expand description

Shared development utilities for p3-miden crates.

This crate provides:

  • Configurations: Field/hash combinations (BabyBear+Poseidon2, etc.)
  • Benchmark utilities: Criterion config, matrix generation
  • Test fixtures: Seeds, matrix scenarios, constants

§For Tests

Import from a specific config module to get type aliases and constructors:

use p3_miden_dev_utils::configs::baby_bear_poseidon2::*;

#[test]
fn test_example() {
    let challenger = test_challenger();
    // F, EF, P, WIDTH, RATE, DIGEST are available
}

§For Benchmarks

Use trait-based dispatch for generic benchmarks:

use p3_miden_dev_utils::{
    BenchScenario, BabyBearPoseidon2, GoldilocksPoseidon2,
    bench::criterion_config, fixtures::LOG_HEIGHTS,
};

fn bench_generic<S: BenchScenario>(c: &mut Criterion) {
    let mmcs = S::packed_mmcs();
    // ...
}

Re-exports§

pub use bench::PARALLEL_STR;
pub use bench::criterion_config;
pub use bench::criterion_config_long;
pub use configs::BabyBearKeccak;
pub use configs::BabyBearPoseidon2;
pub use configs::GoldilocksKeccak;
pub use configs::GoldilocksPoseidon2;
pub use configs::BenchScenario;
pub use configs::PcsScenario;
pub use fixtures::BENCH_SEED;
pub use fixtures::LOG_HEIGHTS;
pub use fixtures::RELATIVE_SPECS;
pub use fixtures::TEST_SEED;
pub use matrix::concatenate_matrices;
pub use matrix::generate_flat_matrix;
pub use matrix::generate_matrices_from_specs;
pub use matrix::random_lde_matrix;
pub use matrix::total_elements;
pub use matrix::total_elements_flat;

Modules§

bench
Benchmark-specific utilities (Criterion config, parallel detection).
configs
Field/hash configuration modules and trait definitions.
fixtures
Test and benchmark fixtures (constants, scenarios).
matrix
Matrix generation utilities for tests and benchmarks.

Macros§

impl_keccak_config
Macro to generate a Keccak-based config module.
impl_poseidon2_config
Macro to generate a Poseidon2-based config module.