Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 144) sorted by relevance

123456

/trusty/user/base/lib/coverage/common/
Dcov_shm.c32 int cov_shm_alloc(struct cov_shm* shm, size_t len) { in cov_shm_alloc() argument
37 shm_len = round_up(len, PAGE_SIZE); in cov_shm_alloc()
53 shm->len = shm_len; in cov_shm_alloc()
68 shm->len = 0; in cov_shm_free()
71 int cov_shm_mmap(struct cov_shm* shm, handle_t memref, size_t len) { in cov_shm_mmap() argument
72 void* base = mmap(0, len, MMAP_FLAG_PROT_RW, 0, memref, 0); in cov_shm_mmap()
80 shm->len = len; in cov_shm_mmap()
87 munmap(shm->base, shm->len); in cov_shm_munmap()
91 shm->len = 0; in cov_shm_munmap()
97 for (size_t i = 0; i < shm->len; i++) { in cov_shm_clear()
/trusty/user/app/sample/hwaes/
Dmain.c47 static uint32_t hwaes_check_arg_helper(size_t len, const uint8_t* data_ptr) { in hwaes_check_arg_helper() argument
48 if (len == 0 || data_ptr == NULL) { in hwaes_check_arg_helper()
55 return hwaes_check_arg_helper(arg->len, arg->data_ptr); in hwaes_check_arg_in()
59 return hwaes_check_arg_helper(arg->len, arg->data_ptr); in hwaes_check_arg_out()
95 if (args->text_in.len != args->text_out.len) { in hwaes_aes_op()
97 args->text_in.len, args->text_out.len); in hwaes_aes_op()
106 if (key.len > HWKEY_OPAQUE_HANDLE_MAX_SIZE) { in hwaes_aes_op()
107 TLOGE("Wrong opaque handle length: %zu\n", key.len); in hwaes_aes_op()
110 if (key.data_ptr[key.len - 1] != 0) { in hwaes_aes_op()
130 key.len = key_len; in hwaes_aes_op()
[all …]
/trusty/user/base/lib/coverage/common/include/lib/coverage/common/
Dcov_shm.h35 size_t len; member
45 size_t len) { in cov_shm_init() argument
48 shm->len = len; in cov_shm_init()
58 int cov_shm_alloc(struct cov_shm* shm, size_t len);
74 int cov_shm_mmap(struct cov_shm* shm, handle_t memref, size_t len);
/trusty/user/base/lib/rng/
Dtrusty_rng.c47 int trusty_rng_secure_rand(uint8_t* data, size_t len) { in trusty_rng_secure_rand() argument
48 if (!data || !len) in trusty_rng_secure_rand()
51 int ssl_err = RAND_bytes(data, len); in trusty_rng_secure_rand()
63 int trusty_rng_add_entropy(const uint8_t* data, size_t len) { in trusty_rng_add_entropy() argument
70 __WEAK int trusty_rng_hw_rand(uint8_t* data, size_t len) { in trusty_rng_hw_rand() argument
71 struct hwrng_req req_hdr = {.len = len}; in trusty_rng_hw_rand()
85 .iov_len = len, in trusty_rng_hw_rand()
122 if (inf.len > rx_msg.iov[0].iov_len) { in trusty_rng_hw_rand()
/trusty/kernel/lib/trusty/
Diovec.c31 size_t len) { in membuf_to_kern_iovec() argument
34 if (unlikely(iov_cnt == 0 || len == 0)) in membuf_to_kern_iovec()
41 size_t to_copy = len; in membuf_to_kern_iovec()
55 len -= to_copy; in membuf_to_kern_iovec()
57 if (len == 0) in membuf_to_kern_iovec()
65 size_t len, in kern_iovec_to_membuf() argument
70 if (unlikely(iov_cnt == 0 || len == 0)) in kern_iovec_to_membuf()
77 size_t to_copy = len; in kern_iovec_to_membuf()
91 len -= to_copy; in kern_iovec_to_membuf()
93 if (len == 0) in kern_iovec_to_membuf()
[all …]
/trusty/kernel/lib/ktipc/test/main/
Dmain.c40 size_t len) { in send_cmd() argument
44 int rc = ktipc_send(chan, &req, sizeof(req), buf, len); in send_cmd()
46 ASSERT_EQ(sizeof(req) + len, (size_t)rc); in send_cmd()
136 const size_t len = countof(test_pattern); in TEST() local
139 test_pattern[i % len] = (i + j) & 0xff; in TEST()
141 send_cmd(chan[i], KTIPC_TEST_CMD_ECHO, test_pattern, len); in TEST()
149 rc = ktipc_recv(chan[i], len, buf, len); in TEST()
150 ASSERT_EQ(len, rc); in TEST()
151 ASSERT_EQ(0, memcmp(buf, test_pattern, len)); in TEST()
183 const size_t len = 4 * 7; in TEST() local
[all …]
/trusty/user/base/lib/hwbcc/rust/src/
Dtest.rs71 assert!(artifacts.len() > 0); in test_get_dice_artifacts()
72 assert_eq!(artifacts.len(), bcc_handover_size); in test_get_dice_artifacts()
83 artifacts.len(), in test_get_dice_artifacts()
112 assert!(bcc.len() > 0); in test_get_bcc_test_mode()
123 bcc.len(), in test_get_bcc_test_mode()
134 assert!(bcc.len() > 0); in test_get_bcc_test_mode()
145 bcc.len(), in test_get_bcc_test_mode()
173 assert!(bcc.len() > 0); in test_get_bcc()
184 bcc.len(), in test_get_bcc()
207 assert!(cose_sign1.len() > 0); in test_sign_data_test_mode()
[all …]
/trusty/kernel/services/hwrng/
Dhwrng_service.c79 size_t len = MIN(ctx->req_size, MAX_HWRNG_MSG_SIZE); in hwrng_handle_req_queue() local
82 len = MIN(len, rng_data_avail_count); in hwrng_handle_req_queue()
85 rand_get_bytes(rng_data, len); in hwrng_handle_req_queue()
87 rng_data_avail_count = len; in hwrng_handle_req_queue()
91 rc = ktipc_send(ctx->chan, rng_data + rng_data_avail_pos, len); in hwrng_handle_req_queue()
103 rng_data_avail_pos += len; in hwrng_handle_req_queue()
104 rng_data_avail_count -= len; in hwrng_handle_req_queue()
105 ctx->req_size -= len; in hwrng_handle_req_queue()
139 ctx->req_size += req.len; in hwrng_handle_msg()
142 ctx->req_size = req.len; in hwrng_handle_msg()
/trusty/user/base/lib/hwaes/
Dhwaes.c94 size_t len, in hwaes_set_shm_arg_helper() argument
122 data_desc_ptr->len = len; in hwaes_set_shm_arg_helper()
141 hwaes_set_shm_arg_helper(arg_ptr->data_ptr, arg_ptr->len, in hwaes_set_shm_arg_out()
158 hwaes_set_shm_arg_helper(arg_ptr->data_ptr, arg_ptr->len, in hwaes_set_shm_arg_in()
171 size_t len, in hwaes_set_iov_helper() argument
179 iov_wrapper_ptr->iov[iov_num].iov_len = len; in hwaes_set_iov_helper()
180 iov_wrapper_ptr->total_len += len; in hwaes_set_iov_helper()
217 size_t len, in hwaes_set_iov_arg_helper() argument
221 data_desc_ptr->len = len; in hwaes_set_iov_arg_helper()
222 hwaes_set_iov_helper(data_ptr, len, iov_wrapper_ptr); in hwaes_set_iov_arg_helper()
[all …]
/trusty/user/base/lib/rng/include/lib/rng/
Dtrusty_rng.h27 int trusty_rng_secure_rand(uint8_t* data, size_t len);
28 int trusty_rng_add_entropy(const uint8_t* data, size_t len);
29 int trusty_rng_hw_rand(uint8_t* data, size_t len);
/trusty/kernel/lib/arm_trng/
Darm_trng.c88 void platform_random_get_bytes(uint8_t* buf, size_t len) { in platform_random_get_bytes() argument
92 size_t initial_len = len; in platform_random_get_bytes()
94 while (len > 0) { in platform_random_get_bytes()
95 size_t count = MIN(len, 3 * sizeof(ulong)); in platform_random_get_bytes()
129 arm_trng_copy_register(&buf, &smc_ret.r3, &len); in platform_random_get_bytes()
130 arm_trng_copy_register(&buf, &smc_ret.r2, &len); in platform_random_get_bytes()
131 arm_trng_copy_register(&buf, &smc_ret.r1, &len); in platform_random_get_bytes()
/trusty/kernel/lib/tcrypto/
Dutils.c29 int tc_memcmp(const void* p1, const void* p2, size_t len) { in tc_memcmp() argument
34 while (len > 0) { in tc_memcmp()
36 --len; in tc_memcmp()
/trusty/user/base/app/acvp/
Dacvp.h23 const size_t len = strlen(b); in StringEq() local
24 return a.size() == len && memcmp(a.data(), b, len) == 0; in StringEq()
/trusty/hardware/nxp/app/hwcrypto/
Dhwrng_srv.c64 static void _hexdump8(const void* ptr, size_t len) { in _hexdump8() argument
69 for (count = 0; count < len; count += 16) { in _hexdump8()
71 for (i = 0; i < MIN(len - count, 16); i++) { in _hexdump8()
107 size_t len = ctx->req_size; in hwrng_handle_req_queue() local
109 if (len > MAX_HWRNG_MSG_SIZE) in hwrng_handle_req_queue()
110 len = MAX_HWRNG_MSG_SIZE; in hwrng_handle_req_queue()
113 hwrng_dev_get_rng_data(rng_data, len); in hwrng_handle_req_queue()
116 int rc = tipc_send_single_buf(ctx->chan, rng_data, len); in hwrng_handle_req_queue()
129 ctx->req_size -= len; in hwrng_handle_req_queue()
168 ctx->req_size += req.len; in hwrng_chan_handle_msg()
[all …]
Dmain.c37 void _hexdump8(const void* ptr, size_t len) { in _hexdump8() argument
42 for (count = 0; count < len; count += 16) { in _hexdump8()
44 for (i = 0; i < MIN(len - count, 16); i++) { in _hexdump8()
81 int tipc_send_single_buf(handle_t chan, const void* buf, size_t len) { in tipc_send_single_buf() argument
84 .iov_len = len, in tipc_send_single_buf()
97 int tipc_recv_single_buf(handle_t chan, void* buf, size_t len) { in tipc_recv_single_buf() argument
105 if (msg_inf.len != len) { in tipc_recv_single_buf()
111 .iov_len = len, in tipc_recv_single_buf()
164 if (msg_inf.len < hdr_len) { in tipc_recv_two_segments()
/trusty/user/app/sample/hwcrypto/
Dhwrng_srv.c61 static void _hexdump8(const void* ptr, size_t len) { in _hexdump8() argument
66 for (count = 0; count < len; count += 16) { in _hexdump8()
68 for (i = 0; i < MIN(len - count, 16); i++) { in _hexdump8()
105 size_t len = ctx->req_size; in hwrng_handle_req_queue() local
107 if (len > MAX_HWRNG_MSG_SIZE) in hwrng_handle_req_queue()
108 len = MAX_HWRNG_MSG_SIZE; in hwrng_handle_req_queue()
111 rc = hwrng_dev_get_rng_data(rng_data, len); in hwrng_handle_req_queue()
119 rc = tipc_send1(ctx->chan, rng_data, len); in hwrng_handle_req_queue()
132 ctx->req_size -= len; in hwrng_handle_req_queue()
171 ctx->req_size += req.len; in hwrng_chan_handle_msg()
[all …]
/trusty/user/base/app/hwaes-unittest/
Dhwaes-test.c223 .field_ = {.data_ptr = &name_##_##field_, .len = sizeof(name_##_##field_)}
264 args->text_out.len = args->text_in.len; in parse_vector()
267 if (encrypt && vector->tag.len > 0) { in parse_vector()
268 args->tag_out.data_ptr = base + args->text_out.len; in parse_vector()
269 args->tag_out.len = vector->tag.len; in parse_vector()
334 ASSERT_EQ(msg_inf.len, sizeof(struct hwaes_resp)); in make_bad_request()
348 ASSERT_EQ((size_t)rc, msg_inf.len); in make_bad_request()
396 .len = sizeof(hwaes_key), in TEST_F_SETUP()
401 .len = sizeof(hwaes_iv), in TEST_F_SETUP()
406 .len = sizeof(hwaes_cbc_plaintext), in TEST_F_SETUP()
[all …]
/trusty/user/base/app/device_tree/tests/
Dmain.c79 size_t len; in TEST_F() local
80 rc = device_tree_prop_get_name(prop, &prop_name, &len); in TEST_F()
84 EXPECT_EQ(len, strlen("compatible")); in TEST_F()
88 rc = device_tree_prop_get_value(prop, (uint8_t**)&prop_value, &len); in TEST_F()
93 EXPECT_EQ(len, strlen(TEST_NODE_COMPAT) + 1); in TEST_F()
117 size_t len; in TEST_F() local
119 rc = device_tree_prop_get_value(prop, &prop_value, &len); in TEST_F()
123 EXPECT_EQ(len, 8); in TEST_F()
177 size_t len; in TEST_F() local
179 rc = device_tree_prop_get_name(prop, &prop_name, &len); in TEST_F()
[all …]
/trusty/user/base/lib/hwkey/rust/src/
Dlib.rs116 if slot_id.len() <= 0 { in get_keyslot_data()
146 if keyslot_data.len() < response.payload.len() { in get_keyslot_data()
149 keyslot_data.len(), in get_keyslot_data()
150 response.payload.len() in get_keyslot_data()
155 keyslot_data[..response.payload.len()].copy_from_slice(&response.payload[..]); in get_keyslot_data()
156 Ok(&keyslot_data[..response.payload.len()]) in get_keyslot_data()
180 if src.len() == 0 && key_buf.len() != 0 { in derive()
188 if src.len() > MAX_PAYLOAD_LEN { in derive()
189 log::error!("src context length ({:?}) > ({:?})", src.len(), MAX_PAYLOAD_LEN); in derive()
193 if key_buf.len() > MAX_PAYLOAD_LEN { in derive()
[all …]
/trusty/user/base/interface/spi/include/interface/spi/
Dspi.h137 uint32_t len; member
146 uint32_t len; member
156 uint32_t len; member
176 uint32_t len; member
/trusty/kernel/lib/ktipc/test/srv/
Dsrv.c41 size_t len; member
48 static int queue_buffer(struct chan_ctx* ctx, const uint8_t* buf, size_t len) { in queue_buffer() argument
57 qmsg->len = len; in queue_buffer()
58 memcpy(qmsg->buf, buf, len); in queue_buffer()
82 size_t len = rc - sizeof(*req); in test_handle_msg() local
85 rc = ktipc_send(chan, req->payload, len); in test_handle_msg()
93 TRACEF("%s: queuing message %zd\n", __func__, len); in test_handle_msg()
94 return queue_buffer(ctx, req->payload, len); in test_handle_msg()
164 TRACEF("%s: sending queued message %zd\n", __func__, qmsg->len); in test_handle_send_unblocked()
165 rc = ktipc_send(chan, qmsg->buf, qmsg->len); in test_handle_send_unblocked()
/trusty/vendor/google/aosp/scripts/
Dlog_processor.py79 def len(self): member in ModuleQueue
81 assert len(self.queued) == len(self.active), diagnostic
82 return len(self.queued)
217 if len(module) > max_module_width:
220 mwidth = term_width - len(module) - len(status) - 5 - 10
225 elif len(message) > mwidth:
255 while self.pinned.len() > self.pinned_num:
271 for i in range(self.pinned_num - self.pinned.len()):
285 if line[:len(self.log_print)] == self.log_print:
286 line = line[len(self.log_print):]
[all …]
/trusty/user/base/lib/spi/srv/batch/
Dbatch.c47 xfer_args_len = READ_ONCE(xfer_args->len); in handle_xfer_args()
108 size_t len, in unpack_shm() argument
118 mb_resize(shm, len); in unpack_shm()
120 while (mb_curr_pos(shm) < len) { in unpack_shm()
188 if (batch_req->len > shm->capacity) { in spi_srv_handle_batch()
190 batch_req->len, shm->capacity); in spi_srv_handle_batch()
203 rc = unpack_shm(spi, shm, batch_req->len, state); in spi_srv_handle_batch()
217 if (mb_curr_pos(shm) != batch_req->len) { in spi_srv_handle_batch()
219 mb_curr_pos(shm), batch_req->len); in spi_srv_handle_batch()
/trusty/kernel/lib/trusty/include/lib/trusty/
Duio.h58 size_t len);
61 size_t len,
71 size_t len,
76 size_t len,
/trusty/user/app/sample/spi/swspi-srv/driver/
Dswspi.c106 size_t len; member
118 size_t len = args->len; in spi_req_exec_xfer() local
124 memcpy(rx, tx, len); in spi_req_exec_xfer()
126 memset(rx, 0, len); in spi_req_exec_xfer()
133 seed = digest(tx, len); in spi_req_exec_xfer()
137 rand_buf(rx, len, seed); in spi_req_exec_xfer()
141 int spi_req_xfer(struct spi_dev_ctx* dev, void* tx, void* rx, size_t len) { in spi_req_xfer() argument
152 args->len = len; in spi_req_xfer()

123456