Home
last modified time | relevance | path

Searched refs:Result (Results 1 – 25 of 44) sorted by relevance

12

/trusty/user/base/lib/storage/rust/src/
Dtransaction.rs22 pub fn commit(self) -> Result<(), Error> { in commit() argument
29 pub fn discard(self) -> Result<(), Error> { in discard() argument
33 fn end_transaction(self, complete: bool) -> Result<(), Error> { in end_transaction() argument
62 pub fn open_file(&mut self, name: &str, mode: OpenMode) -> Result<SecureFile, Error> { in open_file()
86 ) -> Result<&'buf [u8], Error> { in read_all()
109 ) -> Result<&'buf [u8], Error> { in read_at()
118 pub fn write_all(&mut self, file: &mut SecureFile, buf: &[u8]) -> Result<(), Error> { in write_all() argument
132 ) -> Result<(), Error> { in write_at() argument
137 pub fn get_size(&mut self, file: &SecureFile) -> Result<usize, Error> { in get_size()
147 pub fn set_size(&mut self, file: &mut SecureFile, size: usize) -> Result<(), Error> { in set_size() argument
[all …]
Dlib.rs187 pub fn new(port: Port, wait_for_port: bool) -> Result<Self, Error> { in new()
234 pub fn open_file(&mut self, name: &str, mode: OpenMode) -> Result<SecureFile, Error> { in open_file()
253 ) -> Result<SecureFile, Error> { in open_file_impl()
301 pub fn read<'buf>(&mut self, path: &str, buf: &'buf mut [u8]) -> Result<&'buf [u8], Error> { in read()
322 pub fn write(&mut self, path: &str, buf: &[u8]) -> Result<(), Error> { in write() argument
347 ) -> Result<&'buf [u8], Error> { in read_all()
378 ) -> Result<&'buf [u8], Error> { in read_at()
402 pub fn write_all(&mut self, file: &mut SecureFile, buf: &[u8]) -> Result<(), Error> { in write_all() argument
414 ) -> Result<(), Error> { in write_all_impl() argument
440 ) -> Result<(), Error> { in write_at() argument
[all …]
/trusty/user/base/lib/tipc/rust/src/
Dserialization.rs19 fn serialize_bytes(&mut self, bytes: &'s [u8]) -> Result<Self::Ok, Self::Error>; in serialize_bytes()
28 unsafe fn serialize_as_bytes<T: Sized>(&mut self, obj: &'s T) -> Result<Self::Ok, Self::Error> { in serialize_as_bytes()
41 fn serialize_handle(&mut self, handle: &'s Handle) -> Result<Self::Ok, Self::Error>; in serialize_handle()
52 ) -> Result<S::Ok, S::Error>; in serialize()
59 ) -> Result<S::Ok, S::Error> { in serialize()
96 fn deserialize(bytes: &[u8], handles: &mut [Option<Handle>]) -> Result<Self, Self::Error>; in deserialize()
104 fn deserialize(_bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
Dservice.rs29 use crate::{ConnectResult, Deserialize, Handle, MessageResult, Result, TipcError};
84 pub fn new<T: AsRef<str>>(path: T) -> Result<Self> { in new()
126 fn try_clone(&self) -> core::result::Result<Self, Self::Error> { in try_clone()
145 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() argument
162 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() argument
205 pub(crate) fn try_new_port(cfg: &PortCfg) -> Result<Rc<Self>> { in try_new_port()
226 fn try_new_connection(handle: Handle, data: D::Connection) -> Result<Rc<Self>> { in try_new_connection()
260 pub fn try_from_bytes(bytes: &[u8]) -> Result<Self> { in try_from_bytes()
269 pub fn new_from_string(uuid_str: &str) -> Result<Self> { in new_from_string()
275 conversion_fn: fn(&str, u32) -> core::result::Result<T, ParseIntError>, in new_from_string()
[all …]
Dhandle.rs85 pub fn connect(port: &CStr) -> crate::Result<Self> { in connect()
96 pub fn try_clone(&self) -> crate::Result<Self> { in try_clone()
108 pub fn from_raw(fd: i32) -> crate::Result<Self> { in from_raw()
121 pub fn send<'s, T: Serialize<'s>>(&self, msg: &'s T) -> crate::Result<()> { in send() argument
136 pub fn recv<T: Deserialize>(&self, buffer: &mut [u8]) -> Result<T, T::Error> { in recv()
152 ) -> crate::Result<(usize, usize)> { in recv_vectored()
209 pub fn send_vectored(&self, buffers: &[&[u8]], handles: &[Handle]) -> crate::Result<()> { in send_vectored() argument
282 pub(crate) fn wait(&self, timeout: Option<u32>) -> crate::Result<trusty_sys::uevent> { in wait()
303 fn get_msg<F, R>(&self, mut func: F) -> crate::Result<R> in get_msg()
305 F: FnMut(&trusty_sys::ipc_msg_info) -> crate::Result<R>, in get_msg()
[all …]
/trusty/user/base/lib/trusty-std/src/ffi/
Dc_str.rs101 fn try_new<T: TryAllocInto<Vec<u8>>>(t: T) -> Result<CString, TryNewError>; in try_new()
120 unsafe fn try_from_vec_unchecked(v: Vec<u8>) -> Result<CString, AllocError>; in try_from_vec_unchecked()
124 fn try_new<T: TryAllocInto<Vec<u8>>>(t: T) -> Result<CString, TryNewError> { in try_new()
126 fn into_vec(self) -> Result<Vec<u8>, AllocError>; in try_new()
129 default fn into_vec(self) -> Result<Vec<u8>, AllocError> { in try_new()
135 fn into_vec(self) -> Result<Vec<u8>, AllocError> { in try_new()
143 fn into_vec(self) -> Result<Vec<u8>, AllocError> { in try_new()
158 unsafe fn try_from_vec_unchecked(mut v: Vec<u8>) -> Result<CString, AllocError> { in try_from_vec_unchecked()
168 fn try_clone(&self) -> Result<Self, Self::Error> { in try_clone()
/trusty/user/base/lib/trusty-std/src/
Dalloc.rs45 fn try_alloc_into(self) -> Result<T, AllocError>; in try_alloc_into()
52 fn try_alloc_into(self) -> Result<U, AllocError> { in try_alloc_into()
69 fn try_alloc_from(value: T) -> Result<Self, AllocError>; in try_alloc_from()
73 fn try_alloc_from(s: &str) -> Result<Self, AllocError> { in try_alloc_from()
82 fn try_alloc_from(s: &[u8]) -> Result<Self, AllocError> { in try_alloc_from()
96 fn try_push(&mut self, value: T) -> Result<(), TryReserveError>; in try_push() argument
99 fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError>; in try_with_capacity()
103 fn try_push(&mut self, value: T) -> Result<(), TryReserveError> { in try_push() argument
109 fn try_with_capacity(capacity: usize) -> Result<Self, TryReserveError> { in try_with_capacity()
203 fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocError> { in alloc_impl()
[all …]
Dclone_ext.rs43 fn try_clone(&self) -> Result<Self, Self::Error>; in try_clone()
50 fn try_clone(&self) -> Result<Self, Self::Error> { in try_clone()
60 fn try_to_vec<T: TryConvertVec, A: Allocator>(s: &[T], alloc: A) -> Result<Vec<T, A>, AllocError> { in try_to_vec()
65 fn try_to_vec<A: Allocator>(s: &[Self], alloc: A) -> Result<Vec<Self, A>, AllocError> in try_to_vec()
72 default fn try_to_vec<A: Allocator>(s: &[Self], alloc: A) -> Result<Vec<Self, A>, AllocError> { in try_to_vec()
112 fn try_to_vec<A: Allocator>(s: &[Self], alloc: A) -> Result<Vec<Self, A>, AllocError> { in try_to_vec()
132 fn try_clone(&self) -> Result<Self, Self::Error> { in try_clone()
/trusty/user/app/sample/hwcryptohal/server/
Dopaque_key.rs47 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() argument
61 fn new() -> Result<BootUniqueValue, HwCryptoError> { in new()
71 fn get_boot_unique_value() -> Result<BootUniqueValue, HwCryptoError> { in get_boot_unique_value()
99 fn new(policy: &KeyPolicy) -> Result<Self, HwCryptoError> { in new()
113 fn get_policy(&self) -> Result<KeyPolicy, HwCryptoError> { in get_policy()
125 fn try_clone(&self) -> Result<Self, HwCryptoError> { in try_clone()
150 fn try_from(value: &binder::Strong<dyn IOpaqueKey>) -> Result<OpaqueKey, Self::Error> { in try_from()
170 ) -> binder::Result<binder::Strong<dyn IOpaqueKey>> { in new_binder()
179 fn try_clone(&self) -> Result<Self, HwCryptoError> { in try_clone()
188 ) -> binder::Result<binder::Strong<dyn IOpaqueKey>> { in new_opaque_key_from_raw_bytes()
[all …]
Dservice_encryption_key.rs56 pub(crate) fn generate() -> Result<Self, HwCryptoError> { in generate()
71 ) -> Result<crypto::aes::Key, HwCryptoError> { in derive_service_encryption_key()
81 ) -> Result<Vec<u8>, HwCryptoError> { in encrypt_content_service_encryption_key()
110 ) -> Result<(Self, Vec<u8>), HwCryptoError> { in decrypt_content_service_encryption_key()
140 fn try_from(value: &ProtectedHeader) -> Result<EncryptionHeader, Self::Error> { in try_from()
194 fn try_from(value: &EncryptionHeader) -> Result<Header, Self::Error> { in try_from()
208 fn get_encryption_key(header_version: u32, key_context: &[u8]) -> Result<Vec<u8>, HwCryptoError> { in get_encryption_key()
228 ) -> Result<crypto::aes::Key, HwCryptoError> { in derive_key_hkdf()
247 ) -> Result<[u8; KEY_DERIVATION_CTX_LENGTH], HwCryptoError> { in parse_cborium_bytes_to_fixed_array()
268 ) -> Result<u32, HwCryptoError> { in parse_cborium_u32()
[all …]
Dhwcrypto_device_key.rs83 fn get_current_version() -> Result<u32, HwCryptoError> { in get_current_version()
87 fn new_current(uuid: Uuid) -> Result<Self, HwCryptoError> { in new_current()
93 fn new_current_encrypted(uuid: Uuid) -> Result<Vec<u8>, HwCryptoError> { in new_current_encrypted()
98 fn check_version(&self) -> Result<(), HwCryptoError> { in check_version() argument
106 fn check_context(&self, connection: ConnectionInformation) -> Result<(), HwCryptoError> { in check_context() argument
116 ) -> Result<(), HwCryptoError> { in check_encrypted_context() argument
121 fn is_context_current(encrypted_ctx: &[u8]) -> Result<bool, HwCryptoError> { in is_context_current()
127 fn decrypt_context(encrypted_context: &[u8]) -> Result<Self, HwCryptoError> { in decrypt_context()
140 fn encrypt_context(mut self) -> Result<Vec<u8>, HwCryptoError> { in encrypt_context()
145 fn get_stable_context(encrypted_context: &[u8]) -> Result<Vec<u8>, HwCryptoError> { in get_stable_context()
[all …]
Dhelpers.rs38 fn try_from(value: i64) -> Result<Self, Self::Error> {
49 fn try_from(value: ciborium::value::Integer) -> Result<Self, Self::Error> {
/trusty/user/app/secretkeeper/
Dlib.rs72 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> tipc::Result<Self> { in deserialize()
81 ) -> Result<S::Ok, S::Error> { in serialize()
87 fn fragmented_send(handle: &Handle, full_rsp: Vec<u8>) -> tipc::Result<()> { in fragmented_send() argument
100 ) -> tipc::Result<MessageResult> in fragmented_process()
129 ) -> tipc::Result<ConnectResult<Self::Connection>> { in on_connect()
139 ) -> tipc::Result<MessageResult> { in on_message()
163 ) -> tipc::Result<ConnectResult<Self::Connection>> { in on_connect()
173 ) -> tipc::Result<MessageResult> { in on_message()
196 ) -> tipc::Result<ConnectResult<Self::Connection>> { in on_connect()
206 ) -> tipc::Result<MessageResult> { in on_message()
[all …]
/trusty/user/base/lib/hwwsk/rust/src/
Dlib.rs70 ) -> Result<S::Ok, S::Error> { in serialize()
85 fn deserialize(bytes: &[u8], handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
128 ) -> Result<S::Ok, S::Error> { in serialize()
145 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
175 ) -> Result<S::Ok, S::Error> { in serialize()
184 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
203 ) -> Result<S::Ok, S::Error> { in serialize()
220 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
239 fn validate_cmd(sent_cmd: &u32, recvd_cmd: &u32) -> Result<(), HwWskError> { in validate_cmd() argument
295 ) -> Result<&'a [u8], HwWskError> { in import_key()
[all …]
/trusty/user/base/lib/tipc/rust/src/service/
Dhandle_set.rs25 use crate::{Handle, Result, TipcError};
47 pub fn try_new(ports: [Rc<Channel<D>>; PORT_COUNT]) -> Result<Self> { in try_new()
84 pub fn add_connection(&mut self, connection: Rc<Channel<D>>) -> Result<()> { in add_connection() argument
112 pub fn wait(&self, timeout: Option<u32>) -> Result<trusty_sys::uevent> { in wait()
156 fn do_set_ctrl(&self, cmd: u32, event: u32, channel: &Rc<Channel<D>>) -> Result<()> { in do_set_ctrl() argument
207 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() argument
/trusty/user/base/lib/system_state/rust/src/
Dlib.rs57 fn try_from(value: u32) -> Result<SystemStateFlag, Self::Error> { in try_from()
92 fn try_from(value: u64) -> Result<ProvisioningAllowedFlagValues, Self::Error> { in try_from()
113 pub fn try_connect() -> Result<Self, TipcError> { in try_connect()
120 pub fn get_flag(&self, flag: SystemStateFlag) -> Result<u64, TipcError> { in get_flag()
156 ) -> Result<S::Ok, S::Error> { in serialize()
182 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
/trusty/user/app/keymint/
Dkey_wrapper.rs35 fn hwwsk_session() -> Result<Handle, Error> { in hwwsk_session()
45 fn ephemeral_wrap(&self, key_material: &KeyMaterial) -> Result<Vec<u8>, Error> { in ephemeral_wrap()
80 ) -> Result<crypto::KeyMaterial, Error> { in create_storage_key()
133 ) -> Result<crypto::KeyMaterial, Error> { in generate_key()
145 ) -> Result<(crypto::KeyMaterial, KeySizeInBits), Error> { in import_key()
161 ) -> Result<Box<dyn crypto::EmittingOperation>, Error> { in begin()
175 ) -> Result<Box<dyn crypto::AadOperation>, Error> { in begin_aead()
Drpc.rs40 ) -> Result<Vec<u8>, Error> { in derive_bytes_from_hbk()
53 fn get_dice_info<'a>(&self, _test_mode: rpc::TestMode) -> Result<DiceInfo, Error> { in get_dice_info()
75 ) -> Result<Vec<u8>, Error> { in sign_data()
87 ) -> Result<Vec<u8>, Error> { in sign_data_in_cose_sign1()
Dsecure_deletion_secret_manager.rs81 fn get_secure_deletion_secret_file_session(wait_on_port: bool) -> Result<Session, Error> { in get_secure_deletion_secret_file_session()
92 fn delete_secure_deletion_secret_file() -> Result<(), Error> { in delete_secure_deletion_secret_file()
119 fn open_or_create(session: &'a mut Session) -> Result<SecureDeletionSecretFile<'a>, Error> { in open_or_create()
137 ) -> Result<&'buf [u8], Error> { in read_block()
164 fn find_empty_slot(&mut self, is_upgrade: bool) -> Result<Option<usize>, Error> { in find_empty_slot()
203 fn write_block(&mut self, start: usize, buffer: &[u8]) -> Result<(), Error> { in write_block() argument
214 fn get_file_size(&mut self) -> Result<usize, Error> { in get_file_size()
231 fn resize(&mut self, new_size: usize) -> Result<(), Error> { in resize() argument
243 fn zero_entries(&mut self, begin: usize, end: usize) -> Result<(), Error> { in zero_entries() argument
258 fn finish_transaction(self) -> Result<(), Error> { in finish_transaction() argument
[all …]
Dkeybox.rs37 fn new() -> Result<Self, TipcError> { in new()
43 pub(crate) fn keybox_unwrap(&self, wrapped_keybox: &[u8]) -> Result<Vec<u8>, Error> { in keybox_unwrap()
59 pub(crate) fn keybox_unwrap(wrapped_keybox: &[u8]) -> Result<Vec<u8>, Error> { in keybox_unwrap()
/trusty/user/base/lib/hwbcc/rust/src/
Dlib.rs65 fn validate_response(self, resp: u32) -> Result<(), HwBccError> { in validate_response() argument
85 ) -> Result<S::Ok, S::Error> { in serialize()
132 ) -> Result<S::Ok, S::Error> { in serialize()
161 fn deserialize(bytes: &[u8], handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
219 fn recv_resp(session: &Handle, cmd: BccCmd, buf: &mut [u8]) -> Result<HwBccResponse, HwBccError> { in recv_resp()
232 fn read_payload(resp: HwBccResponse, buf: &mut [u8]) -> Result<&[u8], HwBccError> { in read_payload()
271 ) -> Result<DiceArtifacts<'a>, HwBccError> { in get_dice_artifacts()
307 pub fn ns_deprivilege() -> Result<(), HwBccError> { in ns_deprivilege()
334 pub fn get_bcc<'a>(test_mode: HwBccMode, bcc: &'a mut [u8]) -> Result<&'a [u8], HwBccError> { in get_bcc()
376 ) -> Result<&'a [u8], HwBccError> { in sign_data()
/trusty/user/app/sample/rust-hello-world/
Dlib.rs65 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, TipcError> { in deserialize()
93 ) -> Result<S::Ok, S::Error> { in serialize()
121 ) -> tipc::Result<ConnectResult<Self::Connection>> { in on_connect()
132 ) -> tipc::Result<MessageResult> { in on_message()
161 pub fn init_and_start_loop() -> Result<(), TipcError> { in init_and_start_loop()
229 let response: Result<HelloWorldMessage, _> = session.recv(buf); in hello_world_test()
/trusty/user/app/sample/memref-test/rust/
Dmemref_test.rs140 ) -> Result<S::Ok, S::Error> { in serialize()
162 fn deserialize(_bytes: &[u8], handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
178 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
194 ) -> Result<S::Ok, S::Error> { in serialize()
209 fn deserialize(_bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
/trusty/user/app/storage/test/storage-unittest-aidl/unittests/
Dhelpers.rs17 ) -> Result<(), String> { in ensure_deleted() argument
58 fn check_pattern32(offset: usize, buf: &[u8]) -> Result<(), String> { in check_pattern32() argument
96 fn check_valid_size(chunk_len: usize) -> Result<(), String> { in check_valid_size() argument
108 ) -> Result<(), String> { in write_pattern() argument
134 ) -> Result<(), String> { in read_pattern() argument
/trusty/user/base/lib/hwkey/rust/src/
Dlib.rs57 pub fn open() -> Result<Self, TipcError> { in open()
111 ) -> Result<&'a [u8], HwkeyError> { in get_keyslot_data()
179 ) -> Result<DeriveResult, HwkeyError> { in derive()
271 ) -> Result<OsRollbackVersion, HwkeyError> { in query_current_os_version()
323 fn try_into(self) -> Result<i32, HwkeyError> { in try_into()
334 fn try_from(v: i32) -> Result<OsRollbackVersion, HwkeyError> { in try_from()
509 pub fn derive(self, src: &[u8], key_buf: &mut [u8]) -> Result<DeriveResult, HwkeyError> { in derive()
523 ) -> Result<S::Ok, S::Error> { in serialize()
546 ) -> Result<S::Ok, S::Error> { in serialize()
586 fn deserialize(bytes: &[u8], _handles: &mut [Option<Handle>]) -> Result<Self, Self::Error> { in deserialize()
[all …]

12