|
6 | 6 | use alloc::vec; |
7 | 7 |
|
8 | 8 | use miden_core::field::QuadFelt; |
9 | | -use miden_crypto::stark::{ |
10 | | - GenericStarkConfig, |
11 | | - challenger::{HashChallenger, SerializingChallenger64}, |
12 | | - crypto::{ |
13 | | - CompressionFunctionFromHasher, p3_blake3::Blake3, p3_miden_stateful_hasher::ChainingHasher, |
| 9 | +use miden_crypto::{ |
| 10 | + hash::blake::Blake3Hasher, |
| 11 | + stark::{ |
| 12 | + GenericStarkConfig, |
| 13 | + challenger::{HashChallenger, SerializingChallenger64}, |
| 14 | + hasher::ChainingHasher, |
| 15 | + lmcs::LmcsConfig, |
| 16 | + symmetric::CompressionFunctionFromHasher, |
14 | 17 | }, |
15 | | - lmcs::LmcsConfig, |
16 | 18 | }; |
17 | 19 |
|
18 | 20 | use super::{Dft, PCS_PARAMS}; |
19 | 21 | use crate::Felt; |
20 | 22 |
|
21 | 23 | /// Stateful hasher wrapping Blake3 for LMCS leaf hashing |
22 | | -type Sponge = ChainingHasher<Blake3>; |
| 24 | +type Sponge = ChainingHasher<Blake3Hasher>; |
23 | 25 |
|
24 | 26 | /// Compression function for Merkle tree internal nodes (Blake3, 32-byte digest) |
25 | | -type Compress = CompressionFunctionFromHasher<Blake3, 2, 32>; |
| 27 | +type Compress = CompressionFunctionFromHasher<Blake3Hasher, 2, 32>; |
26 | 28 |
|
27 | 29 | /// LMCS commitment scheme using Blake3 |
28 | 30 | type LmcsType = LmcsConfig<Felt, u8, Sponge, Compress, 32, 32>; |
29 | 31 |
|
30 | 32 | /// Challenger for Fiat-Shamir using Blake3 |
31 | | -type Challenger = SerializingChallenger64<Felt, HashChallenger<u8, Blake3, 32>>; |
| 33 | +type Challenger = SerializingChallenger64<Felt, HashChallenger<u8, Blake3Hasher, 32>>; |
32 | 34 |
|
33 | 35 | /// Complete STARK configuration type for Blake3_256. |
34 | 36 | pub type Blake3Config = GenericStarkConfig<Felt, QuadFelt, LmcsType, Dft, Challenger>; |
35 | 37 |
|
36 | 38 | /// Creates a Blake3_256-based STARK configuration. |
37 | 39 | pub fn create_blake3_256_config() -> Blake3Config { |
38 | | - let sponge = Sponge::new(Blake3); |
39 | | - let compress = Compress::new(Blake3); |
| 40 | + let sponge = Sponge::new(Blake3Hasher); |
| 41 | + let compress = Compress::new(Blake3Hasher); |
40 | 42 | let lmcs = LmcsType::new(sponge, compress); |
41 | 43 | let dft = Dft::default(); |
42 | | - let challenger = Challenger::from_hasher(vec![], Blake3); |
| 44 | + let challenger = Challenger::from_hasher(vec![], Blake3Hasher); |
43 | 45 |
|
44 | 46 | GenericStarkConfig::new(PCS_PARAMS, lmcs, dft, challenger) |
45 | 47 | } |
0 commit comments