/lib/crypto/mpi/ |
D | ec.c | 88 static void point_resize(MPI_POINT p, struct mpi_ec_ctx *ctx) in point_resize() argument 90 size_t nlimbs = ctx->p->nlimbs; in point_resize() 97 if (ctx->model != MPI_EC_MONTGOMERY) { in point_resize() 104 struct mpi_ec_ctx *ctx) in point_swap_cond() argument 107 if (ctx->model != MPI_EC_MONTGOMERY) in point_swap_cond() 122 static void ec_addm(MPI w, MPI u, MPI v, struct mpi_ec_ctx *ctx) in ec_addm() argument 125 ec_mod(w, ctx); in ec_addm() 136 static void ec_mulm(MPI w, MPI u, MPI v, struct mpi_ec_ctx *ctx) in ec_mulm() argument 139 ec_mod(w, ctx); in ec_mulm() 143 static void ec_mul2(MPI w, MPI u, struct mpi_ec_ctx *ctx) in ec_mul2() argument [all …]
|
D | mpi-mod.c | 38 mpi_barrett_t ctx; in mpi_barrett_init() local 42 ctx = kcalloc(1, sizeof(*ctx), GFP_KERNEL); in mpi_barrett_init() 43 if (!ctx) in mpi_barrett_init() 47 ctx->m = mpi_copy(m); in mpi_barrett_init() 48 ctx->m_copied = 1; in mpi_barrett_init() 50 ctx->m = m; in mpi_barrett_init() 52 ctx->k = mpi_get_nlimbs(m); in mpi_barrett_init() 53 tmp = mpi_alloc(ctx->k + 1); in mpi_barrett_init() 57 mpi_lshift_limbs(tmp, 2 * ctx->k); in mpi_barrett_init() 60 ctx->y = tmp; in mpi_barrett_init() [all …]
|
D | mpih-mul.c | 349 struct karatsuba_ctx *ctx) in mpihelp_mul_karatsuba_case() argument 353 if (!ctx->tspace || ctx->tspace_size < vsize) { in mpihelp_mul_karatsuba_case() 354 if (ctx->tspace) in mpihelp_mul_karatsuba_case() 355 mpi_free_limb_space(ctx->tspace); in mpihelp_mul_karatsuba_case() 356 ctx->tspace = mpi_alloc_limb_space(2 * vsize); in mpihelp_mul_karatsuba_case() 357 if (!ctx->tspace) in mpihelp_mul_karatsuba_case() 359 ctx->tspace_size = vsize; in mpihelp_mul_karatsuba_case() 362 MPN_MUL_N_RECURSE(prodp, up, vp, vsize, ctx->tspace); in mpihelp_mul_karatsuba_case() 368 if (!ctx->tp || ctx->tp_size < vsize) { in mpihelp_mul_karatsuba_case() 369 if (ctx->tp) in mpihelp_mul_karatsuba_case() [all …]
|
D | mpi-internal.h | 173 void mpihelp_release_karatsuba_ctx(struct karatsuba_ctx *ctx); 190 struct karatsuba_ctx *ctx);
|
/lib/kunit/ |
D | kunit-test.c | 21 struct kunit_try_catch_test_context *ctx = test->priv; in kunit_test_successful_try() local 23 ctx->function_called = true; in kunit_test_successful_try() 35 struct kunit_try_catch_test_context *ctx = test->priv; in kunit_test_try_catch_successful_try_no_catch() local 36 struct kunit_try_catch *try_catch = ctx->try_catch; in kunit_test_try_catch_successful_try_no_catch() 44 KUNIT_EXPECT_TRUE(test, ctx->function_called); in kunit_test_try_catch_successful_try_no_catch() 50 struct kunit_try_catch_test_context *ctx = test->priv; in kunit_test_unsuccessful_try() local 51 struct kunit_try_catch *try_catch = ctx->try_catch; in kunit_test_unsuccessful_try() 60 struct kunit_try_catch_test_context *ctx = test->priv; in kunit_test_catch() local 62 ctx->function_called = true; in kunit_test_catch() 67 struct kunit_try_catch_test_context *ctx = test->priv; in kunit_test_try_catch_unsuccessful_try_does_catch() local [all …]
|
D | static_stub.c | 31 struct kunit_static_stub_ctx *ctx = res->data; in __kunit_static_stub_resource_match() local 37 return ctx->real_fn_addr == match_real_fn_addr; in __kunit_static_stub_resource_match() 44 struct kunit_static_stub_ctx *ctx; in __kunit_get_static_stub_address_impl() local 54 ctx = res->data; in __kunit_get_static_stub_address_impl() 55 replacement_addr = ctx->replacement_addr; in __kunit_get_static_stub_address_impl() 91 struct kunit_static_stub_ctx *ctx; in __kunit_activate_static_stub() local 108 ctx = res->data; in __kunit_activate_static_stub() 109 ctx->replacement_addr = replacement_addr; in __kunit_activate_static_stub() 114 ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); in __kunit_activate_static_stub() 115 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); in __kunit_activate_static_stub() [all …]
|
D | resource.c | 84 void *ctx; member 91 action_ctx->func(action_ctx->ctx); in __kunit_action_free() 95 int kunit_add_action(struct kunit *test, void (*action)(void *), void *ctx) in kunit_add_action() argument 106 action_ctx->ctx = ctx; in kunit_add_action() 117 void *ctx) in kunit_add_action_or_reset() argument 119 int res = kunit_add_action(test, action, ctx); in kunit_add_action_or_reset() 122 action(ctx); in kunit_add_action_or_reset() 138 return (match_ctx->func == res_ctx->func) && (match_ctx->ctx == res_ctx->ctx); in __kunit_action_match() 143 void *ctx) in kunit_remove_action() argument 149 match_ctx.ctx = ctx; in kunit_remove_action() [all …]
|
D | test.c | 461 struct kunit_try_catch_context *ctx = data; in kunit_try_run_case() local 462 struct kunit *test = ctx->test; in kunit_try_run_case() 463 struct kunit_suite *suite = ctx->suite; in kunit_try_run_case() 464 struct kunit_case *test_case = ctx->test_case; in kunit_try_run_case() 478 struct kunit_try_catch_context *ctx = data; in kunit_try_run_case_cleanup() local 479 struct kunit *test = ctx->test; in kunit_try_run_case_cleanup() 480 struct kunit_suite *suite = ctx->suite; in kunit_try_run_case_cleanup() 489 struct kunit_try_catch_context *ctx = data; in kunit_catch_run_case_cleanup() local 490 struct kunit *test = ctx->test; in kunit_catch_run_case_cleanup() 520 struct kunit_try_catch_context *ctx = data; in kunit_catch_run_case() local [all …]
|
/lib/crypto/ |
D | aes.c | 186 int aes_expandkey(struct crypto_aes_ctx *ctx, const u8 *in_key, in aes_expandkey() argument 195 trace_android_vh_aes_expandkey(ctx, in_key, key_len, &err); in aes_expandkey() 204 ctx->key_length = key_len; in aes_expandkey() 207 ctx->key_enc[i] = get_unaligned_le32(in_key + i * sizeof(u32)); in aes_expandkey() 210 u32 *rki = ctx->key_enc + (i * kwords); in aes_expandkey() 239 ctx->key_dec[0] = ctx->key_enc[key_len + 24]; in aes_expandkey() 240 ctx->key_dec[1] = ctx->key_enc[key_len + 25]; in aes_expandkey() 241 ctx->key_dec[2] = ctx->key_enc[key_len + 26]; in aes_expandkey() 242 ctx->key_dec[3] = ctx->key_enc[key_len + 27]; in aes_expandkey() 245 ctx->key_dec[i] = inv_mix_columns(ctx->key_enc[j]); in aes_expandkey() [all …]
|
D | arc4.c | 13 int arc4_setkey(struct arc4_ctx *ctx, const u8 *in_key, unsigned int key_len) in arc4_setkey() argument 17 ctx->x = 1; in arc4_setkey() 18 ctx->y = 0; in arc4_setkey() 21 ctx->S[i] = i; in arc4_setkey() 24 u32 a = ctx->S[i]; in arc4_setkey() 27 ctx->S[i] = ctx->S[j]; in arc4_setkey() 28 ctx->S[j] = a; in arc4_setkey() 37 void arc4_crypt(struct arc4_ctx *ctx, u8 *out, const u8 *in, unsigned int len) in arc4_crypt() argument 39 u32 *const S = ctx->S; in arc4_crypt() 46 x = ctx->x; in arc4_crypt() [all …]
|
D | aesgcm.c | 16 static void aesgcm_encrypt_block(const struct crypto_aes_ctx *ctx, void *dst, in aesgcm_encrypt_block() argument 30 aes_encrypt(ctx, dst, src); in aesgcm_encrypt_block() 46 int aesgcm_expandkey(struct aesgcm_ctx *ctx, const u8 *key, in aesgcm_expandkey() argument 53 aes_expandkey(&ctx->aes_ctx, key, keysize); in aesgcm_expandkey() 57 ctx->authsize = authsize; in aesgcm_expandkey() 58 aesgcm_encrypt_block(&ctx->aes_ctx, &ctx->ghash_key, kin); in aesgcm_expandkey() 76 static void aesgcm_mac(const struct aesgcm_ctx *ctx, const u8 *src, int src_len, in aesgcm_mac() argument 83 aesgcm_ghash(&ghash, &ctx->ghash_key, assoc, assoc_len); in aesgcm_mac() 84 aesgcm_ghash(&ghash, &ctx->ghash_key, src, src_len); in aesgcm_mac() 85 aesgcm_ghash(&ghash, &ctx->ghash_key, &tail, sizeof(tail)); in aesgcm_mac() [all …]
|
D | des.c | 699 int des_expand_key(struct des_ctx *ctx, const u8 *key, unsigned int keylen) in des_expand_key() argument 704 return des_ekey(ctx->expkey, key) ? 0 : -ENOKEY; in des_expand_key() 781 void des_encrypt(const struct des_ctx *ctx, u8 *dst, const u8 *src) in des_encrypt() argument 783 const u32 *K = ctx->expkey; in des_encrypt() 802 void des_decrypt(const struct des_ctx *ctx, u8 *dst, const u8 *src) in des_decrypt() argument 804 const u32 *K = ctx->expkey + DES_EXPKEY_WORDS - 2; in des_decrypt() 823 int des3_ede_expand_key(struct des3_ede_ctx *ctx, const u8 *key, in des3_ede_expand_key() argument 826 u32 *pe = ctx->expkey; in des3_ede_expand_key()
|
/lib/ |
D | libcrc32c.c | 41 u32 ret, *ctx = (u32 *)shash_desc_ctx(shash); in crc32c() local 45 *ctx = crc; in crc32c() 50 ret = *ctx; in crc32c() 51 barrier_data(ctx); in crc32c()
|
D | locking-selftest.c | 1678 if (WARN_ON(!o.ctx) || in ww_test_fail_acquire() 1732 o.ctx = (void *)~0UL; in ww_test_normal() 1735 WARN_ON(o.ctx != (void *)~0UL); in ww_test_normal() 1738 o.ctx = (void *)~0UL; in ww_test_normal() 1744 WARN_ON(o.ctx != (void *)~0UL); in ww_test_normal() 1747 o.ctx = (void *)~0UL; in ww_test_normal() 1753 WARN_ON(o.ctx != (void *)~0UL); in ww_test_normal() 1756 o.ctx = (void *)~0UL; in ww_test_normal() 1763 WARN_ON(o.ctx != (void *)~0UL); in ww_test_normal() 1766 o.ctx = (void *)~0UL; in ww_test_normal() [all …]
|
/lib/lz4/ |
D | lz4_compress.c | 466 LZ4_stream_t_internal *ctx = &((LZ4_stream_t *)state)->internal_donotuse; in LZ4_compress_fast_extState() local 480 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState() 485 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState() 491 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState() 496 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState() 523 LZ4_stream_t_internal * const ctx, in LZ4_compress_destSize_generic() argument 564 LZ4_putPosition(ip, ctx->hashTable, tableType, base); in LZ4_compress_destSize_generic() 588 match = LZ4_getPositionOnHash(h, ctx->hashTable, in LZ4_compress_destSize_generic() 593 ctx->hashTable, tableType, in LZ4_compress_destSize_generic() 671 LZ4_putPosition(ip - 2, ctx->hashTable, tableType, base); in LZ4_compress_destSize_generic() [all …]
|
D | lz4hc_compress.c | 339 LZ4HC_CCtx_internal *const ctx, in LZ4HC_compress_generic() argument 373 ctx->end += inputSize; in LZ4HC_compress_generic() 379 ml = LZ4HC_InsertAndFindBestMatch(ctx, ip, in LZ4HC_compress_generic() 393 ml2 = LZ4HC_InsertAndGetWiderMatch(ctx, in LZ4HC_compress_generic() 455 ml3 = LZ4HC_InsertAndGetWiderMatch(ctx, in LZ4HC_compress_generic() 589 LZ4HC_CCtx_internal *ctx = &((LZ4_streamHC_t *)state)->internal_donotuse; in LZ4_compress_HC_extStateHC() local 598 LZ4HC_init(ctx, (const BYTE *)src); in LZ4_compress_HC_extStateHC() 601 return LZ4HC_compress_generic(ctx, src, dst, in LZ4_compress_HC_extStateHC() 604 return LZ4HC_compress_generic(ctx, src, dst, in LZ4_compress_HC_extStateHC()
|
/lib/zstd/common/ |
D | zstd_internal.h | 344 const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx); /* compress & dictBuilder */
|
/lib/zstd/compress/ |
D | zstd_compress.c | 208 const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx) { return &(ctx->seqStore); } in ZSTD_getSeqStore() argument
|