Home
last modified time | relevance | path

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

123

/packages/modules/Virtualization/authfs/src/fsverity/
Deditor.rs75 debug_assert!(usize::MAX as u64 == u64::MAX, "Only 64-bit arch is supported"); in debug_assert_usize_is_u64()
92 pub fn get_fsverity_digest_size(&self) -> usize { in get_fsverity_digest_size() argument
106 ) -> io::Result<usize> { in read_backing_chunk_unverified() argument
115 ) -> io::Result<usize> { in read_backing_chunk_verified() argument
118 if merkle_tree_locked.is_index_valid(chunk_index as usize) { in read_backing_chunk_verified()
123 if !merkle_tree_locked.is_consistent(chunk_index as usize, &hash) { in read_backing_chunk_verified()
135 offset_from_alignment: usize, in new_hash_for_incomplete_write() argument
136 output_chunk_index: usize, in new_hash_for_incomplete_write() argument
142 let mut orig_data = [0u8; CHUNK_SIZE as usize]; in new_hash_for_incomplete_write()
166 offset_from_alignment: usize, in new_chunk_hash() argument
[all …]
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 …]
Dverifier.rs25 const ZEROS: [u8; CHUNK_SIZE as usize] = [0u8; CHUNK_SIZE as usize];
29 fn hash_with_padding(chunk: &[u8], pad_to: usize) -> Result<HashBuffer, CryptoError> { in hash_with_padding()
45 let chunk_hash = hash_with_padding(chunk, CHUNK_SIZE as usize)?; in verity_check()
62 Ok(hash_with_padding(&merkle_chunk, CHUNK_SIZE as usize)?) in verity_check()
76 ) -> Result<impl Iterator<Item = Result<([u8; 4096], usize), FsverityError>> + '_, FsverityError> { in fsverity_walk() argument
99 let hash_offset_in_chunk = (global_hash_offset % CHUNK_SIZE) as usize;
128 let mut buf = [0u8; CHUNK_SIZE as usize]; in new()
149 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
188 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
194 let read_size = (end - start) as usize; in read_chunk()
[all …]
/packages/modules/Bluetooth/tools/pdl/src/
Dast.rs9 pub type FileId = usize;
18 pub offset: usize,
20 pub line: usize,
22 pub column: usize,
59 Integer { loc: SourceRange, value: usize },
71 pub value: usize,
88 Padding { loc: SourceRange, width: usize },
90 Size { loc: SourceRange, field_id: String, width: usize },
92 Count { loc: SourceRange, field_id: String, width: usize },
100 width: Option<usize>,
[all …]
Dparser.rs142 type Context<'a> = (ast::FileId, &'a Vec<usize>);
148 fn as_usize(&self) -> Result<usize, String>; in as_usize() argument
169 fn as_usize(&self) -> Result<usize, String> { in as_usize() argument
172 usize::from_str_radix(num, 16) in as_usize()
176 usize::from_str_radix(text, 10) in as_usize()
206 fn parse_integer(iter: &mut NodeIterator<'_>) -> Result<usize, String> { in parse_integer() argument
214 fn parse_integer_opt(iter: &mut NodeIterator<'_>) -> Result<Option<usize>, String> { in parse_integer_opt() argument
220 ) -> Result<(Option<String>, Option<usize>), String> { in parse_identifier_or_integer() argument
Dlint.rs134 fn bit_width(val: usize) -> usize { in bit_width() argument
135 usize::BITS as usize - val.leading_zeros() as usize in bit_width()
627 fn lint_enum(tags: &[Tag], width: usize, result: &mut LintDiagnostics) { in lint_enum() argument
728 _width: usize, in lint_size() argument
846 _width: usize, in lint_count() argument
907 width: &Option<usize>, in lint_fixed() argument
908 value: &Option<usize>, in lint_fixed() argument
972 _width: &Option<usize>, in lint_array() argument
975 _size: &Option<usize>, in lint_array() argument
/packages/modules/Virtualization/libs/idsig/src/
Dhashtree.rs35 input_size: usize, in from() argument
37 block_size: usize, in from() argument
69 input_size: usize, in generate_hash_tree() argument
71 block_size: usize, in generate_hash_tree() argument
119 block_size: usize, in hash_one_block() argument
130 type Range = std::ops::Range<usize>;
133 fn calc_hash_levels(input_size: usize, block_size: usize, digest_size: usize) -> Vec<Range> { in calc_hash_levels() argument
172 fn round_to_multiple(n: usize, unit: usize) -> usize { in round_to_multiple() argument
211 let size = std::fs::metadata(&input_name)?.len() as usize; in compare_with_golden_output()
Dapksigv4.rs167 block_size: usize, in create() argument
173 let size = apk.seek(SeekFrom::End(0))? as usize; in create()
306 let mut data = vec![0; size as usize]; in read_sized_array()
316 fn log2(n: usize) -> u8 { in log2()
317 let num_bits = std::mem::size_of::<usize>() * 8; in log2()
/packages/modules/Virtualization/authfs/src/
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
Dfile.rs22 pub type ChunkBuffer = [u8; CHUNK_SIZE as usize];
50 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize>; in read_chunk() argument
61 fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize>; in write_at() argument
95 let file_size = usize::try_from(file_size).unwrap(); in new()
97 let mut chunk_buffer = [0; CHUNK_SIZE as usize]; in new()
114 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
115 if let Some(chunk) = &self.buffer.chunks(CHUNK_SIZE as usize).nth(chunk_index as usize) { in read_chunk()
Dfusefs.rs149 prev_offset: usize,
468 ) -> io::Result<usize> { in read_chunks() argument
470 let size_to_read = std::cmp::min(size as usize, remaining as usize); in read_chunks()
471 let total = ChunkedSizeIter::new(size_to_read, offset, CHUNK_SIZE as usize).try_fold( in read_chunks()
478 let mut buf = [0u8; CHUNK_SIZE as usize]; in read_chunks()
484 let begin = (current_offset % CHUNK_SIZE) as usize; in read_chunks()
712 ) -> io::Result<usize> { in read() argument
745 ) -> io::Result<usize> { in write() argument
748 let mut buf = vec![0; size as usize]; in write()
835 if digest.len() > size as usize { in getxattr()
/packages/modules/Bluetooth/system/gd/rust/stack/src/hal/
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;
104 let len: usize = buffer[1].into(); in dispatch_incoming()
117 let len: usize = (buffer[2] as u16 + ((buffer[3] as u16) << 8)).into(); in dispatch_incoming()
130 let len: usize = (buffer[2] as u16 + (((buffer[3] & 0x3f) as u16) << 8)).into(); in dispatch_incoming()
143 let len: usize = buffer[2].into(); in dispatch_incoming()
/packages/modules/Virtualization/authfs/src/file/
Dremote_file.rs30 ) -> io::Result<usize> { in remote_read_chunk() argument
77 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
94 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
120 fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> { in write_at() argument
127 Ok(size as usize) // within range because size is supposed to <= buf.len(), which is a usize in write_at()
141 fn read_chunk(&self, chunk_index: u64, buf: &mut ChunkBuffer) -> io::Result<usize> { in read_chunk() argument
/packages/modules/Bluetooth/system/gd/rust/stack/src/link/acl/
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
/packages/modules/Virtualization/libs/apkverify/src/
Dziputil.rs24 const EOCD_MIN_SIZE: usize = 22;
25 const EOCD_CENTRAL_DIRECTORY_SIZE_FIELD_OFFSET: usize = 12;
26 const EOCD_CENTRAL_DIRECTORY_OFFSET_FIELD_OFFSET: usize = 16;
50 let mut eocd = vec![0u8; eocd_size as usize]; in zip_sections()
123 let cd = &pre_eocd[cd_offset as usize..]; in test_reject_if_extra_data_between_cd_and_eocd()
/packages/modules/Virtualization/authfs/fd_server/src/
Dfsverity.rs42 fn read_metadata(fd: i32, metadata_type: u64, offset: u64, buf: &mut [u8]) -> io::Result<usize> { in read_metadata() argument
50 Ok(unsafe { read_verity_metadata(fd, &mut arg) }? as usize) in read_metadata()
55 pub fn read_merkle_tree(fd: i32, offset: u64, buf: &mut [u8]) -> io::Result<usize> { in read_merkle_tree() argument
60 pub fn read_signature(fd: i32, buf: &mut [u8]) -> io::Result<usize> { in read_signature() argument
Daidl.rs122 let size: usize = validate_and_cast_size(size)?; in readFile()
137 let size: usize = validate_and_cast_size(size)?; in readFsverityMerkleTree()
182 let mut buf = vec![0; MAX_REQUESTING_DATA as usize]; in readFsveritySignature()
206 if buf.len() > i32::MAX as usize { in writeFile()
389 fn read_into_buf(file: &File, max_size: usize, offset: u64) -> io::Result<Vec<u8>> { in read_into_buf() argument
391 let buf_size = min(remaining, max_size as u64) as usize; in read_into_buf()
412 fn validate_and_cast_size(size: i32) -> Result<usize, Status> { in validate_and_cast_size() argument
/packages/modules/Virtualization/microdroid_manager/src/payload/
Dapex.rs68 const FOOTER_SIZE: usize = size_of::<AvbFooter>();
69 const HASHTREE_DESCRIPTOR_SIZE: usize = size_of::<AvbHashtreeDescriptor>();
107 let vbmeta_size = footer.vbmeta_size as usize; in from()
118 let mut pk_len: usize = 0; in verify()
139 let mut num: usize = 0; in descriptors()
184 from_raw_parts(digest_ptr, self.inner.root_digest_len as usize) in root_digest()
/packages/modules/Bluetooth/tools/rootcanal/lmp/src/
Dec.rs43 pub fn new(size: usize) -> Option<Self> { in new()
68 pub fn size(&self) -> usize { in size() argument
204 const PRIVATE_KEY_SIZE: usize;
205 const PUBLIC_KEY_SIZE: usize;
231 const PRIVATE_KEY_SIZE: usize = 24;
232 const PUBLIC_KEY_SIZE: usize = 48;
257 const PRIVATE_KEY_SIZE: usize = 32;
258 const PUBLIC_KEY_SIZE: usize = 64;
393 struct EcTestCase<const N: usize> {
Dffi.rs16 send_hci_event: unsafe extern "C" fn(user: *mut (), data: *const u8, len: usize),
18 unsafe extern "C" fn(user: *mut (), to: *const [u8; 6], data: *const u8, len: usize),
121 len: usize, in link_manager_ingest_hci() argument
150 len: usize, argument
/packages/modules/Virtualization/zipfuse/src/
Dmain.rs108 Uncompressed(usize), // zip index
245 let mut buf = Vec::with_capacity(inode_data.size as usize); in open()
292 ) -> io::Result<usize> { in read() argument
307 w.write_from(&mut raw_file, size as usize, start)? in read()
310 let start = offset as usize; in read()
311 let end = start + size as usize; in read()
378 let start = offset as usize; in readdir()
382 let mut estimate: usize = 0; // estimated number of bytes we will be writing in readdir()
384 while estimate < size as usize && end < buf.len() { in readdir()
402 cur: usize, // the current index in `inner`. `next` advances this.
[all …]
/packages/modules/Virtualization/authfs/src/fsverity/metadata/
Dmetadata.rs34 const DESCRIPTOR_OFFSET: usize = 4;
55 pub fn read_merkle_tree(&self, offset: u64, buf: &mut [u8]) -> io::Result<usize> { in read_merkle_tree() argument
59 let read_size = (end - start) as usize; in read_merkle_tree()
129 let mut buf = vec![0u8; header.signature_size as usize]; in parse_fsverity_metadata()
/packages/modules/Virtualization/apkdmverity/src/dm/
Dsys.rs70 pub const DM_NAME_LEN: usize = 128;
71 pub const DM_UUID_LEN: usize = 129;
72 pub const DM_MAX_TYPE_NAME: usize = 16;
/packages/modules/Bluetooth/system/gd/rust/topshim/src/
Dbtif.rs199 pub fn ascii_to_string(data: &[u8], length: usize) -> String { in ascii_to_string()
318 const PROPERTY_NAME_MAX: usize = 255;
346 fn get_len(&self) -> usize { in get_len() argument
474 unsafe { std::slice::from_raw_parts(prop.val as *mut u8, prop.len as usize) }; in from()
475 let len = prop.len as usize; in from()
727 let _2 = ptr_to_vec(_2, _1 as usize);
732 let _3 = ptr_to_vec(_3, _2 as usize);
736 let _1 = ptr_to_vec(_1, _0 as usize);
1063 pub(crate) fn ptr_to_vec<T: Copy, U: From<T>>(start: *const T, length: usize) -> Vec<U> { in ptr_to_vec()
1082 &f as *const _ as usize - &f.address as *const _ as usize, in test_offset()
[all …]
/packages/modules/DnsResolver/doh/
Dencoding.rs40 let c = |byte| CHARSET[(byte as usize) % CHARSET.len()]; in probe_query()
86 const PROBE_QUERY_SIZE: usize = 56;
87 const H3_DNS_REQUEST_HEADER_SIZE: usize = 6;

123