| /linux/rust/kernel/ |
| H A D | str.rs | 52 pub const fn from_bytes(bytes: &[u8]) -> &Self { 71 .map(Self::from_bytes) 163 BStr::from_bytes(&self.0[index]) in as_ref() 169 BStr::from_bytes(self) 195 const C: &'static $crate::str::BStr = $crate::str::BStr::from_bytes(S.as_bytes()); in as_char_ptr_in_const_context() 391 BStr::from_bytes(self.to_bytes()) 516 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_debug() 518 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_debug() 520 let others = BStr::from_bytes(b"\x01"); in test_bstr_debug() 522 let non_ascii = BStr::from_bytes( in test_bstr_debug() 39 pub const fn from_bytes(bytes: &[u8]) -> &Self { from_bytes() method [all...] |
| /linux/rust/zerocopy/src/ |
| H A D | ref.rs | 311 pub fn from_bytes(source: B) -> Result<Ref<B, T>, CastError<B, T>> { in from_bytes() function 500 Self::from_bytes(source) in from_bytes_with_elems() 552 Self::from_bytes(prefix).map(move |l| (l, bytes)) in from_prefix_with_elems() 605 Self::from_bytes(suffix).map(move |l| (bytes, l)) in from_suffix_with_elems() 1009 let r = Ref::<&mut [u8], u8>::from_bytes(&mut buf).unwrap(); in test_mut_slice_into_ref() 1019 let r = Ref::<_, u8>::from_bytes(&buf[..]).unwrap(); in test_address() 1025 let r = Ref::<_, [u8]>::from_bytes(&buf[..]).unwrap(); in test_address() 1095 test_new_helper(Ref::<_, AU64>::from_bytes(&mut buf.t[..]).unwrap()); in test_new_aligned_sized() 1118 test_new_helper_slice(Ref::<_, [AU64]>::from_bytes(&mut buf.t[..]).unwrap(), 3); in test_new_aligned_sized() 1175 assert!(Ref::<_, AU64>::from_bytes(&buf.t[..]).is_err()); in test_new_error() [all …]
|
| H A D | deprecated.rs | 27 Self::from_bytes(bytes).ok() in new() 72 Self::from_bytes(bytes).ok() in new_unaligned() 119 Self::from_bytes(bytes).ok() in new_slice() 135 Ref::from_bytes(bytes).ok() in new_slice_unaligned() 268 let r: Ref<&[u8], [u8]> = Ref::from_bytes(bytes).unwrap(); in test_deprecated_into_slice() 277 let r: Ref<&mut [u8], [u8]> = Ref::from_bytes(&mut bytes[..]).unwrap(); in test_deprecated_into_mut_slice()
|
| H A D | byteorder.rs | 569 pub const fn from_bytes(bytes: [u8; $bytes]) -> $name<O> { 1119 fn from_bytes(bytes: Self::ByteArray) -> Self; in from_bytes() method 1196 fn from_bytes(bytes: [u8; mem::size_of::<$native>()]) -> $name<O> { 1320 const _FROM_BYTES: U16 = U16::from_bytes([0, 1]); in test_const_methods() 1359 let from_bytes = T::from_bytes(bytes); in test_endian() localVariable 1361 from_native.assert_eq_or_nan(from_bytes); in test_endian() 1363 from_bytes.get().assert_eq_or_nan(native); in test_endian() 1366 assert_eq!(from_bytes.into_bytes(), bytes); in test_endian() 1567 let val_be = U16::<BigEndian>::from_bytes([0, 1]); in test_byteorder_traits_coverage() 1568 let val_le = U16::<LittleEndian>::from_bytes([1, 0]); in test_byteorder_traits_coverage() [all …]
|
| /linux/scripts/crypto/ |
| H A D | gen-hash-testvecs.py | 54 self.r = int.from_bytes(key[:16], byteorder='little') & rclamp 55 self.s = int.from_bytes(key[16:], byteorder='little') 61 c = int.from_bytes(chunk, byteorder='little') + 2**(8 * len(chunk)) 88 return Ghash.reflect_bits_in_bytes(int.from_bytes(data, byteorder='little')) 125 self.h = int.from_bytes(key, byteorder='little') 132 self.acc ^= int.from_bytes(data[i:i+16], byteorder='little') 260 return int.from_bytes(bytestr[pos//8 : pos//8 + length//8], byteorder='little')
|
| /linux/rust/zerocopy-derive/ |
| H A D | lib.rs | 124 derive!(FromZeros => derive_from_zeros => crate::derive::from_bytes::derive_from_zeros); 125 derive!(FromBytes => derive_from_bytes => crate::derive::from_bytes::derive_from_bytes); 146 (crate::derive::from_bytes::derive_from_bytes, Trait::FromBytes), in most_traits()
|
| /linux/rust/zerocopy-derive/derive/ |
| H A D | from_bytes.rs | 102 let from_bytes = match &ctx.ast.data { in derive_from_bytes() localVariable 108 Ok(IntoIterator::into_iter([from_zeros, from_bytes]).collect()) in derive_from_bytes()
|
| H A D | mod.rs | 3 pub mod from_bytes; module
|
| /linux/scripts/gdb/linux/ |
| H A D | pgtable.py | 88 data = int.from_bytes(
|
| /linux/tools/testing/selftests/net/openvswitch/ |
| H A D | ovs-dpctl.py | 1149 lambda x: int.from_bytes(x, "big"), 1156 lambda x: int.from_bytes(x, "big"), 1425 lambda x: int.from_bytes(x, "big"), 1432 lambda x: int.from_bytes(x, "big"), 1469 ("sll", "sll", macstr, lambda x: int.from_bytes(x, "big")), 1470 ("tll", "tll", macstr, lambda x: int.from_bytes(x, "big")),
|
| /linux/tools/testing/selftests/tpm2/ |
| H A D | tpm2.py | 745 pcrSelect = int.from_bytes(pcrSelect, byteorder='big')
|