Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeantonio21 committed Nov 24, 2024
1 parent 76760c0 commit fbe6202
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions atoma-tdx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,8 @@ use dcap_rs::types::quotes::body::QuoteBody;
#[cfg(feature = "tdx")]
use tdx::QuoteV4;

/// Trait for converting types into a byte representation
///
/// This trait provides a standard way to serialize types into a sequence of bytes.
/// It is particularly useful for cryptographic operations and data serialization
/// where a consistent byte representation is needed.
pub trait ToBytes {
/// Converts the implementing type into a vector of bytes
///
/// # Returns
/// * `Vec<u8>` - The byte representation of the implementing type
fn to_bytes(&self) -> Vec<u8>;
}

#[cfg(feature = "tdx")]
impl ToBytes for QuoteV4 {
impl crate::ToBytes for QuoteV4 {
fn to_bytes(&self) -> Vec<u8> {
let mut bytes = Vec::new();
bytes.extend_from_slice(&self.header.to_bytes());
Expand All @@ -44,3 +31,16 @@ impl ToBytes for QuoteV4 {
bytes
}
}

/// Trait for converting types into a byte representation
///
/// This trait provides a standard way to serialize types into a sequence of bytes.
/// It is particularly useful for cryptographic operations and data serialization
/// where a consistent byte representation is needed.
pub trait ToBytes {
/// Converts the implementing type into a vector of bytes
///
/// # Returns
/// * `Vec<u8>` - The byte representation of the implementing type
fn to_bytes(&self) -> Vec<u8>;
}

0 comments on commit fbe6202

Please sign in to comment.