/system/core/libmincrypt/ |
D | sha256.c | 57 static void SHA256_Transform(SHA256_CTX* ctx) { in SHA256_Transform() argument 60 uint8_t* p = ctx->buf; in SHA256_Transform() 77 A = ctx->state[0]; in SHA256_Transform() 78 B = ctx->state[1]; in SHA256_Transform() 79 C = ctx->state[2]; in SHA256_Transform() 80 D = ctx->state[3]; in SHA256_Transform() 81 E = ctx->state[4]; in SHA256_Transform() 82 F = ctx->state[5]; in SHA256_Transform() 83 G = ctx->state[6]; in SHA256_Transform() 84 H = ctx->state[7]; in SHA256_Transform() [all …]
|
D | sha.c | 38 static void SHA1_Transform(SHA_CTX* ctx) { in SHA1_Transform() argument 41 uint8_t* p = ctx->buf; in SHA1_Transform() 56 A = ctx->state[0]; in SHA1_Transform() 57 B = ctx->state[1]; in SHA1_Transform() 58 C = ctx->state[2]; in SHA1_Transform() 59 D = ctx->state[3]; in SHA1_Transform() 60 E = ctx->state[4]; in SHA1_Transform() 81 ctx->state[0] += A; in SHA1_Transform() 82 ctx->state[1] += B; in SHA1_Transform() 83 ctx->state[2] += C; in SHA1_Transform() [all …]
|
/system/core/libprocessgroup/ |
D | processgroup.cpp | 40 struct ctx { struct 66 static int initCtx(uid_t uid, int pid, struct ctx *ctx) in initCtx() argument 80 ctx->fd = fd; in initCtx() 81 ctx->buf_ptr = ctx->buf; in initCtx() 82 ctx->buf_len = 0; in initCtx() 83 ctx->initialized = true; in initCtx() 90 static int refillBuffer(struct ctx *ctx) in refillBuffer() argument 92 memmove(ctx->buf, ctx->buf_ptr, ctx->buf_len); in refillBuffer() 93 ctx->buf_ptr = ctx->buf; in refillBuffer() 95 ssize_t ret = read(ctx->fd, ctx->buf_ptr + ctx->buf_len, in refillBuffer() [all …]
|
/system/core/include/mincrypt/ |
D | hash-internal.h | 53 #define HASH_init(ctx) (ctx)->f->init(ctx) argument 54 #define HASH_update(ctx, data, len) (ctx)->f->update(ctx, data, len) argument 55 #define HASH_final(ctx) (ctx)->f->final(ctx) argument 56 #define HASH_hash(data, len, digest) (ctx)->f->hash(data, len, digest) 57 #define HASH_size(ctx) (ctx)->f->size argument
|
D | sha.h | 38 void SHA_init(SHA_CTX* ctx); 39 void SHA_update(SHA_CTX* ctx, const void* data, int len); 40 const uint8_t* SHA_final(SHA_CTX* ctx);
|
D | sha256.h | 39 void SHA256_init(SHA256_CTX* ctx); 40 void SHA256_update(SHA256_CTX* ctx, const void* data, int len); 41 const uint8_t* SHA256_final(SHA256_CTX* ctx);
|
/system/keymaster/ |
D | ocb.c | 374 #define ROUNDS(ctx) ((ctx)->rounds) argument 387 #define ROUNDS(ctx) (6 + OCB_KEY_LEN / 4) argument 421 #define ROUNDS(ctx) ((ctx)->rounds) argument 424 #define ROUNDS(ctx) (6 + OCB_KEY_LEN / 4) argument 644 static block getL(const ae_ctx* ctx, unsigned tz) { in getL() argument 646 return ctx->L[tz]; in getL() 650 block rval = swap_if_le(ctx->L[L_TABLE_SZ - 1]); in getL() 680 void ae_free(ae_ctx* ctx) { in ae_free() argument 682 _mm_free(ctx); in ae_free() 684 free(ctx); in ae_free() [all …]
|
D | ocb_utils.cpp | 72 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 …]
|
D | ae.h | 59 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,
|
D | integrity_assured_key_blob.cpp | 45 HmacCleanup(HMAC_CTX* ctx) : ctx_(ctx) {} in HmacCleanup() argument 60 HMAC_CTX ctx; in ComputeHmac() local 61 HMAC_CTX_init(&ctx); in ComputeHmac() 63 if (!HMAC_Init_ex(&ctx, HMAC_KEY, sizeof(HMAC_KEY), md, NULL /* engine */)) in ComputeHmac() 65 HmacCleanup cleanup(&ctx); in ComputeHmac() 69 if (!HMAC_Update(&ctx, serialized_data, serialized_data_size) || in ComputeHmac() 70 !HMAC_Update(&ctx, hidden_bytes.get(), hidden_bytes_size) || // in ComputeHmac() 71 !HMAC_Final(&ctx, tmp, &tmp_len)) in ComputeHmac()
|
D | rsa_operation.cpp | 511 UniquePtr<EVP_PKEY_CTX, EVP_PKEY_CTX_Delete> ctx( in Finish() local 513 if (!ctx.get()) in Finish() 516 if (EVP_PKEY_encrypt_init(ctx.get()) <= 0) in Finish() 519 keymaster_error_t error = SetRsaPaddingInEvpContext(ctx.get()); in Finish() 522 error = SetOaepDigestIfRequired(ctx.get()); in Finish() 527 if (EVP_PKEY_encrypt(ctx.get(), nullptr /* out */, &outlen, data_.peek_read(), in Finish() 545 if (EVP_PKEY_encrypt(ctx.get(), output->peek_write(), &outlen, to_encrypt, to_encrypt_len) <= 0) in Finish() 559 UniquePtr<EVP_PKEY_CTX, EVP_PKEY_CTX_Delete> ctx( in Finish() local 561 if (!ctx.get()) in Finish() 564 if (EVP_PKEY_decrypt_init(ctx.get()) <= 0) in Finish() [all …]
|
D | keymaster_enforcement.cpp | 380 EvpMdCtx ctx; in CreateKeyId() local 384 if (EVP_DigestInit_ex(ctx.get(), EVP_sha256(), nullptr /* ENGINE */) && in CreateKeyId() 385 EVP_DigestUpdate(ctx.get(), key_blob.key_material, key_blob.key_material_size) && in CreateKeyId() 386 EVP_DigestFinal_ex(ctx.get(), hash, &hash_len)) { in CreateKeyId()
|
D | android_keymaster.cpp | 51 void operator()(ae_ctx* ctx) const { ae_free(ctx); } in operator ()()
|
/system/extras/verity/ |
D | build_verity_tree.cpp | 93 struct sparse_hash_ctx *ctx = (struct sparse_hash_ctx *)priv; in hash_chunk() local 94 assert(len % ctx->block_size == 0); in hash_chunk() 97 hash_blocks(ctx->md, (const unsigned char *)data, len, in hash_chunk() 98 ctx->hashes, &s, in hash_chunk() 99 ctx->salt, ctx->salt_size, ctx->block_size); in hash_chunk() 100 ctx->hashes += s; in hash_chunk() 102 for (size_t i = 0; i < (size_t)len; i += ctx->block_size) { in hash_chunk() 103 memcpy(ctx->hashes, ctx->zero_block_hash, ctx->hash_size); in hash_chunk() 104 ctx->hashes += ctx->hash_size; in hash_chunk() 316 struct sparse_hash_ctx ctx; in main() local [all …]
|
D | generate_verity_key.c | 48 BN_CTX* ctx = BN_CTX_new(); in convert_to_mincrypt_format() local 59 BN_mod_sqr(rr, r, n, ctx); in convert_to_mincrypt_format() 60 BN_div(NULL, rem, n, r32, ctx); in convert_to_mincrypt_format() 61 BN_mod_inverse(n0inv, rem, r32, ctx); in convert_to_mincrypt_format() 66 BN_div(rr, rem, rr, r32, ctx); in convert_to_mincrypt_format() 68 BN_div(n, rem, n, r32, ctx); in convert_to_mincrypt_format() 81 BN_CTX_free(ctx); in convert_to_mincrypt_format()
|
D | verify_boot_signature.c | 233 EVP_MD_CTX *ctx = NULL; in hash_image() local 254 if ((ctx = EVP_MD_CTX_create()) == NULL) { in hash_image() 259 EVP_DigestInit(ctx, EVP_sha256()); in hash_image() 273 EVP_DigestUpdate(ctx, buffer, bytes); in hash_image() 294 EVP_DigestUpdate(ctx, attrs, bytes); in hash_image() 295 EVP_DigestFinal(ctx, digest, NULL); in hash_image() 304 if (ctx) { in hash_image() 305 EVP_MD_CTX_destroy(ctx); in hash_image()
|
/system/bt/stack/smp/ |
D | aes.h | 85 aes_context ctx[1] ); 92 const aes_context ctx[1] ); 98 const aes_context ctx[1] ); 105 const aes_context ctx[1] ); 111 const aes_context ctx[1] );
|
D | aes.c | 506 return_type aes_set_key( const unsigned char key[], length_type keylen, aes_context ctx[1] ) 525 ctx->rnd = 0; 528 block_copy_nn(ctx->ksch, key, keylen); 530 ctx->rnd = (hi >> 4) - 1; 534 t0 = ctx->ksch[cc - 4]; 535 t1 = ctx->ksch[cc - 3]; 536 t2 = ctx->ksch[cc - 2]; 537 t3 = ctx->ksch[cc - 1]; 555 ctx->ksch[cc + 0] = ctx->ksch[tt + 0] ^ t0; 556 ctx->ksch[cc + 1] = ctx->ksch[tt + 1] ^ t1; [all …]
|
D | smp_keys.c | 141 aes_context ctx; in smp_encrypt_data() local 177 aes_set_key(p_rev_key, SMP_ENCRYT_KEY_SIZE, &ctx); in smp_encrypt_data() 178 aes_encrypt(p_rev_data, p, &ctx); /* outputs in byte 48 to byte 63 */ in smp_encrypt_data()
|
/system/core/mkbootimg/ |
D | mkbootimg.c | 120 SHA_CTX ctx; in main() local 249 SHA_init(&ctx); in main() 250 SHA_update(&ctx, kernel_data, hdr.kernel_size); in main() 251 SHA_update(&ctx, &hdr.kernel_size, sizeof(hdr.kernel_size)); in main() 252 SHA_update(&ctx, ramdisk_data, hdr.ramdisk_size); in main() 253 SHA_update(&ctx, &hdr.ramdisk_size, sizeof(hdr.ramdisk_size)); in main() 254 SHA_update(&ctx, second_data, hdr.second_size); in main() 255 SHA_update(&ctx, &hdr.second_size, sizeof(hdr.second_size)); in main() 256 sha = SHA_final(&ctx); in main()
|
/system/core/adb/ |
D | adb_auth_host.cpp | 76 BN_CTX* ctx = BN_CTX_new(); in RSA_to_RSAPublicKey() local 92 BN_mod_sqr(rr, r, n, ctx); in RSA_to_RSAPublicKey() 93 BN_div(NULL, rem, n, r32, ctx); in RSA_to_RSAPublicKey() 94 BN_mod_inverse(n0inv, rem, r32, ctx); in RSA_to_RSAPublicKey() 99 BN_div(rr, rem, rr, r32, ctx); in RSA_to_RSAPublicKey() 101 BN_div(n, rem, n, r32, ctx); in RSA_to_RSAPublicKey() 113 BN_CTX_free(ctx); in RSA_to_RSAPublicKey()
|
/system/core/logd/ |
D | libaudit.h | 44 char ctx[0]; member
|
/system/extras/ext4_utils/ |
D | ext4_utils.c | 69 SHA1_CTX ctx; in sha1_hash() local 70 SHA1Init(&ctx); in sha1_hash() 71 SHA1Update(&ctx, (const u8*)namespace, strlen(namespace)); in sha1_hash() 72 SHA1Update(&ctx, (const u8*)name, strlen(name)); in sha1_hash() 73 SHA1Final(sha1, &ctx); in sha1_hash()
|
/system/media/camera/docs/ |
D | metadata_parser_xml.py | 308 ctx = Context(buf, metadata=self.metadata, **helpers) 309 tpl.render_context(ctx)
|