pub struct CryptographicValidator { /* private fields */ }Expand description
Cryptographic benchmark validator
Implementations§
Source§impl CryptographicValidator
impl CryptographicValidator
pub fn new(benchmark_id: String) -> Self
Sourcepub fn hash_source_code(&self, source_files: &[String]) -> BenchmarkHash
pub fn hash_source_code(&self, source_files: &[String]) -> BenchmarkHash
Hash source code to ensure no tampering
Sourcepub fn hash_input_data(&self, input_data: &[f32]) -> BenchmarkHash
pub fn hash_input_data(&self, input_data: &[f32]) -> BenchmarkHash
Hash input data to verify consistency
Sourcepub fn hash_results(&self, results: &[Duration]) -> BenchmarkHash
pub fn hash_results(&self, results: &[Duration]) -> BenchmarkHash
Hash benchmark results for integrity
Sourcepub fn hash_environment(
&self,
env_data: &HashMap<String, String>,
) -> BenchmarkHash
pub fn hash_environment( &self, env_data: &HashMap<String, String>, ) -> BenchmarkHash
Hash environment configuration
Sourcepub fn verify_hash(
&self,
original: &BenchmarkHash,
data: &str,
context: &str,
) -> bool
pub fn verify_hash( &self, original: &BenchmarkHash, data: &str, context: &str, ) -> bool
Verify hash integrity
Sourcepub fn create_integrity_proof(
&self,
source_files: &[String],
input_data: &[f32],
results: &[Duration],
environment: &HashMap<String, String>,
) -> IntegrityProof
pub fn create_integrity_proof( &self, source_files: &[String], input_data: &[f32], results: &[Duration], environment: &HashMap<String, String>, ) -> IntegrityProof
Create complete integrity proof for a benchmark
Sourcepub fn verify_integrity_proof(&self, proof: &IntegrityProof) -> bool
pub fn verify_integrity_proof(&self, proof: &IntegrityProof) -> bool
Verify complete integrity proof
Sourcepub fn generate_certificate(
&self,
proof: &IntegrityProof,
) -> BenchmarkCertificate
pub fn generate_certificate( &self, proof: &IntegrityProof, ) -> BenchmarkCertificate
Generate tamper-evident benchmark certificate
Auto Trait Implementations§
impl Freeze for CryptographicValidator
impl RefUnwindSafe for CryptographicValidator
impl Send for CryptographicValidator
impl Sync for CryptographicValidator
impl Unpin for CryptographicValidator
impl UnwindSafe for CryptographicValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.