Home
last modified time | relevance | path

Searched refs:usize (Results 1 – 25 of 37) sorted by relevance

12

/trusty/user/base/lib/hwbcc/rust/src/
Dtest.rs28 const TEST_MAC_KEY: &'static [u8; HWBCC_MAC_KEY_SIZE as usize] = &[
38 const EMULATOR_CDI_ATTEST: &'static [u8; DICE_CDI_SIZE as usize] = &[ in test_get_dice_artifacts()
44 const EMULATOR_CDI_SEAL: &'static [u8; DICE_CDI_SIZE as usize] = &[ in test_get_dice_artifacts()
66 let bcc_handover_size: usize = 2 * DICE_CDI_SIZE as usize + 7 /*CBOR tags*/; in test_get_dice_artifacts()
74 let next_cdi_attest = &mut [0u8; DICE_CDI_SIZE as usize]; in test_get_dice_artifacts()
75 let next_cdi_seal = &mut [0u8; DICE_CDI_SIZE as usize]; in test_get_dice_artifacts()
84 next_cdi_attest as *mut [u8; DICE_CDI_SIZE as usize], in test_get_dice_artifacts()
85 next_cdi_seal as *mut [u8; DICE_CDI_SIZE as usize], in test_get_dice_artifacts()
114 let dk_pub_key = &mut [0u8; ED25519_PUBLIC_KEY_LEN as usize]; in test_get_bcc_test_mode()
115 let km_pub_key = &mut [0u8; ED25519_PUBLIC_KEY_LEN as usize]; in test_get_bcc_test_mode()
[all …]
Dlib.rs52 pub const HWBCC_MAX_RESP_PAYLOAD_LENGTH: usize = HWBCC_MAX_RESP_PAYLOAD_SIZE as usize;
159 const MAX_SERIALIZED_SIZE: usize = HWBCC_MAX_RESP_PAYLOAD_LENGTH;
187 if msg.payload_size as usize != response_payload.len() { in deserialize()
382 if aad.len() > HWBCC_MAX_AAD_SIZE as usize { in sign_data()
/trusty/user/base/lib/hwkey/rust/src/
Dtest.rs38 const KEY_SIZE: usize = 32;
51 let buf = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_repeatable_versioned()
63 let buf2 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_repeatable_versioned()
125 let buf1 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_default()
134 let buf2 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_default()
151 let buf1 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_specified()
163 let buf2 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_specified()
205 let buf_shared = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_specified()
223 let buf_shared2 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_specified()
275 let buf1 = &mut [0u8; KEY_SIZE as usize]; in test_hwkey_derive_different_version_source()
[all …]
Dlib.rs136 let buf = &mut [0; HWKEY_MAX_MSG_SIZE as usize]; in get_keyslot_data()
185 const HEADER_SIZE: usize = mem::size_of::<hwkey_derive_versioned_msg>(); in derive()
186 const MAX_PAYLOAD_LEN: usize = HWKEY_MAX_MSG_SIZE as usize - HEADER_SIZE; in derive()
206 [0; hwkey_rollback_version_indices_HWKEY_ROLLBACK_VERSION_INDEX_COUNT as usize]; in derive()
208 [hwkey_rollback_version_indices_HWKEY_ROLLBACK_VERSION_OS_INDEX as usize] = in derive()
226 let buf = &mut [0; HWKEY_MAX_MSG_SIZE as usize]; in derive()
585 const MAX_SERIALIZED_SIZE: usize = HWKEY_MAX_MSG_SIZE as usize;
621 const MAX_SERIALIZED_SIZE: usize = HWKEY_MAX_MSG_SIZE as usize;
635 if bytes.len() - header_size != msg.key_len as usize { in deserialize()
649 [hwkey_rollback_version_indices_HWKEY_ROLLBACK_VERSION_OS_INDEX as usize], in deserialize()
/trusty/user/app/storage/test/storage-unittest-aidl/unittests/
Dhelpers.rs58 fn check_pattern32(offset: usize, buf: &[u8]) -> Result<(), String> { in check_pattern32() argument
59 const U32_SIZE: usize = std::mem::size_of::<u32>(); in check_pattern32()
83 fn fill_pattern32(offset: usize, buf: &mut [u8]) { in fill_pattern32() argument
84 const U32_SIZE: usize = std::mem::size_of::<u32>(); in fill_pattern32()
96 fn check_valid_size(chunk_len: usize) -> Result<(), String> { in check_valid_size()
105 offset: usize, in write_pattern() argument
106 chunks: usize, in write_pattern() argument
107 chunk_len: usize, in write_pattern() argument
131 offset: usize, in read_pattern() argument
132 chunks: usize, in read_pattern() argument
[all …]
/trusty/kernel/platform/generic-x86_64/rust/src/
Dlib.rs41 const PAGE_MASK: usize = PAGE_SIZE as usize - 1;
53 physical_address: usize, in map_physical_region() argument
54 size: usize, in map_physical_region() argument
110 let entry_size = (1 + entry.bus_number_end as usize - entry.bus_number_start as usize) << 20; in platform_acpi_init_func()
114 entry.base_address as usize in platform_acpi_init_func()
/trusty/user/base/lib/hwwsk/rust/src/
Dtest.rs32 const KEY_SIZE: usize = 32;
39 let buf = &mut [0u8; HWWSK_MAX_MSG_SIZE as usize]; in test_hwwsk_generate_key()
51 let buf = &mut [0u8; HWWSK_MAX_MSG_SIZE as usize]; in test_hwwsk_import_key()
Dlib.rs83 const MAX_SERIALIZED_SIZE: usize = HWWSK_MAX_MSG_SIZE as usize;
143 const MAX_SERIALIZED_SIZE: usize = HWWSK_MAX_MSG_SIZE as usize;
182 const MAX_SERIALIZED_SIZE: usize = HWWSK_MAX_MSG_SIZE as usize;
218 const MAX_SERIALIZED_SIZE: usize = HWWSK_MAX_MSG_SIZE as usize;
292 key_size: usize, in import_key() argument
323 key_size: usize, in generate_key() argument
332 key_size: usize, in create_key() argument
347 let resp_buf = &mut [0; HWWSK_MAX_MSG_SIZE as usize]; in create_key()
393 let resp_buf = &mut [0; HWWSK_MAX_MSG_SIZE as usize]; in export_key()
/trusty/user/base/lib/tipc/rust/src/service/
Dhandle_set.rs35 const PORT_COUNT: usize,
36 const MAX_CONNECTION_COUNT: usize,
40 connection_count: usize,
44 impl<D: Dispatcher, const PORT_COUNT: usize, const MAX_CONNECTION_COUNT: usize>
204 impl<D: Dispatcher, const PORT_COUNT: usize, const MAX_CONNECTION_COUNT: usize> fmt::Debug
/trusty/user/base/lib/unittest-rust/src/
Dtypes.rs150 pub struct TestId(pub usize);
165 pub start_line: usize,
166 pub start_col: usize,
167 pub end_line: usize,
168 pub end_col: usize,
172 pub fn padded_name(&self, column_count: usize, align: NamePadding) -> String { in padded_name() argument
/trusty/user/base/lib/storage/rust/src/
Dtransaction.rs107 offset: usize, in read_at() argument
130 offset: usize, in write_at() argument
137 pub fn get_size(&mut self, file: &SecureFile) -> Result<usize, Error> { in get_size() argument
147 pub fn set_size(&mut self, file: &mut SecureFile, size: usize) -> Result<(), Error> { in set_size()
Dlib.rs376 offset: usize, in read_at() argument
438 offset: usize, in write_at() argument
450 offset: usize, in write_at_impl() argument
483 pub fn get_size(&mut self, file: &SecureFile) -> Result<usize, Error> { in get_size() argument
491 Ok(size as usize) in get_size()
503 pub fn set_size(&mut self, file: &mut SecureFile, size: usize) -> Result<(), Error> { in set_size()
513 size: usize, in set_size_impl() argument
769 fn check_size(size: isize) -> Result<usize, Self> { in check_size() argument
774 Ok(size as usize) in check_size()
935 let mut buf = [0; sys::STORAGE_MAX_NAME_LENGTH_BYTES as usize]; in try_next()
/trusty/user/app/keymint/
Dffi_bindings.rs49 pub(crate) const KEYBOX_RESP_HDR_SIZE: usize =
52 const KEYBOX_RESP_MAX_SIZE: usize = KEYBOX_RESP_HDR_SIZE + (sys::KEYBOX_MAX_SIZE as usize);
112 const MAX_SERIALIZED_SIZE: usize = KEYBOX_RESP_MAX_SIZE;
136 if unwrapped_keybox_len as usize != bytes.len() { in deserialize()
Dsecure_deletion_secret_manager.rs37 const MAX_TRIES: usize = 3;
40 const SECRET_SIZE: usize = 16;
46 const FACTORY_RESET_SECRET_SIZE: usize = SECRET_SIZE * 2;
47 const FACTORY_RESET_SECRET_POS: usize = 0;
48 const FACTORY_FIRST_SECURE_DELETION_SECRET_POS: usize =
52 const BLOCK_SIZE: usize = SECRET_SIZE * 32;
56 const MAX_SECRET_FILE_SIZE: usize = BLOCK_SIZE * 32;
62 const MAX_SECRET_FILE_SIZE_FOR_UPGRADES: usize = MAX_SECRET_FILE_SIZE + 8 * BLOCK_SIZE;
135 start: usize, in read_block() argument
164 fn find_empty_slot(&mut self, is_upgrade: bool) -> Result<Option<usize>, Error> { in find_empty_slot() argument
[all …]
Dkeys.rs28 const TRUSTY_KM_KAK_SIZE: usize = 32;
31 const TRUSTY_KM_WRAPPING_KEY_SIZE: usize = 16;
43 const U32_SIZE: usize = core::mem::size_of::<u32>();
102 const CONTEXT_VER_OFFSET: usize = 0;
106 const NON_LEGACY_KEY_OFFSET: usize = Self::CONTEXT_VER_OFFSET + U32_SIZE;
108 const KDF_VER_OFFSET: usize = Self::NON_LEGACY_KEY_OFFSET + U32_SIZE;
110 const OS_ROLLBACK_VER_OFFSET: usize = Self::KDF_VER_OFFSET + U32_SIZE;
113 const SERIALIZED_SIZE: usize = Self::OS_ROLLBACK_VER_OFFSET + U32_SIZE;
Dkey_wrapper.rs57 let buf = &mut [0u8; hwwsk::HWWSK_MAX_MSG_SIZE as usize]; in ephemeral_wrap()
88 let key_size = key_size.0 as usize; in create_storage_key()
96 let mut buf = vec_try![0; hwwsk::HWWSK_MAX_MSG_SIZE as usize]?; in create_storage_key()
/trusty/user/base/lib/tipc/rust/src/
Dhandle.rs56 pub const MAX_MSG_HANDLES: usize = 8;
58 pub const MAX_MSG_IOVECS: usize = 32;
60 pub const MAX_SERIALIZED_SEGMENTS: usize = 32;
152 ) -> crate::Result<(usize, usize)> { in recv_vectored() argument
263 } else if rc as usize != total_num_bytes { in send_vectored()
264 Err(TipcError::IncompleteWrite { num_bytes_written: rc as usize }) in send_vectored()
338 pub fn mmap(&self, size: usize, flags: MMapFlags) -> crate::Result<UnsafeSharedBuf> { in mmap() argument
351 let page_size: usize = page_size.try_into().unwrap(); in mmap()
435 len: usize,
450 pub fn len(&self) -> usize { in len() argument
Dservice.rs236 const UUID_BYTE_LEN: usize = std::mem::size_of::<trusty_sys::uuid>();
240 const UUID_STR_LEN: usize = (sys::UUID_STR_SIZE as usize) - 1;
241 const HYPHEN_SKIP_POS: [usize; 4] = [8, 4, 4, 4];
242 const CLOCK_SEQ_AND_NODE_NUM_BYTES: usize = 8;
445 fn max_message_length(&self) -> usize { in max_message_length() argument
485 fn max_message_length(&self) -> usize { in max_message_length() argument
593 fn max_message_length(&self) -> usize {
638 fn max_message_length(&self) -> usize; in max_message_length() argument
686 fn max_message_length(&self) -> usize { in max_message_length() argument
732 fn max_message_length(&self) -> usize { in max_message_length() argument
[all …]
Dserialization.rs85 const MAX_SERIALIZED_SIZE: usize;
102 const MAX_SERIALIZED_SIZE: usize = 0;
/trusty/user/app/sample/rust-hello-world/
Dlib.rs26 const HELLO_TRUSTY_MAX_MSG_SIZE: usize = 100;
27 const MESSAGE_OFFSET: usize = 2;
63 const MAX_SERIALIZED_SIZE: usize = HELLO_TRUSTY_MAX_MSG_SIZE;
228 let buf = &mut [0; HELLO_TRUSTY_MAX_MSG_SIZE as usize]; in hello_world_test()
/trusty/user/base/lib/trusty-std/src/
Dalloc.rs99 fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>; in try_with_capacity()
109 fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError> { in try_with_capacity()
357 const MIN_ALIGN: usize = 8;
359 const MIN_ALIGN: usize = 16;
365 new_size: usize, in realloc_fallback() argument
419 unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { in realloc()
Dlib.rs59 u16, u32, u64, u8, usize,
/trusty/user/app/secretkeeper/
Dlib.rs47 const PORT_COUNT: usize = 3;
53 const MAX_CONNECTION_COUNT: usize = 3;
56 const MAX_MSG_SIZE: usize = 4000;
70 const MAX_SERIALIZED_SIZE: usize = MAX_MSG_SIZE;
226 fn add_service_port<const PORT_COUNT: usize, T>( in add_service_port() argument
/trusty/user/app/sample/memref-test/rust/
Dmemref_test.rs160 const MAX_SERIALIZED_SIZE: usize = 0;
176 const MAX_SERIALIZED_SIZE: usize = 1;
207 const MAX_SERIALIZED_SIZE: usize = 0;
/trusty/user/app/sample/hwwsk/
Dmain.rs72 let buffer = [0u8; HWWSK_MAX_MSG_SIZE as usize]; in main()

12