Home
last modified time | relevance | path

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

12

/aosp12/packages/modules/Virtualization/authfs/src/fsverity/
H A Deditor.rs101 offset_from_alignment: usize, in new_hash_for_incomplete_write() argument
102 output_chunk_index: usize, in new_hash_for_incomplete_write() argument
132 offset_from_alignment: usize, in new_chunk_hash() argument
133 current_size: usize, in new_chunk_hash() argument
134 output_chunk_index: usize, in new_chunk_hash() argument
180 let source = &buf[offset_in_buf as usize..offset_in_buf as usize + current_size]; in write_at()
251 merkle_tree.resize(size as usize); in resize()
287 let begin: usize = in write_at()
298 let size: usize = in resize()
313 .chunks(CHUNK_SIZE as usize) in read_chunk()
[all …]
H A Dbuilder.rs21 const HASH_SIZE: usize = Sha256Hasher::HASH_SIZE;
22 const HASH_PER_PAGE: usize = CHUNK_SIZE as usize / HASH_SIZE;
64 pub fn resize(&mut self, new_file_size: usize) { in resize() argument
67 self.leaves.resize(leaves_size as usize, Sha256Hasher::HASH_OF_4096_ZEROS); in resize()
73 pub fn update_hash(&mut self, index: usize, hash: &Sha256Hash, size_at_least: u64) { in update_hash() argument
88 pub fn is_index_valid(&self, index: usize) -> bool { in is_index_valid()
93 pub fn is_consistent(&self, index: usize, hash: &Sha256Hash) -> bool { in is_consistent() argument
197 let hash = Sha256Hasher::new()?.update(&vec![1u8; CHUNK_SIZE as usize])?.finalize()?; in merkle_tree_non_sequential()
236 tree.resize(CHUNK_SIZE as usize * 2 - 100); in merkle_tree_shrink_leaves()
249 for (index, chunk) in test_data.chunks(CHUNK_SIZE as usize).enumerate() { in generate_fsverity_digest_sequentially()
[all …]
H A Dverifier.rs27 const ZEROS: [u8; CHUNK_SIZE as usize] = [0u8; CHUNK_SIZE as usize];
30 const SIZE_OF_FSVERITY_FORMATTED_DIGEST_SHA256: usize = 12 + Sha256Hasher::HASH_SIZE;
34 fn hash_with_padding(chunk: &[u8], pad_to: usize) -> Result<HashBuffer, CryptoError> { in hash_with_padding()
50 let chunk_hash = hash_with_padding(&chunk, CHUNK_SIZE as usize)?; in verity_check()
61 Ok(hash_with_padding(&merkle_chunk, CHUNK_SIZE as usize)?) in verity_check()
75 ) -> Result<impl Iterator<Item = Result<([u8; 4096], usize), FsverityError>> + '_, FsverityError> {
98 let hash_offset_in_chunk = (global_hash_offset % CHUNK_SIZE) as usize;
143 let mut buf = [0u8; CHUNK_SIZE as usize]; in new()
160 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
/aosp12/packages/modules/Virtualization/authfs/src/
H A Dcommon.rs27 remaining: usize,
29 alignment: usize,
33 pub fn new(remaining: usize, offset: u64, alignment: usize) -> Self { in new() argument
39 type Item = (u64, usize);
47 self.alignment - (self.offset % self.alignment as u64) as usize, in next()
60 fn collect_chunk_read_iter(remaining: usize, offset: u64) -> Vec<(u64, usize)> { in collect_chunk_read_iter() argument
H A Dfile.rs20 pub type ChunkBuffer = [u8; CHUNK_SIZE as usize];
28 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize>; in read_chunk() argument
39 fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize>; in write_at() argument
H A Dfusefs.rs148 ) -> io::Result<usize> { in read_chunks() argument
150 let size_to_read = std::cmp::min(size as usize, remaining as usize); in read_chunks()
151 let total = ChunkedSizeIter::new(size_to_read, offset, CHUNK_SIZE as usize).try_fold( in read_chunks()
158 let mut buf = [0u8; CHUNK_SIZE as usize]; in read_chunks()
164 let begin = (current_offset % CHUNK_SIZE) as usize; in read_chunks()
286 ) -> io::Result<usize> { in read() argument
319 ) -> io::Result<usize> { in write() argument
322 let mut buf = vec![0; size as usize]; in write()
/aosp12/system/security/keystore2/src/vintf/
H A Dlib.rs28 len: usize,
51 let mut len: usize = 0; in get_hal_names()
61 let mut len: usize = 0; in get_hal_names_and_versions()
72 major_version: usize, in get_hidl_instances() argument
73 minor_version: usize, in get_hidl_instances() argument
76 let mut len: usize = 0; in get_hidl_instances()
96 pub fn get_aidl_instances(package: &str, version: usize, interface_name: &str) -> HalNames { in get_aidl_instances() argument
97 let mut len: usize = 0; in get_aidl_instances()
/aosp12/system/security/keystore2/src/crypto/
H A Dlib.rs33 pub const GCM_IV_LENGTH: usize = 12;
35 pub const TAG_LENGTH: usize = 16;
37 pub const AES_256_KEY_LENGTH: usize = 32;
39 pub const AES_128_KEY_LENGTH: usize = 16;
41 pub const SALT_LENGTH: usize = 16;
45 pub const LEGACY_IV_LENGTH: usize = 16;
65 pub fn generate_random_data(size: usize) -> Result<Vec<u8>, Error> { in generate_random_data()
224 let max_size: usize = EVP_MAX_MD_SIZE.try_into().unwrap(); in hkdf_extract()
253 pub fn hkdf_expand(out_len: usize, prk: &[u8], info: &[u8]) -> Result<ZVec, Error> { in hkdf_expand() argument
355 unsafe { ECKEYMarshalPrivateKey(key.0, buf.as_mut_ptr(), buf.len()) } as usize; in ec_key_marshal_private_key()
[all …]
H A Dzvec.rs29 len: usize,
34 pub fn new(size: usize) -> Result<Self, Error> { in new()
46 pub fn reduce_len(&mut self, len: usize) { in reduce_len() argument
/aosp12/system/security/keystore2/src/
H A Dboot_level_keys.rs128 current: usize,
139 const HKDF_KEY_SIZE: usize = 32;
149 pub fn level_accessible(&self, boot_level: usize) -> bool { in level_accessible()
158 fn get_hkdf_key(&mut self, boot_level: usize) -> Result<Option<&ZVec>> { in get_hkdf_key()
182 pub fn advance_boot_level(&mut self, new_boot_level: usize) -> Result<()> { in advance_boot_level()
220 boot_level: usize, in expand_key() argument
221 out_len: usize, in expand_key() argument
232 pub fn aes_key(&mut self, boot_level: usize) -> Result<Option<ZVec>> { in aes_key()
H A Dlegacy_blob.rs114 key_size: usize,
221 const VERSION_OFFSET: usize = 0;
222 const TYPE_OFFSET: usize = 1;
223 const FLAGS_OFFSET: usize = 2;
224 const SALT_SIZE_OFFSET: usize = 3;
226 const IV_OFFSET: usize = 4;
331 ) as usize; in new_from_stream()
473 .get(0..indirect_size as usize) in read_key_parameters()
486 .get(0..element_size as usize) in read_key_parameters()
522 as usize; in read_key_parameters()
[all …]
H A Dshared_secret_negotiation.rs54 Hidl { is_strongbox: bool, version: (usize, usize) },
90 version: (usize, usize), in filter_map_legacy_km_instances() argument
H A Doperation.rs172 index: usize,
206 index: usize,
211 const MAX_RECEIVE_DATA: usize = 0x8000;
216 index: usize, in new() argument
525 let mut index: usize = 0; in create_operation()
559 fn get(&self, index: usize) -> Option<Arc<Operation>> { in get()
667 index: usize, in prune()
H A Dentropy.rs21 static ENTROPY_SIZE: usize = 64;
45 fn get_entropy(size: usize) -> Result<Vec<u8>> { in get_entropy()
/aosp12/packages/modules/Virtualization/authfs/fd_server/src/
H A Dfsverity.rs42 fn read_metadata(fd: i32, metadata_type: u64, offset: u64, buf: &mut [u8]) -> io::Result<usize> { in read_metadata() argument
59 })? as usize) in read_metadata()
64 pub fn read_merkle_tree(fd: i32, offset: u64, buf: &mut [u8]) -> io::Result<usize> { in read_merkle_tree() argument
69 pub fn read_signature(fd: i32, buf: &mut [u8]) -> io::Result<usize> { in read_signature() argument
H A Dmain.rs62 fn validate_and_cast_size(size: i32) -> Result<usize, Status> { in validate_and_cast_size() argument
114 let size: usize = validate_and_cast_size(size)?; in readFile()
128 let size: usize = validate_and_cast_size(size)?; in readFsverityMerkleTree()
164 let size = MAX_REQUESTING_DATA as usize; in readFsveritySignature()
171 let mut buf = vec![0; MAX_REQUESTING_DATA as usize]; in readFsveritySignature()
196 if buf.len() > i32::MAX as usize { in writeFile()
229 fn read_into_buf(file: &File, max_size: usize, offset: u64) -> io::Result<Vec<u8>> { in read_into_buf() argument
231 let buf_size = min(remaining, max_size as u64) as usize; in read_into_buf()
/aosp12/packages/modules/Virtualization/authfs/src/file/
H A Dremote_file.rs35 ) -> io::Result<usize> { in remote_read_chunk() argument
62 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
81 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
110 fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> { in write_at() argument
119 Ok(size as usize) // within range because size is supposed to <= buf.len(), which is a usize in write_at()
135 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
H A Dlocal_file.rs44 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
50 let read_size = (end - start) as usize; in read_chunk()
/aosp12/system/bt/gd/rust/link/src/acl/
H A Dfragment.rs15 const L2CAP_BASIC_FRAME_HEADER_LEN: usize = 4;
19 remaining: usize,
80 fn get_l2cap_pdu_size(first_packet: &Bytes) -> usize { in get_l2cap_pdu_size() argument
86 (&first_packet[..]).get_u16_le() as usize in get_l2cap_pdu_size()
92 mtu: usize, in fragmenting_stream() argument
/aosp12/system/bt/gd/rust/hal/src/
H A Drootcanal_hal.rs29 const SIZE_OF_EVENT_HEADER: usize = 2;
30 const _SIZE_OF_SCO_HEADER: usize = 3;
31 const SIZE_OF_ACL_HEADER: usize = 4;
32 const SIZE_OF_ISO_HEADER: usize = 4;
91 let len: usize = buffer[1].into(); in dispatch_incoming()
104 let len: usize = (buffer[2] as u16 + ((buffer[3] as u16) << 8)).into(); in dispatch_incoming()
117 let len: usize = (buffer[2] as u16 + (((buffer[3] & 0x3f) as u16) << 8)).into(); in dispatch_incoming()
/aosp12/packages/modules/Virtualization/zipfuse/src/
H A Dmain.rs210 let mut buf = Vec::with_capacity(inode_data.size as usize); in open()
254 ) -> io::Result<usize> { in read() argument
260 let start = offset as usize; in read()
261 let end = start + size as usize; in read()
327 let start = offset as usize; in readdir()
331 let mut estimate: usize = 0; // estimated number of bytes we will be writing in readdir()
333 while estimate < size as usize && end < buf.len() { in readdir()
351 cur: usize, // the current index in `inner`. `next` advances this.
463 assert_eq!(content.len(), metadata.len() as usize); in check_file()
614 const NUM_FILES: usize = 1 << 10; in large_dir()
H A Dinode.rs47 type ZipIndex = usize;
123 _ => self.table.get(inode as usize), in get()
130 _ => self.table.get_mut(inode as usize), in get_mut()
/aosp12/system/security/keystore2/apc_compat/
H A Dapc_compat.rs97 unsafe { slice::from_raw_parts(tbs_message, s as usize) }, in confirmation_result_callback()
107 unsafe { slice::from_raw_parts(confirmation_token, s as usize) }, in confirmation_result_callback()
/aosp12/system/security/keystore2/src/database/
H A Dutils.rs57 pub struct SqlField<'a>(usize, &'a Row<'a>);
61 pub fn new(index: usize, row: &'a Row<'a>) -> Self { in new() argument
/aosp12/system/security/keystore2/aaid/
H A Dlib.rs32 0 => Ok(buffer[0..size as usize].to_vec()), in get_aaid()

12