From b053ce5a99d4d24829bd83bd449ec27fde122ea9 Mon Sep 17 00:00:00 2001 From: sinu <65924192+sinui0@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:32:27 -0800 Subject: [PATCH] remove incomplete substring proof API --- tlsn/tlsn-core/src/proof/mod.rs | 3 +-- tlsn/tlsn-core/src/proof/substrings.rs | 13 ------------- tlsn/tlsn-formats/src/http/session.rs | 23 ++++++----------------- 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/tlsn/tlsn-core/src/proof/mod.rs b/tlsn/tlsn-core/src/proof/mod.rs index 083bde0461..e9f4ec9daa 100644 --- a/tlsn/tlsn-core/src/proof/mod.rs +++ b/tlsn/tlsn-core/src/proof/mod.rs @@ -5,8 +5,7 @@ mod substrings; pub use session::{default_cert_verifier, SessionInfo, SessionProof, SessionProofError}; pub use substrings::{ - SubstringProve, SubstringsProof, SubstringsProofBuilder, SubstringsProofBuilderError, - SubstringsProofError, + SubstringsProof, SubstringsProofBuilder, SubstringsProofBuilderError, SubstringsProofError, }; use serde::{Deserialize, Serialize}; diff --git a/tlsn/tlsn-core/src/proof/substrings.rs b/tlsn/tlsn-core/src/proof/substrings.rs index 799ac40f29..2b990edb7e 100644 --- a/tlsn/tlsn-core/src/proof/substrings.rs +++ b/tlsn/tlsn-core/src/proof/substrings.rs @@ -16,19 +16,6 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; use utils::range::{RangeDisjoint, RangeSet, RangeUnion, ToRangeSet}; -/// A trait for proving of typed data contained within a transcript. -pub trait SubstringProve { - /// The error type. - type Error; - - /// Proves that the provided value is contained within the transcript. - fn prove( - &mut self, - builder: &mut SubstringsProofBuilder<'_>, - value: &T, - ) -> Result<(), Self::Error>; -} - /// An error for [`SubstringsProofBuilder`] #[derive(Debug, thiserror::Error)] #[non_exhaustive] diff --git a/tlsn/tlsn-formats/src/http/session.rs b/tlsn/tlsn-formats/src/http/session.rs index c2db4ff704..2725a31c75 100644 --- a/tlsn/tlsn-formats/src/http/session.rs +++ b/tlsn/tlsn-formats/src/http/session.rs @@ -1,7 +1,4 @@ -use tlsn_core::{ - proof::{SessionProof, SubstringProve, SubstringsProof, SubstringsProofBuilderError}, - NotarizedSession, -}; +use tlsn_core::{proof::SessionProof, NotarizedSession}; use crate::http::HttpTranscript; @@ -27,21 +24,13 @@ impl NotarizedHttpSession { &self.session } + /// Returns the HTTP transcript. + pub fn transcript(&self) -> &HttpTranscript { + &self.transcript + } + /// Returns a proof for the TLS session. pub fn session_proof(&self) -> SessionProof { self.session.session_proof() } - - /// Builds a substring proof with the provided prover. - pub fn substring_proof>( - &self, - prover: &mut P, - ) -> Result - where - P::Error: From, - { - let mut builder = self.session.data().build_substrings_proof(); - prover.prove(&mut builder, &self.transcript)?; - builder.build().map_err(P::Error::from) - } }