Lines Matching full:h
6 #include <crypto/crypto.h>
7 #include <initcall.h>
8 #include <kernel/embedded_ts.h>
9 #include <kernel/ts_store.h>
10 #include <kernel/user_access.h>
11 #include <mempool.h>
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include <trace.h>
16 #include <utee_defines.h>
17 #include <util.h>
18 #include <zlib.h>
56 struct ts_store_handle **h, in emb_ts_open() argument
78 *h = handle; in emb_ts_open()
83 TEE_Result emb_ts_get_size(const struct ts_store_handle *h, size_t *size) in emb_ts_get_size() argument
85 const struct embedded_ts *ts = h->ts; in emb_ts_get_size()
95 TEE_Result emb_ts_get_tag(const struct ts_store_handle *h, in emb_ts_get_tag() argument
113 res = crypto_hash_update(ctx, h->ts->ts, h->ts->size); in emb_ts_get_tag()
122 static TEE_Result read_uncompressed(struct ts_store_handle *h, void *data_core, in read_uncompressed() argument
126 uint8_t *src = (uint8_t *)h->ts->ts + h->offs; in read_uncompressed()
129 if (ADD_OVERFLOW(h->offs, len, &next_offs) || in read_uncompressed()
130 next_offs > h->ts->size) in read_uncompressed()
137 h->offs = next_offs; in read_uncompressed()
142 static TEE_Result read_compressed(struct ts_store_handle *h, void *data_core, in read_compressed() argument
146 z_stream *strm = &h->strm; in read_compressed()
208 TEE_Result emb_ts_read(struct ts_store_handle *h, void *data_core, in emb_ts_read() argument
211 if (h->ts->uncompressed_size) in emb_ts_read()
212 return read_compressed(h, data_core, data_user, len); in emb_ts_read()
214 return read_uncompressed(h, data_core, data_user, len); in emb_ts_read()
217 void emb_ts_close(struct ts_store_handle *h) in emb_ts_close() argument
219 if (h->ts->uncompressed_size) in emb_ts_close()
220 inflateEnd(&h->strm); in emb_ts_close()
221 free(h); in emb_ts_close()