miden-crypto/src/lib.rs
src/lib.rsRaw
1#![cfg_attr(not(feature = "std"), no_std)]
2
3#[cfg(not(feature = "std"))]
4#[cfg_attr(test, macro_use)]
5extern crate alloc;
6
7pub mod hash;
8pub mod merkle;
9
10// RE-EXPORTS
11// ================================================================================================
12
13pub use winter_crypto::{RandomCoin, RandomCoinError};
14
15pub use winter_math::{fields::f64::BaseElement as Felt, FieldElement, StarkField};
16
17pub mod utils {
18 pub use winter_utils::{
19 collections, string, uninit_vector, ByteReader, ByteWriter, Deserializable,
20 DeserializationError, Serializable, SliceReader,
21 };
22}
23
24// TYPE ALIASES
25// ================================================================================================
26
27/// A group of four field elements in the Miden base field.
28pub type Word = [Felt; WORD_SIZE];
29
30// CONSTANTS
31// ================================================================================================
32
33/// Number of field elements in a word.
34pub const WORD_SIZE: usize = 4;
35
36/// Field element representing ZERO in the Miden base filed.
37pub const ZERO: Felt = Felt::ZERO;
38
39/// Field element representing ONE in the Miden base filed.
40pub const ONE: Felt = Felt::ONE;