Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 59) sorted by relevance

123

/system/extras/verity/fec/
Dimage.cpp46 void image_init(image *ctx) in image_init() argument
48 memset(ctx, 0, sizeof(*ctx)); in image_init()
51 void image_free(image *ctx) in image_free() argument
53 assert(ctx->input == ctx->output); in image_free()
55 if (ctx->input) { in image_free()
56 delete[] ctx->input; in image_free()
59 if (ctx->fec) { in image_free()
60 delete[] ctx->fec; in image_free()
63 image_init(ctx); in image_free()
66 static void calculate_rounds(uint64_t size, image *ctx) in calculate_rounds() argument
[all …]
Dmain.cpp42 static void encode_rs(struct image_proc_ctx *ctx) in encode_rs() argument
44 struct image *fcx = ctx->ctx; in encode_rs()
49 for (i = ctx->start; i < ctx->end; i += fcx->rs_n) { in encode_rs()
54 encode_rs_char(ctx->rs, data, &fcx->fec[ctx->fec_pos]); in encode_rs()
55 ctx->fec_pos += fcx->roots; in encode_rs()
59 static void decode_rs(struct image_proc_ctx *ctx) in decode_rs() argument
61 struct image *fcx = ctx->ctx; in decode_rs()
68 for (i = ctx->start; i < ctx->end; i += fcx->rs_n) { in decode_rs()
73 memcpy(&data[fcx->rs_n], &fcx->fec[ctx->fec_pos], fcx->roots); in decode_rs()
74 rv = decode_rs_char(ctx->rs, data, NULL, 0); in decode_rs()
[all …]
Dimage.h72 image *ctx; member
80 extern bool image_load(const std::vector<std::string>& filename, image *ctx);
81 extern bool image_save(const std::string& filename, image *ctx);
83 extern bool image_ecc_new(const std::string& filename, image *ctx);
84 extern bool image_ecc_load(const std::string& filename, image *ctx);
85 extern bool image_ecc_save(image *ctx);
87 extern bool image_process(image_proc_func f, image *ctx);
89 extern void image_init(image *ctx);
90 extern void image_free(image *ctx);
92 inline uint8_t image_get_interleaved_byte(uint64_t i, image *ctx) in image_get_interleaved_byte() argument
[all …]
/system/core/lmkd/
Dstatslog.c36 stats_write_lmk_state_changed(android_log_context ctx, int32_t code, int32_t state) { in stats_write_lmk_state_changed() argument
37 assert(ctx != NULL); in stats_write_lmk_state_changed()
39 if (!ctx) { in stats_write_lmk_state_changed()
43 reset_log_context(ctx); in stats_write_lmk_state_changed()
45 if ((ret = android_log_write_int64(ctx, getElapsedRealTimeNs())) < 0) { in stats_write_lmk_state_changed()
49 if ((ret = android_log_write_int32(ctx, code)) < 0) { in stats_write_lmk_state_changed()
53 if ((ret = android_log_write_int32(ctx, state)) < 0) { in stats_write_lmk_state_changed()
57 return write_to_logger(ctx, LOG_ID_STATS); in stats_write_lmk_state_changed()
65 stats_write_lmk_kill_occurred(android_log_context ctx, int32_t code, int32_t uid, in stats_write_lmk_kill_occurred() argument
69 assert(ctx != NULL); in stats_write_lmk_kill_occurred()
[all …]
/system/core/liblog/include/log/
Dlog_event_list.h89 int android_log_write_list_begin(android_log_context ctx);
90 int android_log_write_list_end(android_log_context ctx);
92 int android_log_write_int32(android_log_context ctx, int32_t value);
93 int android_log_write_int64(android_log_context ctx, int64_t value);
94 int android_log_write_string8(android_log_context ctx, const char* value);
95 int android_log_write_string8_len(android_log_context ctx, const char* value,
97 int android_log_write_float32(android_log_context ctx, float value);
101 int android_log_write_list(android_log_context ctx, log_id_t id);
108 android_log_list_element android_log_read_next(android_log_context ctx);
109 android_log_list_element android_log_peek_next(android_log_context ctx);
[all …]
/system/core/libstats/include/
Dstats_event_list.h25 void reset_log_context(android_log_context ctx);
42 android_log_context ctx;
50 ctx = create_android_logger(static_cast<uint32_t>(tag)); in stats_event_list()
53 ctx = create_android_log_parser(log_msg.msg() + sizeof(uint32_t), in stats_event_list()
56 ~stats_event_list() { android_log_destroy(&ctx); } in ~stats_event_list()
59 int retval = android_log_destroy(&ctx); in close()
67 operator android_log_context() const { return ctx; } in android_log_context()
73 int retval = android_log_write_list_begin(ctx); in begin()
80 int retval = android_log_write_list_end(ctx); in end()
88 int retval = android_log_write_int32(ctx, value);
[all …]
/system/core/liblog/
Dstderr_write.c69 struct stderrContext* ctx; in stderrOpen() local
81 ctx = calloc(1, sizeof(struct stderrContext)); in stderrOpen()
82 if (!ctx) { in stderrOpen()
86 ctx->logformat = android_log_format_new(); in stderrOpen()
87 if (!ctx->logformat) { in stderrOpen()
88 free(ctx); in stderrOpen()
105 if (android_log_setPrintFormat(ctx->logformat, format) <= 0) { in stderrOpen()
114 android_log_setPrintFormat(ctx->logformat, format); in stderrOpen()
118 android_log_addFilterString(ctx->logformat, envStr); in stderrOpen()
120 stderrLoggerWrite.context.priv = ctx; in stderrOpen()
[all …]
Dlog_event_write.c33 android_log_context ctx = create_android_logger(tag); in __android_log_error_write() local
36 if (ctx) { in __android_log_error_write()
37 ret = android_log_write_string8_len(ctx, subTag, MAX_SUBTAG_LEN); in __android_log_error_write()
39 ret = android_log_write_int32(ctx, uid); in __android_log_error_write()
41 ret = android_log_write_string8_len(ctx, data, dataLen); in __android_log_error_write()
43 ret = android_log_write_list(ctx, LOG_ID_EVENTS); in __android_log_error_write()
47 android_log_destroy(&ctx); in __android_log_error_write()
Dlog_event_list.c87 LIBLOG_ABI_PUBLIC int android_log_destroy(android_log_context* ctx) { in android_log_destroy() argument
90 context = (android_log_context_internal*)*ctx; in android_log_destroy()
96 *ctx = NULL; in android_log_destroy()
100 LIBLOG_ABI_PUBLIC int android_log_write_list_begin(android_log_context ctx) { in android_log_write_list_begin() argument
104 context = (android_log_context_internal*)ctx; in android_log_write_list_begin()
141 LIBLOG_ABI_PUBLIC int android_log_write_int32(android_log_context ctx, in android_log_write_int32() argument
146 context = (android_log_context_internal*)ctx; in android_log_write_int32()
176 LIBLOG_ABI_PUBLIC int android_log_write_int64(android_log_context ctx, in android_log_write_int64() argument
181 context = (android_log_context_internal*)ctx; in android_log_write_int64()
200 LIBLOG_ABI_PUBLIC int android_log_write_string8_len(android_log_context ctx, in android_log_write_string8_len() argument
[all …]
/system/keymaster/key_blob_utils/
Docb.c375 #define ROUNDS(ctx) ((ctx)->rounds) argument
388 #define ROUNDS(ctx) (6 + OCB_KEY_LEN / 4) argument
422 #define ROUNDS(ctx) ((ctx)->rounds) argument
425 #define ROUNDS(ctx) (6 + OCB_KEY_LEN / 4) argument
645 static block getL(const ae_ctx* ctx, unsigned tz) { in getL() argument
647 return ctx->L[tz]; in getL()
651 block rval = swap_if_le(ctx->L[L_TABLE_SZ - 1]); in getL()
681 void ae_free(ae_ctx* ctx) { in ae_free() argument
683 _mm_free(ctx); in ae_free()
685 free(ctx); in ae_free()
[all …]
Docb_utils.cpp72 AeCtx* ctx) { in InitializeKeyWrappingContext() argument
90 if (!ctx->get() || !hash_buf.get() || !derived_key.get()) in InitializeKeyWrappingContext()
109 if (ae_init(ctx->get(), derived_key.get(), AES_BLOCK_SIZE /* key length */, OCB_NONCE_LENGTH, in InitializeKeyWrappingContext()
111 memset_s(ctx->get(), 0, ae_ctx_sizeof()); in InitializeKeyWrappingContext()
128 AeCtx ctx; in OcbEncryptKey() local
129 if (!ctx.get()) in OcbEncryptKey()
133 InitializeKeyWrappingContext(hw_enforced, sw_enforced, hidden, master_key, &ctx); in OcbEncryptKey()
140 int ae_err = ae_encrypt(ctx.get(), nonce.peek_read(), plaintext.key_material, in OcbEncryptKey()
164 AeCtx ctx; in OcbDecryptKey() local
165 if (!ctx.get()) in OcbDecryptKey()
[all …]
Dintegrity_assured_key_blob.cpp44 explicit HmacCleanup(HMAC_CTX* ctx) : ctx_(ctx) {} in HmacCleanup() argument
59 HMAC_CTX ctx; in ComputeHmac() local
60 HMAC_CTX_init(&ctx); in ComputeHmac()
62 if (!HMAC_Init_ex(&ctx, HMAC_KEY, sizeof(HMAC_KEY), md, NULL /* engine */)) in ComputeHmac()
64 HmacCleanup cleanup(&ctx); in ComputeHmac()
68 if (!HMAC_Update(&ctx, serialized_data, serialized_data_size) || in ComputeHmac()
69 !HMAC_Update(&ctx, hidden_bytes.get(), hidden_bytes_size) || // in ComputeHmac()
70 !HMAC_Final(&ctx, tmp, &tmp_len)) in ComputeHmac()
/system/core/liblog/include_vndk/log/
Dlog_event_list.h52 int android_log_write_list_begin(android_log_context ctx);
53 int android_log_write_list_end(android_log_context ctx);
55 int android_log_write_int32(android_log_context ctx, int32_t value);
56 int android_log_write_int64(android_log_context ctx, int64_t value);
57 int android_log_write_string8(android_log_context ctx, const char* value);
58 int android_log_write_string8_len(android_log_context ctx, const char* value,
60 int android_log_write_float32(android_log_context ctx, float value);
64 int android_log_write_list(android_log_context ctx, log_id_t id);
67 int android_log_destroy(android_log_context* ctx);
/system/core/logcat/
Dlogcat_system.cpp69 FILE* android_logcat_popen(android_logcat_context* ctx, const char* command) { in android_logcat_popen() argument
70 *ctx = NULL; in android_logcat_popen()
88 *ctx = create_android_logcat(); in android_logcat_popen()
89 if (!*ctx) return NULL; in android_logcat_popen()
92 *ctx, argv.size() - 1, (char* const*)&argv[0], (char* const*)&envp[0]); in android_logcat_popen()
98 android_logcat_destroy(ctx); in android_logcat_popen()
106 android_logcat_destroy(ctx); in android_logcat_popen()
111 int android_logcat_pclose(android_logcat_context* ctx, FILE* output) { in android_logcat_pclose() argument
112 if (*ctx) { in android_logcat_pclose()
116 android_logcat_run_command_thread_running(*ctx) && retry; --retry) { in android_logcat_pclose()
[all …]
Dlogcat_main.cpp23 android_logcat_context ctx = create_android_logcat(); in main() local
24 if (!ctx) return -1; in main()
26 int retval = android_logcat_run_command(ctx, -1, -1, argc, argv, envp); in main()
27 int ret = android_logcat_destroy(&ctx); in main()
/system/core/logcat/tests/
Dlogcat_test.cpp81 logcat_define(ctx); in TEST()
95 ctx, logcat_executable in TEST()
114 logcat_pclose(ctx, fp); in TEST()
123 logcat_define(ctx); in TEST()
138 ASSERT_TRUE(NULL != (fp = logcat_popen(ctx, command.c_str()))); in TEST()
148 logcat_pclose(ctx, fp); in TEST()
194 logcat_define(ctx); in TEST()
209 ctx, logcat_executable in TEST()
221 logcat_pclose(ctx, fp); in TEST()
271 logcat_define(ctx); in TEST()
[all …]
/system/core/libasyncio/
DAsyncIO.cpp26 int io_destroy(aio_context_t ctx) { in io_destroy() argument
27 return syscall(__NR_io_destroy, ctx); in io_destroy()
30 int io_submit(aio_context_t ctx, long nr, iocb** iocbpp) { in io_submit() argument
31 return syscall(__NR_io_submit, ctx, nr, iocbpp); in io_submit()
34 int io_getevents(aio_context_t ctx, long min_nr, long max_nr, io_event* events, timespec* timeout) { in io_getevents() argument
35 return syscall(__NR_io_getevents, ctx, min_nr, max_nr, events, timeout); in io_getevents()
38 int io_cancel(aio_context_t ctx, iocb* iocbp, io_event* result) { in io_cancel() argument
39 return syscall(__NR_io_cancel, ctx, iocbp, result); in io_cancel()
/system/keymaster/km_openssl/
Dckdf.cpp50 CMAC_CTX_Ptr ctx(CMAC_CTX_new()); in DEFINE_OPENSSL_OBJECT_POINTER() local
51 if (!ctx.get()) return KM_ERROR_MEMORY_ALLOCATION_FAILED; in DEFINE_OPENSSL_OBJECT_POINTER()
65 if (!CMAC_Init(ctx.get(), key.key_material, key.key_material_size, algo, in DEFINE_OPENSSL_OBJECT_POINTER()
78 if (!CMAC_Update(ctx.get(), reinterpret_cast<uint8_t*>(&net_order_i), in DEFINE_OPENSSL_OBJECT_POINTER()
84 if (!CMAC_Update(ctx.get(), label.data, label.data_length)) { in DEFINE_OPENSSL_OBJECT_POINTER()
90 if (!CMAC_Update(ctx.get(), &zero, sizeof(zero))) return TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
94 if (!CMAC_Update(ctx.get(), context_chunks[chunk].data, in DEFINE_OPENSSL_OBJECT_POINTER()
103 if (!CMAC_Update(ctx.get(), buf, sizeof(buf))) TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
107 if (!CMAC_Final(ctx.get(), output_pos, &out_len)) return TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
111 if (!CMAC_Final(ctx.get(), cmac, &out_len)) return TranslateLastOpenSslError(); in DEFINE_OPENSSL_OBJECT_POINTER()
[all …]
Diso18033kdf.cpp36 EVP_MD_CTX ctx; in GenerateKey() local
37 EvpMdCtxCleaner ctxCleaner(&ctx); in GenerateKey()
38 EVP_MD_CTX_init(&ctx); in GenerateKey()
47 if (!EVP_DigestInit_ex(&ctx, EVP_sha1(), nullptr /* default digest */)) return false; in GenerateKey()
50 if (!EVP_DigestInit_ex(&ctx, EVP_sha256(), nullptr /* default digest */)) return false; in GenerateKey()
56 if (!EVP_DigestUpdate(&ctx, secret_key_.get(), secret_key_len_) || in GenerateKey()
58 !EVP_DigestUpdate(&ctx, counter.get(), 4)) in GenerateKey()
62 if (!EVP_DigestUpdate(&ctx, info, info_len)) return false; in GenerateKey()
67 if (!EVP_DigestFinal_ex(&ctx, digest_result.get(), &uint32_digest_size_) || in GenerateKey()
/system/extras/verity/
Dbuild_verity_tree.cpp95 struct sparse_hash_ctx *ctx = (struct sparse_hash_ctx *)priv; in hash_chunk() local
96 assert(len % ctx->block_size == 0); in hash_chunk()
99 hash_blocks(ctx->md, (const unsigned char *)data, len, in hash_chunk()
100 ctx->hashes, &s, in hash_chunk()
101 ctx->salt, ctx->salt_size, ctx->block_size); in hash_chunk()
102 ctx->hashes += s; in hash_chunk()
104 for (size_t i = 0; i < (size_t)len; i += ctx->block_size) { in hash_chunk()
105 memcpy(ctx->hashes, ctx->zero_block_hash, ctx->hash_size); in hash_chunk()
106 ctx->hashes += ctx->hash_size; in hash_chunk()
306 struct sparse_hash_ctx ctx; in main() local
[all …]
/system/core/logcat/include/log/
Dlogcat.h78 int android_logcat_run_command(android_logcat_context ctx, int output, int error,
87 int android_logcat_run_command_thread(android_logcat_context ctx, int argc,
89 int android_logcat_run_command_thread_running(android_logcat_context ctx);
98 int android_logcat_destroy(android_logcat_context* ctx);
113 FILE* android_logcat_popen(android_logcat_context* ctx, const char* command);
114 int android_logcat_pclose(android_logcat_context* ctx, FILE* output);
/system/keymaster/include/keymaster/key_blob_utils/
Dae.h59 void ae_free(ae_ctx* ctx); /* Deallocate ae_ctx struct */
60 int ae_clear(ae_ctx* ctx); /* Undo initialization */
75 int ae_init(ae_ctx* ctx, const void* key, int key_len, int nonce_len, int tag_len);
94 int ae_encrypt(ae_ctx* ctx, const void* nonce, const void* pt, int pt_len, const void* ad,
124 int ae_decrypt(ae_ctx* ctx, const void* nonce, const void* ct, int ct_len, const void* ad,
/system/bt/build/
Dfluoride.go34 func fluorideDefaults(ctx android.LoadHookContext) {
41 p.Cflags, p.Include_dirs = globalDefaults(ctx)
43 ctx.AppendProperties(p)
46 func globalDefaults(ctx android.BaseContext) ([]string, []string) {
50 board_bt_buildcfg_include_dir := ctx.DeviceConfig().BtConfigIncludeDir()
/system/core/liblog/tests/
Dliblog_test.cpp2578 android_log_context ctx; in event_test_int32() local
2580 EXPECT_TRUE(NULL != (ctx = create_android_logger(tag))); in event_test_int32()
2581 if (!ctx) { in event_test_int32()
2584 EXPECT_LE(0, android_log_write_int32(ctx, 0x40302010)); in event_test_int32()
2585 EXPECT_LE(0, android_log_write_list(ctx, LOG_ID_EVENTS)); in event_test_int32()
2586 EXPECT_LE(0, android_log_destroy(&ctx)); in event_test_int32()
2587 EXPECT_TRUE(NULL == ctx); in event_test_int32()
2595 android_log_context ctx; in event_test_int64() local
2597 EXPECT_TRUE(NULL != (ctx = create_android_logger(tag))); in event_test_int64()
2598 if (!ctx) { in event_test_int64()
[all …]
/system/core/libasyncio/include/asyncio/
DAsyncIO.h37 int io_destroy(aio_context_t ctx);
38 int io_submit(aio_context_t ctx, long nr, iocb** iocbpp);
39 int io_getevents(aio_context_t ctx, long min_nr, long max_nr, io_event* events, timespec* timeout);
40 int io_cancel(aio_context_t ctx, iocb*, io_event* result);

123