hax_lib_protocol/lib.rs
1//! This crate provides tools for protocol authors to write protocol
2//! specifications for hax.
3//!
4//! It contains a collection traits describing state machine behaviour, as
5//! well as a library of abstract primitive cryptographic operations for
6//! use in protocol specifications.
7
8pub mod crypto;
9pub mod state_machine;
10
11/// A protocol error type.
12#[derive(Debug)]
13pub enum ProtocolError {
14 /// An error in the crypto abstraction layer
15 CryptoError,
16 /// On receiving an unexpected message, i.e. one that does not allow a state
17 /// transition from the current state.
18 InvalidMessage,
19 /// On receiving invalid initialization data.
20 InvalidPrologue,
21}
22
23pub type ProtocolResult<T> = Result<T, ProtocolError>;