/crypto/ |
D | simd.c | 54 struct crypto_skcipher *child = &ctx->cryptd_tfm->base; in simd_skcipher_setkey() 78 child = &ctx->cryptd_tfm->base; in simd_skcipher_encrypt() 99 child = &ctx->cryptd_tfm->base; in simd_skcipher_decrypt() 135 reqsize = max(reqsize, crypto_skcipher_reqsize(&cryptd_tfm->base)); in simd_skcipher_init() 170 if (snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", algname) >= in simd_skcipher_create_compat() 174 if (snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", in simd_skcipher_create_compat() 178 alg->base.cra_flags = CRYPTO_ALG_ASYNC; in simd_skcipher_create_compat() 179 alg->base.cra_priority = ialg->base.cra_priority; in simd_skcipher_create_compat() 180 alg->base.cra_blocksize = ialg->base.cra_blocksize; in simd_skcipher_create_compat() 181 alg->base.cra_alignmask = ialg->base.cra_alignmask; in simd_skcipher_create_compat() [all …]
|
D | chacha_generic.c | 143 .base.cra_name = "chacha20", 144 .base.cra_driver_name = "chacha20-generic", 145 .base.cra_priority = 100, 146 .base.cra_blocksize = 1, 147 .base.cra_ctxsize = sizeof(struct chacha_ctx), 148 .base.cra_module = THIS_MODULE, 158 .base.cra_name = "xchacha20", 159 .base.cra_driver_name = "xchacha20-generic", 160 .base.cra_priority = 100, 161 .base.cra_blocksize = 1, [all …]
|
D | aead.c | 91 struct crypto_alg *alg = aead->base.__crt_alg; in crypto_aead_encrypt() 108 struct crypto_alg *alg = aead->base.__crt_alg; in crypto_aead_decrypt() 142 aead->base.exit = crypto_aead_exit_tfm; in crypto_aead_init_tfm() 154 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_report() 178 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_show() 212 .tfmsize = offsetof(struct crypto_aead, base), 278 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc() 279 "%s(%s)", tmpl->name, alg->base.cra_name) >= in aead_geniv_alloc() 282 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc() 283 "%s(%s)", tmpl->name, alg->base.cra_driver_name) >= in aead_geniv_alloc() [all …]
|
D | kpp.c | 63 kpp->base.exit = crypto_kpp_exit_tfm; in crypto_kpp_init_tfm() 81 .tfmsize = offsetof(struct crypto_kpp, base), 92 struct crypto_alg *base = &alg->base; in kpp_prepare_alg() local 94 base->cra_type = &crypto_kpp_type; in kpp_prepare_alg() 95 base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK; in kpp_prepare_alg() 96 base->cra_flags |= CRYPTO_ALG_TYPE_KPP; in kpp_prepare_alg() 101 struct crypto_alg *base = &alg->base; in crypto_register_kpp() local 104 return crypto_register_alg(base); in crypto_register_kpp() 110 crypto_unregister_alg(&alg->base); in crypto_unregister_kpp()
|
D | akcipher.c | 64 akcipher->base.exit = crypto_akcipher_exit_tfm; in crypto_akcipher_init_tfm() 90 .tfmsize = offsetof(struct crypto_akcipher, base), 96 spawn->base.frontend = &crypto_akcipher_type; in crypto_grab_akcipher() 97 return crypto_grab_spawn(&spawn->base, name, type, mask); in crypto_grab_akcipher() 110 struct crypto_alg *base = &alg->base; in akcipher_prepare_alg() local 112 base->cra_type = &crypto_akcipher_type; in akcipher_prepare_alg() 113 base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK; in akcipher_prepare_alg() 114 base->cra_flags |= CRYPTO_ALG_TYPE_AKCIPHER; in akcipher_prepare_alg() 124 struct crypto_alg *base = &alg->base; in crypto_register_akcipher() local 136 return crypto_register_alg(base); in crypto_register_akcipher() [all …]
|
D | ahash.c | 141 walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK; in crypto_hash_walk_first() 159 walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK; in crypto_ahash_walk_first() 199 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey() 238 (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? in ahash_save_req() 269 priv->complete = req->base.complete; in ahash_save_req() 270 priv->data = req->base.data; in ahash_save_req() 271 priv->flags = req->base.flags; in ahash_save_req() 280 req->base.complete = cplt; in ahash_save_req() 281 req->base.data = req; in ahash_save_req() 338 areq->base.complete(&areq->base, err); in ahash_op_unaligned_done() [all …]
|
D | cryptd.c | 276 rctx->complete(&req->base, err); in cryptd_skcipher_complete() 283 static void cryptd_skcipher_encrypt(struct crypto_async_request *base, in cryptd_skcipher_encrypt() argument 286 struct skcipher_request *req = skcipher_request_cast(base); in cryptd_skcipher_encrypt() 305 req->base.complete = rctx->complete; in cryptd_skcipher_encrypt() 311 static void cryptd_skcipher_decrypt(struct crypto_async_request *base, in cryptd_skcipher_decrypt() argument 314 struct skcipher_request *req = skcipher_request_cast(base); in cryptd_skcipher_decrypt() 333 req->base.complete = rctx->complete; in cryptd_skcipher_decrypt() 347 rctx->complete = req->base.complete; in cryptd_skcipher_enqueue() 348 req->base.complete = compl; in cryptd_skcipher_enqueue() 350 return cryptd_enqueue_request(queue, &req->base); in cryptd_skcipher_enqueue() [all …]
|
D | cts.c | 125 skcipher_request_set_callback(subreq, req->base.flags & in cts_cbc_encrypt() 163 skcipher_request_set_callback(subreq, req->base.flags, in crypto_cts_encrypt() 164 req->base.complete, in crypto_cts_encrypt() 165 req->base.data); in crypto_cts_encrypt() 174 skcipher_request_set_callback(subreq, req->base.flags, in crypto_cts_encrypt() 218 skcipher_request_set_callback(subreq, req->base.flags & in cts_cbc_decrypt() 258 skcipher_request_set_callback(subreq, req->base.flags, in crypto_cts_decrypt() 259 req->base.complete, in crypto_cts_decrypt() 260 req->base.data); in crypto_cts_decrypt() 266 skcipher_request_set_callback(subreq, req->base.flags, in crypto_cts_decrypt() [all …]
|
D | seqiv.c | 41 static void seqiv_aead_encrypt_complete(struct crypto_async_request *base, in seqiv_aead_encrypt_complete() argument 44 struct aead_request *req = base->data; in seqiv_aead_encrypt_complete() 66 compl = req->base.complete; in seqiv_aead_encrypt() 67 data = req->base.data; in seqiv_aead_encrypt() 74 skcipher_request_set_callback(nreq, req->base.flags, in seqiv_aead_encrypt() 87 info = kmemdup(req->iv, ivsize, req->base.flags & in seqiv_aead_encrypt() 97 aead_request_set_callback(subreq, req->base.flags, compl, data); in seqiv_aead_encrypt() 125 compl = req->base.complete; in seqiv_aead_decrypt() 126 data = req->base.data; in seqiv_aead_decrypt() 128 aead_request_set_callback(subreq, req->base.flags, compl, data); in seqiv_aead_decrypt() [all …]
|
D | sha3_generic.c | 246 .base.cra_name = "sha3-224", 247 .base.cra_driver_name = "sha3-224-generic", 248 .base.cra_blocksize = SHA3_224_BLOCK_SIZE, 249 .base.cra_module = THIS_MODULE, 256 .base.cra_name = "sha3-256", 257 .base.cra_driver_name = "sha3-256-generic", 258 .base.cra_blocksize = SHA3_256_BLOCK_SIZE, 259 .base.cra_module = THIS_MODULE, 266 .base.cra_name = "sha3-384", 267 .base.cra_driver_name = "sha3-384-generic", [all …]
|
D | ccm.c | 483 if (strncmp(mac->base.cra_name, "cbcmac(", 7) != 0 || in crypto_ccm_create_common() 509 if (strncmp(ctr->base.cra_name, "ctr(", 4) != 0 || in crypto_ccm_create_common() 511 ctr->base.cra_blocksize != 1) in crypto_ccm_create_common() 515 if (strcmp(ctr->base.cra_name + 4, mac->base.cra_name + 7) != 0) in crypto_ccm_create_common() 519 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_ccm_create_common() 520 "ccm(%s", ctr->base.cra_name + 4) >= CRYPTO_MAX_ALG_NAME) in crypto_ccm_create_common() 523 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_ccm_create_common() 524 "ccm_base(%s,%s)", ctr->base.cra_driver_name, in crypto_ccm_create_common() 525 mac->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in crypto_ccm_create_common() 528 inst->alg.base.cra_flags = ctr->base.cra_flags & CRYPTO_ALG_ASYNC; in crypto_ccm_create_common() [all …]
|
D | gcm.c | 624 if (strcmp(ghash->base.cra_name, "ghash") != 0 || in crypto_gcm_create_common() 639 if (strncmp(ctr->base.cra_name, "ctr(", 4) != 0 || in crypto_gcm_create_common() 641 ctr->base.cra_blocksize != 1) in crypto_gcm_create_common() 645 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_gcm_create_common() 646 "gcm(%s", ctr->base.cra_name + 4) >= CRYPTO_MAX_ALG_NAME) in crypto_gcm_create_common() 649 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_gcm_create_common() 650 "gcm_base(%s,%s)", ctr->base.cra_driver_name, in crypto_gcm_create_common() 655 inst->alg.base.cra_flags = (ghash->base.cra_flags | in crypto_gcm_create_common() 656 ctr->base.cra_flags) & CRYPTO_ALG_ASYNC; in crypto_gcm_create_common() 657 inst->alg.base.cra_priority = (ghash->base.cra_priority + in crypto_gcm_create_common() [all …]
|
D | rng.c | 33 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_rng_reset() 64 struct rng_alg *ralg = container_of(alg, struct rng_alg, base); in seedsize() 107 .tfmsize = offsetof(struct crypto_rng, base), 179 struct crypto_alg *base = &alg->base; in crypto_register_rng() local 184 base->cra_type = &crypto_rng_type; in crypto_register_rng() 185 base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK; in crypto_register_rng() 186 base->cra_flags |= CRYPTO_ALG_TYPE_RNG; in crypto_register_rng() 188 return crypto_register_alg(base); in crypto_register_rng() 194 crypto_unregister_alg(&alg->base); in crypto_unregister_rng()
|
D | dh.c | 36 static int _compute_val(const struct dh_ctx *ctx, MPI base, MPI val) in _compute_val() argument 39 return mpi_powm(val, base, ctx->xa, ctx->p); in _compute_val() 153 MPI base, val = mpi_alloc(0); in dh_compute_value() local 166 base = mpi_read_raw_from_sgl(req->src, req->src_len); in dh_compute_value() 167 if (!base) { in dh_compute_value() 171 ret = dh_is_pubkey_valid(ctx, base); in dh_compute_value() 175 base = ctx->g; in dh_compute_value() 178 ret = _compute_val(ctx, base, val); in dh_compute_value() 190 mpi_free(base); in dh_compute_value() 216 .base = {
|
D | ctr.c | 146 inst->alg.base.cra_blocksize = 1; in crypto_ctr_create() 215 skcipher_request_set_callback(subreq, req->base.flags, in crypto_rfc3686_crypt() 216 req->base.complete, req->base.data); in crypto_rfc3686_crypt() 308 if (alg->base.cra_blocksize != 1) in crypto_rfc3686_create() 312 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc3686_create() 313 "rfc3686(%s)", alg->base.cra_name) >= CRYPTO_MAX_ALG_NAME) in crypto_rfc3686_create() 315 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc3686_create() 316 "rfc3686(%s)", alg->base.cra_driver_name) >= in crypto_rfc3686_create() 320 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc3686_create() 321 inst->alg.base.cra_blocksize = 1; in crypto_rfc3686_create() [all …]
|
D | arc4.c | 47 .base.cra_name = "ecb(arc4)", 48 .base.cra_driver_name = "ecb(arc4)-generic", 49 .base.cra_priority = 100, 50 .base.cra_blocksize = ARC4_BLOCK_SIZE, 51 .base.cra_ctxsize = sizeof(struct arc4_ctx), 52 .base.cra_module = THIS_MODULE,
|
D | acompress.c | 74 acomp->base.exit = crypto_acomp_exit_tfm; in crypto_acomp_init_tfm() 102 .tfmsize = offsetof(struct crypto_acomp, base), 144 struct crypto_alg *base = &alg->base; in crypto_register_acomp() local 146 base->cra_type = &crypto_acomp_type; in crypto_register_acomp() 147 base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK; in crypto_register_acomp() 148 base->cra_flags |= CRYPTO_ALG_TYPE_ACOMPRESS; in crypto_register_acomp() 150 return crypto_register_alg(base); in crypto_register_acomp() 156 return crypto_unregister_alg(&alg->base); in crypto_unregister_acomp()
|
D | echainiv.c | 48 skcipher_request_set_callback(nreq, req->base.flags, in echainiv_encrypt() 59 aead_request_set_callback(subreq, req->base.flags, in echainiv_encrypt() 60 req->base.complete, req->base.data); in echainiv_encrypt() 99 compl = req->base.complete; in echainiv_decrypt() 100 data = req->base.data; in echainiv_decrypt() 102 aead_request_set_callback(subreq, req->base.flags, compl, data); in echainiv_decrypt() 133 inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); in echainiv_aead_create() 134 inst->alg.base.cra_ctxsize += inst->alg.ivsize; in echainiv_aead_create()
|
D | rsa-pkcs1pad.c | 221 async_req.data = req->base.data; in pkcs1pad_encrypt_sign_complete_cb() 224 req->base.complete(&async_req, in pkcs1pad_encrypt_sign_complete_cb() 262 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_encrypt() 339 async_req.data = req->base.data; in pkcs1pad_decrypt_complete_cb() 342 req->base.complete(&async_req, pkcs1pad_decrypt_complete(req, err)); in pkcs1pad_decrypt_complete_cb() 363 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_decrypt() 421 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_sign() 517 async_req.data = req->base.data; in pkcs1pad_verify_complete_cb() 520 req->base.complete(&async_req, pkcs1pad_verify_complete(req, err)); in pkcs1pad_verify_complete_cb() 551 akcipher_request_set_callback(&req_ctx->child_req, req->base.flags, in pkcs1pad_verify() [all …]
|
D | lrw.c | 216 rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; in crypt_done() 230 skcipher_request_set_callback(subreq, req->base.flags, crypt_done, req); in init_crypt() 346 if (alg->base.cra_blocksize != LRW_BLOCK_SIZE) in create() 353 &alg->base); in create() 358 cipher_name = alg->base.cra_name; in create() 375 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in create() 383 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in create() 384 inst->alg.base.cra_priority = alg->base.cra_priority; in create() 385 inst->alg.base.cra_blocksize = LRW_BLOCK_SIZE; in create() 386 inst->alg.base.cra_alignmask = alg->base.cra_alignmask | in create() [all …]
|
D | adiantum.c | 389 req->base.flags, in adiantum_crypt() 484 if (strcmp(streamcipher_alg->base.cra_name, "xchacha12") != 0 && in adiantum_supported_algorithms() 485 strcmp(streamcipher_alg->base.cra_name, "xchacha20") != 0) in adiantum_supported_algorithms() 494 if (strcmp(hash_alg->base.cra_name, "nhpoly1305") != 0) in adiantum_supported_algorithms() 577 streamcipher_alg->base.cra_name, in adiantum_create() 578 blockcipher_alg->cra_name, hash_alg->base.cra_name); in adiantum_create() 586 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in adiantum_create() 587 "adiantum(%s,%s)", streamcipher_alg->base.cra_name, in adiantum_create() 590 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in adiantum_create() 592 streamcipher_alg->base.cra_driver_name, in adiantum_create() [all …]
|
D | xts.c | 186 skcipher_request_set_callback(subreq, req->base.flags, cts_done, req); in cts_final() 208 rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; in encrypt_done() 228 rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; in decrypt_done() 251 skcipher_request_set_callback(subreq, req->base.flags, compl, req); in init_crypt() 386 if (alg->base.cra_blocksize != XTS_BLOCK_SIZE) in create() 393 &alg->base); in create() 398 cipher_name = alg->base.cra_name; in create() 415 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in create() 423 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in create() 424 inst->alg.base.cra_priority = alg->base.cra_priority; in create() [all …]
|
D | essiv.c | 464 struct crypto_alg *base, *block_base; in essiv_create() local 495 base = &skcipher_inst->alg.base; in essiv_create() 507 block_base = &skcipher_alg->base; in essiv_create() 517 base = &aead_inst->alg.base; in essiv_create() 529 block_base = &aead_alg->base; in essiv_create() 562 block_base->cra_name, hash_alg->base.cra_name); in essiv_create() 568 strlcpy(ictx->shash_driver_name, hash_alg->base.cra_driver_name, in essiv_create() 574 if (snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, in essiv_create() 576 hash_alg->base.cra_name) >= CRYPTO_MAX_ALG_NAME) in essiv_create() 578 if (snprintf(base->cra_driver_name, CRYPTO_MAX_ALG_NAME, in essiv_create() [all …]
|
D | crypto_null.c | 101 .base = { 110 .base.cra_name = "ecb(cipher_null)", 111 .base.cra_driver_name = "ecb-cipher_null", 112 .base.cra_priority = 100, 113 .base.cra_blocksize = NULL_BLOCK_SIZE, 114 .base.cra_ctxsize = 0, 115 .base.cra_module = THIS_MODULE,
|
D | authenc.c | 267 req->base.complete, req->base.data); in crypto_authenc_decrypt_tail() 407 auth_base = &auth->base; in crypto_authenc_create() 439 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_create() 441 enc->base.cra_name) >= in crypto_authenc_create() 445 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_create() 447 enc->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in crypto_authenc_create() 450 inst->alg.base.cra_flags = (auth_base->cra_flags | in crypto_authenc_create() 451 enc->base.cra_flags) & CRYPTO_ALG_ASYNC; in crypto_authenc_create() 452 inst->alg.base.cra_priority = enc->base.cra_priority * 10 + in crypto_authenc_create() 454 inst->alg.base.cra_blocksize = enc->base.cra_blocksize; in crypto_authenc_create() [all …]
|