Home
last modified time | relevance | path

Searched refs:from_slice (Results 1 – 25 of 131) sorted by relevance

123456

/external/rust/crates/num-bigint/tests/
Dbiguint_scalar.rs22 let a = BigUint::from_slice(a_vec); in test_scalar_add()
23 let b = BigUint::from_slice(b_vec); in test_scalar_add()
24 let c = BigUint::from_slice(c_vec); in test_scalar_add()
41 let a = BigUint::from_slice(a_vec); in test_scalar_sub()
42 let b = BigUint::from_slice(b_vec); in test_scalar_sub()
43 let c = BigUint::from_slice(c_vec); in test_scalar_sub()
60 let a = BigUint::from_slice(a_vec); in test_scalar_mul()
61 let b = BigUint::from_slice(b_vec); in test_scalar_mul()
62 let c = BigUint::from_slice(c_vec); in test_scalar_mul()
87 let a = BigUint::from_slice(a_vec); in test_scalar_div_rem()
[all …]
Dbigint_scalar.rs24 let a = BigInt::from_slice(Plus, a_vec); in test_scalar_add()
25 let b = BigInt::from_slice(Plus, b_vec); in test_scalar_add()
26 let c = BigInt::from_slice(Plus, c_vec); in test_scalar_add()
50 let a = BigInt::from_slice(Plus, a_vec); in test_scalar_sub()
51 let b = BigInt::from_slice(Plus, b_vec); in test_scalar_sub()
52 let c = BigInt::from_slice(Plus, c_vec); in test_scalar_sub()
76 let a = BigInt::from_slice(Plus, a_vec); in test_scalar_mul()
77 let b = BigInt::from_slice(Plus, b_vec); in test_scalar_mul()
78 let c = BigInt::from_slice(Plus, c_vec); in test_scalar_mul()
123 let a = BigInt::from_slice(Plus, a_vec); in test_scalar_div_rem()
[all …]
Dbiguint.rs96 let data: Vec<BigUint> = data.iter().map(|v| BigUint::from_slice(*v)).collect(); in test_cmp()
169 let a = BigUint::from_slice(a_vec); in test_bitand()
170 let b = BigUint::from_slice(b_vec); in test_bitand()
171 let c = BigUint::from_slice(c_vec); in test_bitand()
184 let a = BigUint::from_slice(a_vec); in test_bitor()
185 let b = BigUint::from_slice(b_vec); in test_bitor()
186 let c = BigUint::from_slice(c_vec); in test_bitor()
199 let a = BigUint::from_slice(a_vec); in test_bitxor()
200 let b = BigUint::from_slice(b_vec); in test_bitxor()
201 let c = BigUint::from_slice(c_vec); in test_bitxor()
[all …]
Dbigint.rs199 nums.push(BigInt::from_slice(Minus, *s)); in test_cmp()
202 nums.extend(vs.iter().map(|s| BigInt::from_slice(Plus, *s))); in test_cmp()
389 check(&BigInt::from_slice(Plus, &[0, 0, 1]), pow(2.0_f32, 64)); in test_convert_f32()
487 check(&BigInt::from_slice(Plus, &[0, 0, 1]), pow(2.0_f64, 64)); in test_convert_f64()
588 check!(u8, BigInt::from_slice(Plus, &[u8::MAX as u32])); in test_convert_from_uint()
589 check!(u16, BigInt::from_slice(Plus, &[u16::MAX as u32])); in test_convert_from_uint()
590 check!(u32, BigInt::from_slice(Plus, &[u32::MAX])); in test_convert_from_uint()
591 check!(u64, BigInt::from_slice(Plus, &[u32::MAX, u32::MAX])); in test_convert_from_uint()
594 BigInt::from_slice(Plus, &[u32::MAX, u32::MAX, u32::MAX, u32::MAX]) in test_convert_from_uint()
615 BigInt::from_slice(Minus, &[1 << 7]), in test_convert_from_int()
[all …]
Dbigint_bitwise.rs16 &N => Some(BigInt::from_slice(Sign::NoSign, &[])), in to_bigint()
17 &P(s) => Some(BigInt::from_slice(Sign::Plus, s)), in to_bigint()
18 &M(s) => Some(BigInt::from_slice(Sign::Minus, s)), in to_bigint()
/external/rust/crates/serde_cbor/tests/
Dde.rs57 de::from_slice(&[0x66, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]); in test_string1()
63 let value: error::Result<Value> = de::from_slice(&[ in test_string2()
73 let value: error::Result<Value> = de::from_slice(slice); in test_string3()
83 de::from_slice(&[0x46, 0x66, 0x6f, 0x6f, 0x62, 0x61, 0x72]); in test_byte_string()
89 let value: error::Result<Value> = de::from_slice(&[0x00]); in test_numbers1()
95 let value: error::Result<Value> = de::from_slice(&[0x1a, 0x00, 0xbc, 0x61, 0x4e]); in test_numbers2()
101 let value: error::Result<Value> = de::from_slice(&[0x39, 0x07, 0xde]); in test_numbers3()
107 let value: error::Result<Value> = de::from_slice(b"\xf4"); in test_bool()
113 let value: error::Result<Value> = de::from_slice(b"\xf4trailing"); in test_trailing_bytes()
119 let value: error::Result<Value> = de::from_slice(b"\x83\x01\x02\x03"); in test_list1()
[all …]
Denum.rs36 use serde_cbor::{from_slice, to_vec};
63 let re: EnumStruct = from_slice(raw).unwrap(); in test_enum()
82 let re: ReprEnumStruct = from_slice(&to_vec(&repr_enum_struct).unwrap()).unwrap(); in test_repr_enum()
96 let re_a: DataEnum = from_slice(&to_vec(&data_enum_a).unwrap()).unwrap(); in test_data_enum()
99 let re_b: DataEnum = from_slice(&to_vec(&data_enum_b).unwrap()).unwrap(); in test_data_enum()
106 let re_c: DataEnum = from_slice(&to_vec(&data_enum_c).unwrap()).unwrap(); in test_data_enum()
129 assert_eq!(from_slice::<Newtype>(&[24, 142]).unwrap(), Newtype(142)); in test_newtype_struct()
141 let value: Vec<Foo> = from_slice(slice).unwrap(); in test_variable_length_array()
218 let empty_str_ds = from_slice(&empty_str_s).unwrap(); in test_enum_as_map()
221 let number_vec_ds = from_slice(&number_vec_s).unwrap(); in test_enum_as_map()
[all …]
Dser.rs48 use serde_cbor::{from_slice, to_vec};
72 let test_object = from_slice(&vec[..]).unwrap(); in test_object()
93 let test_object = from_slice(&vec[..]).unwrap(); in test_object_list_keys()
123 let test_object = from_slice(&vec[..]).unwrap(); in test_object_object_keys()
195 let test_addr: Ipv4Addr = from_slice(&vec).unwrap(); in test_ip_addr()
252 assert_eq!(from_slice::<f32>(&vec[..]).unwrap(), 42.5f32); in test_half()
Dtags.rs4 use serde_cbor::{from_slice, to_vec};
42 let value1: Value = from_slice(&bytes1).unwrap(); in tagged_cbor_roundtrip()
44 let value2: Value = from_slice(&bytes2).unwrap(); in tagged_cbor_roundtrip()
Dstd_types.rs10 use serde_cbor::{from_reader, from_slice};
28 let parsed: f64 = from_slice(&serialized[..]).unwrap();
60 let parsed: $ty = from_slice(&serialized[..]).expect("de1 works");
63 let parsed_from_packed: $ty = from_slice(packed).expect("parsing packed");
/external/rust/crates/coset/src/common/
Dtests.rs48 let got = Label::from_slice(&got).unwrap(); in test_label_encode()
112 let result = Label::from_slice(&data); in test_label_decode_fail()
129 let got = RegisteredLabel::from_slice(&got).unwrap(); in test_registered_label_encode()
193 let result = RegisteredLabel::<iana::EllipticCurve>::from_slice(&data); in test_registered_label_decode_fail()
233 let got = RegisteredLabelWithPrivate::from_slice(&got).unwrap(); in test_registered_label_with_private_encode()
303 let result = RegisteredLabelWithPrivate::<iana::Algorithm>::from_slice(&data); in test_registered_label_with_private_decode_fail()
331 let got = Label::from_slice(&data).unwrap(); in test_large_label_decode()
344 let result = Label::from_slice(&data); in test_large_label_decode_fail()
357 let result = RegisteredLabel::<crate::iana::HeaderParameter>::from_slice(&data); in test_large_registered_label_decode_fail()
370 let result = RegisteredLabelWithPrivate::<crate::iana::HeaderParameter>::from_slice(&data); in test_large_registered_label_with_private_decode_fail()
/external/rust/beto-rust/nearby/crypto/crypto_provider_rustcrypto/src/aes/
Dgcm_siv.rs33 .encrypt_in_place(Nonce::from_slice(nonce), aad, data) in encrypt()
39 .decrypt_in_place(Nonce::from_slice(nonce), aad, data) in decrypt()
55 .encrypt_in_place(Nonce::from_slice(nonce), aad, data) in encrypt()
61 .decrypt_in_place(Nonce::from_slice(nonce), aad, data) in decrypt()
/external/crosvm/common/data_model/src/
Dlib.rs61 fn from_slice(data: &[u8]) -> Option<&Self> { in from_slice() method
84 .and_then(|slice| Self::from_slice(slice)) in read_from_prefix()
190 let from_aligned = $T::from_slice(aligned_v);
201 let from_unaligned = $T::from_slice(unaligned_v);
/external/rust/beto-rust/nearby/presence/xts_aes/tests/
Dxts_roundtrip_tests.rs88 aes::Aes128::new(cipher::generic_array::GenericArray::from_slice(&key[0..16])); in identical_to_xtsmode_crate()
90 aes::Aes128::new(cipher::generic_array::GenericArray::from_slice(&key[16..])); in identical_to_xtsmode_crate()
101 aes::Aes256::new(cipher::generic_array::GenericArray::from_slice(&key[0..32])); in identical_to_xtsmode_crate()
103 aes::Aes256::new(cipher::generic_array::GenericArray::from_slice(&key[32..])); in identical_to_xtsmode_crate()
/external/rust/crates/bytes/src/
Dserde.rs8 ($ty:ident, $visitor_ty:ident, $from_slice:ident, $from_vec:ident) => {
48 Ok($ty::$from_slice(v))
64 Ok($ty::$from_slice(v.as_bytes()))
/external/rust/crates/serde_cbor/examples/
Dtags.rs65 let value1: Value = serde_cbor::from_slice(&bytes1)?; in main()
70 let value2: Value = serde_cbor::from_slice(&bytes2)?; in main()
73 let result: Bookmark = serde_cbor::from_slice(&bytes2)?; in main()
/external/rust/crates/coset/src/sign/
Dtests.rs103 let mut got = CoseSignature::from_slice(&got).unwrap(); in test_cose_signature_encode()
121 let mut got = CoseSignature::from_slice(&sig_data).unwrap(); in test_cose_signature_decode_noncanonical()
198 let result = CoseSignature::from_slice(&data); in test_cose_signature_decode_fail()
382 let mut got = CoseSign::from_slice(&got).unwrap(); in test_cose_sign_encode()
505 let result = CoseSign::from_slice(&data); in test_cose_sign_decode_fail()
835 let mut got = CoseSign1::from_slice(&got).unwrap(); in test_cose_sign1_encode()
938 let result = CoseSign1::from_slice(&data); in test_cose_sign1_decode_fail()
972 let mut got = CoseSign1::from_slice(&data).unwrap(); in test_cose_sign1_decode_noncanonical()
1150 let mut sign = CoseSign::from_slice(&sign_data).unwrap(); in test_sign_roundtrip()
1234 let sign = CoseSign::from_slice(&sign_data).unwrap(); in test_sign_noncanonical()
[all …]
/external/rust/crates/coset/src/cwt/
Dtests.rs111 let got = ClaimsSet::from_slice(&got).unwrap(); in test_cwt_encode()
194 let result = ClaimsSet::from_slice(&data); in test_cwt_decode_fail()
233 let result = ClaimsSet::from_slice(&data); in test_cwt_dup_claim()
/external/rust/crates/gdbstub/src/protocol/commands/
Dbreakpoint.rs25 pub fn from_slice(body: &'a mut [u8]) -> Option<BasicBreakpoint<'a>> { in from_slice() method
43 pub fn from_slice(body: &'a mut [u8]) -> Option<BytecodeBreakpoint<'a>> { in from_slice() method
46 let base = BasicBreakpoint::from_slice(body.next()?)?; in from_slice()
/external/rust/crates/uuid/src/external/
Dserde_support.rs78 Uuid::from_slice(value).map_err(de_error) in deserialize()
121 Uuid::from_slice(value).map_err(de_error) in deserialize()
172 u: crate::Uuid::from_slice(uuid_bytes).unwrap(), in test_serialize_compact()
226 let u = Uuid::from_slice(uuid_bytes).unwrap(); in test_deserialize_readable_compact()
256 let u = Uuid::from_slice(uuid_bytes).unwrap(); in test_deserialize_readable_bytes()
292 let u = Uuid::from_slice(uuid_bytes).unwrap(); in test_serialize_non_human_readable()
/external/rust/crates/coset/src/key/
Dtests.rs213 let got = CoseKey::from_slice(&got).unwrap(); in test_cose_key_encode()
226 let got = CoseKeySet::from_slice(&got_data).unwrap(); in test_cose_key_encode()
298 let got = CoseKey::from_slice(&got).unwrap(); in test_rfc8152_public_cose_key_decode()
435 let got = CoseKey::from_slice(&got).unwrap(); in test_rfc8152_private_cose_key_decode()
565 let result = CoseKey::from_slice(&data); in test_cose_key_decode_fail()
583 let result = CoseKeySet::from_slice(&data); in test_cose_keyset_decode_fail()
612 let result = CoseKey::from_slice(&data); in test_cose_key_decode_dup_fail()
/external/rust/beto-rust/nearby/crypto/crypto_provider_openssl/src/
Dp256.rs79 let bn_x = BigNum::from_slice(x)?;
80 let bn_y = BigNum::from_slice(y)?;
155 let private_key_bn = BigNum::from_slice(private_bytes)?;
/external/rust/crates/coset/src/header/
Dtests.rs155 let mut got = Header::from_slice(&got).unwrap(); in test_header_encode()
170 let mut got = ProtectedHeader::from_slice(&protected_data).unwrap(); in test_header_encode()
357 let result = Header::from_slice(&data); in test_header_decode_fail()
386 let result = Header::from_slice(&data); in test_header_decode_dup_fail()
/external/rust/crates/coset/examples/
Dcwt.rs80 let sign1 = coset::CoseSign1::from_slice(&sign1_data)?; in main()
92 let recovered_claims = cwt::ClaimsSet::from_slice(&sign1.payload.unwrap())?; in main()
/external/rust/crates/bytes/src/buf/
Duninit_slice.rs25 pub(crate) fn from_slice(slice: &mut [MaybeUninit<u8>]) -> &mut UninitSlice { in from_slice() method
51 Self::from_slice(maybe_init) in from_raw_parts_mut()

123456