Home
last modified time | relevance | path

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

12

/lib/crypto/
A Dsha512.c152 __sha512_init(&ctx->ctx, &sha384_iv, 0); in sha384_init()
158 __sha512_init(&ctx->ctx, &sha512_iv, 0); in sha512_init()
206 sha512_blocks(&ctx->state, ctx->buf, 1); in __sha512_final()
212 sha512_blocks(&ctx->state, ctx->buf, 1); in __sha512_final()
221 memzero_explicit(ctx, sizeof(*ctx)); in sha384_final()
228 memzero_explicit(ctx, sizeof(*ctx)); in sha512_final()
312 __hmac_sha512_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha384_init_usingrawkey()
315 ctx->ctx.sha_ctx.bytecount_hi = 0; in hmac_sha384_init_usingrawkey()
322 __hmac_sha512_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha512_init_usingrawkey()
325 ctx->ctx.sha_ctx.bytecount_hi = 0; in hmac_sha512_init_usingrawkey()
[all …]
A Dsha256.c167 __sha256_init(&ctx->ctx, &sha224_iv, 0); in sha224_init()
173 __sha256_init(&ctx->ctx, &sha256_iv, 0); in sha256_init()
193 sha256_blocks(&ctx->state, ctx->buf, 1); in __sha256_update()
219 sha256_blocks(&ctx->state, ctx->buf, 1); in __sha256_final()
224 sha256_blocks(&ctx->state, ctx->buf, 1); in __sha256_final()
233 memzero_explicit(ctx, sizeof(*ctx)); in sha224_final()
240 memzero_explicit(ctx, sizeof(*ctx)); in sha256_final()
326 __hmac_sha256_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha224_init_usingrawkey()
328 ctx->ctx.sha_ctx.bytecount = SHA256_BLOCK_SIZE; in hmac_sha224_init_usingrawkey()
335 __hmac_sha256_preparekey(&ctx->ctx.sha_ctx.state, &ctx->ctx.ostate, in hmac_sha256_init_usingrawkey()
[all …]
A Dsha1.c165 ctx->bytecount = 0; in sha1_init()
185 sha1_blocks(&ctx->state, ctx->buf, 1); in sha1_update()
210 sha1_blocks(&ctx->state, ctx->buf, 1); in __sha1_final()
215 sha1_blocks(&ctx->state, ctx->buf, 1); in __sha1_final()
224 memzero_explicit(ctx, sizeof(*ctx)); in sha1_final()
230 struct sha1_ctx ctx; in sha1() local
232 sha1_init(&ctx); in sha1()
285 __hmac_sha1_preparekey(&ctx->sha_ctx.state, &ctx->ostate, in hmac_sha1_init_usingrawkey()
294 __sha1_final(&ctx->sha_ctx, ctx->sha_ctx.buf); in hmac_sha1_final()
302 sha1_blocks(&ctx->ostate, ctx->sha_ctx.buf, 1); in hmac_sha1_final()
[all …]
A Daes.c232 ctx->key_dec[0] = ctx->key_enc[key_len + 24]; in aes_expandkey()
233 ctx->key_dec[1] = ctx->key_enc[key_len + 25]; in aes_expandkey()
234 ctx->key_dec[2] = ctx->key_enc[key_len + 26]; in aes_expandkey()
235 ctx->key_dec[3] = ctx->key_enc[key_len + 27]; in aes_expandkey()
238 ctx->key_dec[i] = inv_mix_columns(ctx->key_enc[j]); in aes_expandkey()
239 ctx->key_dec[i + 1] = inv_mix_columns(ctx->key_enc[j + 1]); in aes_expandkey()
240 ctx->key_dec[i + 2] = inv_mix_columns(ctx->key_enc[j + 2]); in aes_expandkey()
244 ctx->key_dec[i] = ctx->key_enc[0]; in aes_expandkey()
245 ctx->key_dec[i + 1] = ctx->key_enc[1]; in aes_expandkey()
246 ctx->key_dec[i + 2] = ctx->key_enc[2]; in aes_expandkey()
[all …]
A Darc4.c18 ctx->x = 1; in arc4_setkey()
19 ctx->y = 0; in arc4_setkey()
22 ctx->S[i] = i; in arc4_setkey()
25 u32 a = ctx->S[i]; in arc4_setkey()
28 ctx->S[i] = ctx->S[j]; in arc4_setkey()
29 ctx->S[j] = a; in arc4_setkey()
40 u32 *const S = ctx->S; in arc4_crypt()
47 x = ctx->x; in arc4_crypt()
48 y = ctx->y; in arc4_crypt()
70 ctx->x = x; in arc4_crypt()
[all …]
A Daesgcm.c29 aes_encrypt(ctx, dst, src); in aesgcm_encrypt_block()
52 aes_expandkey(&ctx->aes_ctx, key, keysize); in aesgcm_expandkey()
56 ctx->authsize = authsize; in aesgcm_expandkey()
57 aesgcm_encrypt_block(&ctx->aes_ctx, &ctx->ghash_key, kin); in aesgcm_expandkey()
96 aesgcm_ghash(&ghash, &ctx->ghash_key, src, src_len); in aesgcm_mac()
100 aesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr); in aesgcm_mac()
122 aesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr); in aesgcm_crypt()
155 aesgcm_crypt(ctx, dst, src, crypt_len, ctr); in aesgcm_encrypt()
188 if (crypto_memneq(authtag, tagbuf, ctx->authsize)) { in aesgcm_decrypt()
192 aesgcm_crypt(ctx, dst, src, crypt_len, ctr); in aesgcm_decrypt()
[all …]
A Daescfb.c14 static void aescfb_encrypt_block(const struct crypto_aes_ctx *ctx, void *dst, in aescfb_encrypt_block() argument
28 aes_encrypt(ctx, dst, src); in aescfb_encrypt_block()
41 void aescfb_encrypt(const struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src, in aescfb_encrypt() argument
48 aescfb_encrypt_block(ctx, ks, v); in aescfb_encrypt()
75 aescfb_encrypt_block(ctx, ks[0], iv); in aescfb_decrypt()
84 aescfb_encrypt_block(ctx, ks[!i], src); in aescfb_decrypt()
217 struct crypto_aes_ctx ctx; in libaescfb_init() local
220 if (aes_expandkey(&ctx, aescfb_tv[i].key, aescfb_tv[i].klen)) { in libaescfb_init()
225 aescfb_encrypt(&ctx, buf, aescfb_tv[i].ptext, aescfb_tv[i].len, in libaescfb_init()
233 aescfb_decrypt(&ctx, buf, buf, aescfb_tv[i].len, aescfb_tv[i].iv); in libaescfb_init()
[all …]
/lib/kunit/
A Dkunit-test.c91 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in kunit_try_catch_test_init()
93 test->priv = ctx; in kunit_try_catch_test_init()
204 ctx); in kunit_resource_test_alloc_resource()
235 &ctx->test, in kunit_resource_test_destroy_resource()
239 ctx); in kunit_resource_test_destroy_resource()
256 &ctx->test, in kunit_resource_test_remove_resource()
260 ctx); in kunit_resource_test_remove_resource()
297 ctx); in kunit_resource_test_cleanup_resources()
350 ctx); in fake_resource_1_init()
383 ctx); in kunit_resource_test_proper_free_ordering()
[all …]
A Dstatic_stub.c44 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()
116 ctx->real_fn_addr = real_fn_addr; in __kunit_activate_static_stub()
117 ctx->replacement_addr = replacement_addr; in __kunit_activate_static_stub()
[all …]
A Dplatform-test.c139 ctx = to_test_context(pdev); in kunit_platform_driver_probe()
140 ctx->data = test_data; in kunit_platform_driver_probe()
153 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in kunit_platform_driver_register_test()
154 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); in kunit_platform_driver_register_test()
160 ctx->pdrv.probe = kunit_platform_driver_probe; in kunit_platform_driver_register_test()
161 ctx->pdrv.driver.name = name; in kunit_platform_driver_register_test()
162 ctx->pdrv.driver.owner = THIS_MODULE; in kunit_platform_driver_register_test()
182 ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
183 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
190 ctx->pdrv.driver.name = name; in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
[all …]
A Dresource.c84 void *ctx; member
91 action_ctx->func(action_ctx->ctx); in __kunit_action_free()
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()
163 void *ctx) in kunit_release_action() argument
[all …]
A Dtest.c472 struct kunit_try_catch_context *ctx = data; in kunit_try_run_case() local
473 struct kunit *test = ctx->test; in kunit_try_run_case()
474 struct kunit_suite *suite = ctx->suite; in kunit_try_run_case()
475 struct kunit_case *test_case = ctx->test_case; in kunit_try_run_case()
489 struct kunit_try_catch_context *ctx = data; in kunit_try_run_case_cleanup() local
490 struct kunit *test = ctx->test; in kunit_try_run_case_cleanup()
491 struct kunit_suite *suite = ctx->suite; in kunit_try_run_case_cleanup()
500 struct kunit_try_catch_context *ctx = data; in kunit_catch_run_case_cleanup() local
501 struct kunit *test = ctx->test; in kunit_catch_run_case_cleanup()
531 struct kunit_try_catch_context *ctx = data; in kunit_catch_run_case() local
[all …]
/lib/crypto/mpi/
A Dmpih-mul.c328 if (!ctx->tspace || ctx->tspace_size < vsize) { in mpihelp_mul_karatsuba_case()
343 if (!ctx->tp || ctx->tp_size < vsize) { in mpihelp_mul_karatsuba_case()
344 if (ctx->tp) in mpihelp_mul_karatsuba_case()
357 MPN_MUL_N_RECURSE(ctx->tp, up, vp, vsize, ctx->tspace); in mpihelp_mul_karatsuba_case()
375 ctx->next = kzalloc(sizeof *ctx, GFP_KERNEL); in mpihelp_mul_karatsuba_case()
397 if (ctx->tp) in mpihelp_release_karatsuba_ctx()
399 if (ctx->tspace) in mpihelp_release_karatsuba_ctx()
401 for (ctx = ctx->next; ctx; ctx = ctx2) { in mpihelp_release_karatsuba_ctx()
403 if (ctx->tp) in mpihelp_release_karatsuba_ctx()
407 kfree(ctx); in mpihelp_release_karatsuba_ctx()
[all …]
/lib/crypto/tests/
A Dhash-test-template.h137 HASH_INIT(&ctx); in test_hash_all_lens_up_to_4096()
171 HASH_INIT(&ctx); in test_hash_incremental_updates()
315 HASH_INIT(&ctx); in test_hash_ctx_zeroization()
318 KUNIT_ASSERT_MEMEQ_MSG(test, &ctx, zeroes, sizeof(ctx), in test_hash_ctx_zeroization()
496 ctx++) { in hash_irq_test2_func()
512 ctx->step++; in hash_irq_test2_func()
515 HASH_UPDATE(&ctx->hash_ctx, &test_buf[ctx->offset], in hash_irq_test2_func()
517 ctx->offset += state->update_lens[ctx->step - 1]; in hash_irq_test2_func()
518 ctx->step++; in hash_irq_test2_func()
528 ctx->step = 0; in hash_irq_test2_func()
[all …]
A Dpoly1305_kunit.c19 struct poly1305_desc_ctx ctx; in poly1305() local
21 poly1305_init(&ctx, key); in poly1305()
22 poly1305_update(&ctx, data, len); in poly1305()
23 poly1305_final(&ctx, out); in poly1305()
26 static void poly1305_init_withtestkey(struct poly1305_desc_ctx *ctx) in poly1305_init_withtestkey() argument
28 poly1305_init(ctx, test_key); in poly1305_init_withtestkey()
/lib/crypto/arm/
A Dsha512-armv4.pl63 $ctx="r0"; # parameter block
293 ldr $Elo,[$ctx,#$Eoff+$lo]
294 ldr $Ehi,[$ctx,#$Eoff+$hi]
295 ldr $t0, [$ctx,#$Goff+$lo]
296 ldr $t1, [$ctx,#$Goff+$hi]
297 ldr $t2, [$ctx,#$Hoff+$lo]
298 ldr $t3, [$ctx,#$Hoff+$hi]
304 ldr $Alo,[$ctx,#$Aoff+$lo]
305 ldr $Ahi,[$ctx,#$Aoff+$hi]
306 ldr $Tlo,[$ctx,#$Boff+$lo]
[all …]
A Dpoly1305-armv4.pl72 str r3,[$ctx,#4]
73 str r3,[$ctx,#8]
74 str r3,[$ctx,#12]
75 str r3,[$ctx,#16]
77 add $ctx,$ctx,#20
152 str r4,[$ctx,#0]
154 str r5,[$ctx,#4]
156 str r6,[$ctx,#8]
195 add $ctx,$ctx,#20
372 my $g4=$ctx;
[all …]
/lib/crypto/mips/
A Dpoly1305-mips.pl278 ld $h1,8($ctx)
419 sd $h1,8($ctx)
1173 addu $ctx,$ctx,$in0
1176 sltu $ctx,$tmp0,$ctx
1180 sltu $ctx,$tmp1,$ctx
1184 sltu $ctx,$tmp2,$ctx
1188 sltu $ctx,$tmp3,$ctx
1195 subu $ctx,$zero,$ctx
1201 and $in0,$ctx
1221 sltu $ctx,$in1,$ctx
[all …]
/lib/crypto/arm64/
A Dpoly1305-armv8.pl320 str w12,[$ctx,#16*0] // r0
360 ldp w12,w13,[$ctx,#8]
361 ldr w14,[$ctx,#16]
405 ldr $h2,[$ctx,#16]
446 add $ctx,$ctx,#48+12
450 sub $ctx,$ctx,#4
454 sub $ctx,$ctx,#4
458 sub $ctx,$ctx,#4
460 sub $ctx,$ctx,#48 // restore original $ctx
480 add x15,$ctx,#48
[all …]
A Dsha2-armv8.pl259 ldp @X[0],@X[1],[$ctx]
268 stp $A,$B,[$ctx]
675 ldp $A,$B,[$ctx]
676 ldp $C,$D,[$ctx,#8]
677 ldp $E,$F,[$ctx,#16]
678 ldp $G,$H,[$ctx,#24]
711 ldp $t0,$t1,[$ctx,#0]
723 stp $A,$B,[$ctx,#0]
726 stp $C,$D,[$ctx,#8]
728 stp $E,$F,[$ctx,#16]
[all …]
/lib/crypto/x86/
A Dpoly1305_glue.c38 static void convert_to_base2_64(void *ctx) in convert_to_base2_64() argument
40 struct poly1305_arch_internal *state = ctx; in convert_to_base2_64()
94 struct poly1305_arch_internal *ctx = in poly1305_blocks_arch() local
111 convert_to_base2_64(ctx); in poly1305_blocks_arch()
112 poly1305_blocks_x86_64(ctx, inp, len, padbit); in poly1305_blocks_arch()
121 poly1305_blocks_avx512(ctx, inp, bytes, padbit); in poly1305_blocks_arch()
123 poly1305_blocks_avx2(ctx, inp, bytes, padbit); in poly1305_blocks_arch()
125 poly1305_blocks_avx(ctx, inp, bytes, padbit); in poly1305_blocks_arch()
134 void poly1305_emit_arch(const struct poly1305_state *ctx, in poly1305_emit_arch() argument
138 poly1305_emit_x86_64(ctx, mac, nonce); in poly1305_emit_arch()
[all …]
A Dpoly1305-x86_64-cryptogams.pl333 push $ctx
334 .cfi_push $ctx
343 mov 8($ctx),$h1
371 mov $h1,8($ctx)
439 push $ctx
443 pop $ctx
456 lea 48+64($ctx),$ctx # size optimization
607 lea -48-64($ctx),$ctx # size [de-]optimization
894 lea `16*3+64`($ctx),$ctx # size optimization
1843 lea 48+64($ctx),$ctx # size optimization
[all …]
/lib/lz4/
A Dlz4_compress.c479 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState()
484 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState()
490 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState()
495 return LZ4_compress_generic(ctx, source, in LZ4_compress_fast_extState()
522 LZ4_stream_t_internal * const ctx, in LZ4_compress_destSize_generic() argument
563 LZ4_putPosition(ip, ctx->hashTable, tableType, base); in LZ4_compress_destSize_generic()
587 match = LZ4_getPositionOnHash(h, ctx->hashTable, in LZ4_compress_destSize_generic()
592 ctx->hashTable, tableType, in LZ4_compress_destSize_generic()
670 LZ4_putPosition(ip - 2, ctx->hashTable, tableType, base); in LZ4_compress_destSize_generic()
673 match = LZ4_getPosition(ip, ctx->hashTable, tableType, base); in LZ4_compress_destSize_generic()
[all …]
/lib/math/tests/
A Dprime_numbers_kunit.c9 static void dump_primes(void *ctx, const struct primes *p) in dump_primes() argument
12 struct kunit_suite *suite = ctx; in dump_primes()
/lib/tests/
A Dutil_macros_kunit.c16 KUNIT_ASSERT_EQ(ctx, exp_idx, found); \
20 static void test_find_closest(struct kunit *ctx) in test_find_closest() argument
124 KUNIT_ASSERT_EQ(ctx, exp_idx, found); \
128 static void test_find_closest_descending(struct kunit *ctx) in test_find_closest_descending() argument

Completed in 39 milliseconds

12