Skip to main content

tlsn_core/config/
tls_commit.rs

1//! TLS commitment configuration.
2
3pub mod mpc;
4pub mod proxy;
5
6use crate::config::tls_commit::{mpc::MpcTlsConfig, proxy::ProxyTlsConfig};
7use serde::{Deserialize, Serialize};
8
9/// TLS commitment configuration.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11#[non_exhaustive]
12pub enum TlsCommitConfig {
13    /// Protocol config for mpc mode.
14    Mpc(MpcTlsConfig),
15    /// Protocol config for proxy mode.
16    Proxy(ProxyTlsConfig),
17}
18
19impl From<MpcTlsConfig> for TlsCommitConfig {
20    fn from(value: MpcTlsConfig) -> Self {
21        Self::Mpc(value)
22    }
23}
24
25impl From<ProxyTlsConfig> for TlsCommitConfig {
26    fn from(value: ProxyTlsConfig) -> Self {
27        Self::Proxy(value)
28    }
29}