Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
style(rtc_types::enclave_messages): add marker comments for FFI types
Browse files Browse the repository at this point in the history
  • Loading branch information
PiDelport committed Jun 11, 2021
1 parent 08ad5e1 commit 0ab12a8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions rtc_types/src/enclave_messages/set_access_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ pub struct Request {
pub access_key: [u8; 24], // [u8; ACCESS_KEY_BYTES]
}

pub const REQUEST_SIZE: usize = mem::size_of::<ArchivedRequest>();

pub type EncryptedRequest = EncryptedEnclaveMessage<REQUEST_SIZE, 0>;

#[derive(Archive, Deserialize, Serialize, Debug, PartialEq)]
pub struct Response {
pub success: bool,
}

// Begin FFI types

// FFI type: REQUEST_SIZE
pub const REQUEST_SIZE: usize = mem::size_of::<ArchivedRequest>();

// FFI type: EncryptedRequest
pub type EncryptedRequest = EncryptedEnclaveMessage<REQUEST_SIZE, 0>;

// FFI type: RESPONSE_SIZE
pub const RESPONSE_SIZE: usize = mem::size_of::<ArchivedResponse>();

// FFI type: EncryptedResponse
pub type EncryptedResponse = EncryptedEnclaveMessage<RESPONSE_SIZE, 0>;

// End FFI types

#[cfg(test)]
mod test {
use crate::byte_formats::rkyv_format;
Expand Down

0 comments on commit 0ab12a8

Please sign in to comment.