/openbmc/linux/crypto/ |
H A D | api.c | 85 if (alg) in __crypto_alg_lookup() 87 alg = q; in __crypto_alg_lookup() 93 return alg; in __crypto_alg_lookup() 140 if (!alg) { in crypto_larval_add() 141 alg = &larval->alg; in crypto_larval_add() 146 if (alg != &larval->alg) { in crypto_larval_add() 149 alg = crypto_larval_wait(alg); in crypto_larval_add() 247 if (alg) { in crypto_alg_lookup() 260 if (alg && !crypto_is_larval(alg)) { in crypto_alg_lookup() 293 if (!IS_ERR_OR_NULL(alg) && crypto_is_larval(alg)) in crypto_larval_lookup() [all …]
|
H A D | algapi.c | 42 if (!alg->cra_name[0] || !alg->cra_driver_name[0]) in crypto_check_alg() 45 if (alg->cra_alignmask & (alg->cra_alignmask + 1)) in crypto_check_alg() 56 if (!alg->cra_type && (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == in crypto_check_alg() 92 alg); in crypto_destroy_instance() 195 BUG_ON(&inst->alg == alg); in crypto_remove_spawns() 309 memcpy(larval->alg.cra_driver_name, alg->cra_driver_name, in crypto_alloc_test_larval() 311 larval->alg.cra_priority = alg->cra_priority; in crypto_alloc_test_larval() 511 alg->cra_destroy(alg); in crypto_unregister_alg() 745 spawn->alg = alg; in crypto_grab_spawn() 783 alg = spawn->alg; in crypto_spawn_alg() [all …]
|
H A D | internal.h | 31 struct crypto_alg alg; member 101 return alg->cra_ctxsize; in crypto_cipher_ctxsize() 106 return alg->cra_ctxsize; in crypto_compress_ctxsize() 120 void crypto_shoot_alg(struct crypto_alg *alg); 163 refcount_inc(&alg->cra_refcnt); in crypto_alg_get() 164 return alg; in crypto_alg_get() 169 if (refcount_dec_and_test(&alg->cra_refcnt) && alg->cra_destroy) in crypto_alg_put() 170 alg->cra_destroy(alg); in crypto_alg_put() 185 return alg->cra_flags & CRYPTO_ALG_LARVAL; in crypto_is_larval() 190 return alg->cra_flags & CRYPTO_ALG_DEAD; in crypto_is_dead() [all …]
|
H A D | crypto_user_base.c | 63 alg = q; in crypto_alg_match() 69 return alg; in crypto_alg_match() 127 if (alg->cra_type && alg->cra_type->report) { in crypto_report_one() 128 if (alg->cra_type->report(skb, alg)) in crypto_report_one() 198 if (!alg) in crypto_report() 214 crypto_mod_put(alg); in crypto_report() 278 if (!alg) in crypto_update_alg() 290 crypto_mod_put(alg); in crypto_update_alg() 310 if (!alg) in crypto_del_alg() 356 if (alg) { in crypto_add_alg() [all …]
|
H A D | proc.c | 41 seq_printf(m, "name : %s\n", alg->cra_name); in c_show() 44 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show() 47 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show() 50 (alg->cra_flags & CRYPTO_ALG_INTERNAL) ? in c_show() 54 (alg->cra_flags & CRYPTO_ALG_FIPS_INTERNAL) ? in c_show() 58 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show() 64 if (alg->cra_type && alg->cra_type->show) { in c_show() 65 alg->cra_type->show(m, alg); in c_show() 69 switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { in c_show() 74 alg->cra_cipher.cia_min_keysize); in c_show() [all …]
|
H A D | crypto_user_stat.c | 63 ualg->cru_flags = alg->cra_flags; in crypto_reportstat_one() 68 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in crypto_reportstat_one() 78 if (alg->cra_type && alg->cra_type->report_stat) { in crypto_reportstat_one() 79 if (alg->cra_type->report_stat(skb, alg)) in crypto_reportstat_one() 86 if (crypto_report_cipher(skb, alg)) in crypto_reportstat_one() 90 if (crypto_report_comp(skb, alg)) in crypto_reportstat_one() 141 struct crypto_alg *alg; in crypto_reportstat() local 149 alg = crypto_alg_match(p, 0); in crypto_reportstat() 150 if (!alg) in crypto_reportstat() 163 err = crypto_reportstat_alg(alg, &info); in crypto_reportstat() [all …]
|
H A D | acompress.c | 61 alg->exit(acomp); in crypto_acomp_exit_tfm() 72 acomp->compress = alg->compress; in crypto_acomp_init_tfm() 73 acomp->decompress = alg->decompress; in crypto_acomp_init_tfm() 74 acomp->dst_free = alg->dst_free; in crypto_acomp_init_tfm() 75 acomp->reqsize = alg->reqsize; in crypto_acomp_init_tfm() 77 if (alg->exit) in crypto_acomp_init_tfm() 80 if (alg->init) in crypto_acomp_init_tfm() 81 return alg->init(acomp); in crypto_acomp_init_tfm() 97 struct crypto_alg *alg) in __crypto_acomp_report_stat() argument 200 comp_prepare_alg(&alg->calg); in crypto_register_acomp() [all …]
|
H A D | simd.c | 43 struct skcipher_alg alg; member 116 struct skcipher_alg *alg; in simd_skcipher_init() local 120 salg = container_of(alg, struct simd_skcipher_alg, alg); in simd_skcipher_init() 146 struct skcipher_alg *alg; in simd_skcipher_create_compat() local 163 alg = &salg->alg; in simd_skcipher_create_compat() 182 alg->ivsize = ialg->ivsize; in simd_skcipher_create_compat() 283 struct aead_alg alg; member 364 struct aead_alg *alg; in simd_aead_init() local 368 salg = container_of(alg, struct simd_aead_alg, alg); in simd_aead_init() 393 struct aead_alg *alg; in simd_aead_create_compat() local [all …]
|
H A D | aead.c | 26 return &alg->stat; in aead_get_stat() 110 istat = aead_get_stat(alg); in crypto_aead_encrypt() 120 ret = alg->encrypt(req); in crypto_aead_encrypt() 133 istat = aead_get_stat(alg); in crypto_aead_decrypt() 145 ret = alg->decrypt(req); in crypto_aead_decrypt() 156 alg->exit(aead); in crypto_aead_exit_tfm() 168 if (alg->exit) in crypto_aead_init_tfm() 171 if (alg->init) in crypto_aead_init_tfm() 172 return alg->init(aead); in crypto_aead_init_tfm() 276 if (max3(alg->maxauthsize, alg->ivsize, alg->chunksize) > in aead_prepare_alg() [all …]
|
H A D | shash.c | 471 alg->exit_tfm(hash); in crypto_shash_exit_tfm() 484 if (alg->exit_tfm) in crypto_shash_init_tfm() 487 if (!alg->init_tfm) in crypto_shash_init_tfm() 496 if (alg->exit_tfm) in crypto_shash_init_tfm() 600 if (!alg->clone_tfm && (alg->init_tfm || alg->base.cra_init)) in crypto_clone_shash() 648 if ((alg->export && !alg->import) || (alg->import && !alg->export)) in shash_prepare_alg() 658 if (!alg->finup) in shash_prepare_alg() 660 if (!alg->digest) in shash_prepare_alg() 662 if (!alg->export) { in shash_prepare_alg() 665 alg->halg.statesize = alg->descsize; in shash_prepare_alg() [all …]
|
H A D | ahash.c | 419 alg->exit_tfm(hash); in crypto_ahash_exit_tfm() 434 hash->init = alg->init; in crypto_ahash_init_tfm() 435 hash->update = alg->update; in crypto_ahash_init_tfm() 436 hash->final = alg->final; in crypto_ahash_init_tfm() 438 hash->digest = alg->digest; in crypto_ahash_init_tfm() 439 hash->export = alg->export; in crypto_ahash_init_tfm() 442 if (alg->setkey) { in crypto_ahash_init_tfm() 447 if (alg->exit_tfm) in crypto_ahash_init_tfm() 450 return alg->init_tfm ? alg->init_tfm(hash) : 0; in crypto_ahash_init_tfm() 547 struct ahash_alg *alg; in crypto_clone_ahash() local [all …]
|
H A D | ctr.c | 130 struct crypto_alg *alg; in crypto_ctr_create() local 137 alg = skcipher_ialg_simple(inst); in crypto_ctr_create() 141 if (alg->cra_blocksize < 4) in crypto_ctr_create() 145 if (alg->cra_blocksize % 4) in crypto_ctr_create() 155 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create() 261 struct skcipher_alg *alg; in crypto_rfc3686_create() local 301 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc3686_create() 303 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc3686_create() 306 inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); in crypto_rfc3686_create() 307 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg) + in crypto_rfc3686_create() [all …]
|
H A D | kpp.c | 21 struct sk_buff *skb, struct crypto_alg *alg) in crypto_kpp_report() argument 43 struct kpp_alg *alg = crypto_kpp_alg(kpp); in crypto_kpp_exit_tfm() local 45 alg->exit(kpp); in crypto_kpp_exit_tfm() 53 if (alg->exit) in crypto_kpp_init_tfm() 56 if (alg->init) in crypto_kpp_init_tfm() 57 return alg->init(kpp); in crypto_kpp_init_tfm() 135 struct crypto_alg *base = &alg->base; in kpp_prepare_alg() 147 struct crypto_alg *base = &alg->base; in crypto_register_kpp() 149 kpp_prepare_alg(alg); in crypto_register_kpp() 156 crypto_unregister_alg(&alg->base); in crypto_unregister_kpp() [all …]
|
H A D | akcipher.c | 49 alg->exit(akcipher); in crypto_akcipher_exit_tfm() 57 if (alg->exit) in crypto_akcipher_init_tfm() 60 if (alg->init) in crypto_akcipher_init_tfm() 61 return alg->init(akcipher); in crypto_akcipher_init_tfm() 160 if (!alg->sign) in crypto_register_akcipher() 161 alg->sign = akcipher_default_op; in crypto_register_akcipher() 162 if (!alg->verify) in crypto_register_akcipher() 164 if (!alg->encrypt) in crypto_register_akcipher() 166 if (!alg->decrypt) in crypto_register_akcipher() 168 if (!alg->set_priv_key) in crypto_register_akcipher() [all …]
|
H A D | geniv.c | 46 struct aead_alg *alg; in aead_geniv_alloc() local 67 alg = crypto_spawn_aead_alg(spawn); in aead_geniv_alloc() 69 ivsize = crypto_aead_alg_ivsize(alg); in aead_geniv_alloc() 70 maxauthsize = crypto_aead_alg_maxauthsize(alg); in aead_geniv_alloc() 86 inst->alg.base.cra_priority = alg->base.cra_priority; in aead_geniv_alloc() 87 inst->alg.base.cra_blocksize = alg->base.cra_blocksize; in aead_geniv_alloc() 88 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in aead_geniv_alloc() 91 inst->alg.setkey = aead_geniv_setkey; in aead_geniv_alloc() 92 inst->alg.setauthsize = aead_geniv_setauthsize; in aead_geniv_alloc() 94 inst->alg.ivsize = ivsize; in aead_geniv_alloc() [all …]
|
H A D | hmac.c | 188 struct crypto_alg *alg; in hmac_create() local 209 alg = &salg->base; in hmac_create() 219 ss < alg->cra_blocksize) in hmac_create() 226 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create() 227 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create() 228 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create() 231 inst->alg.digestsize = ds; in hmac_create() 232 inst->alg.statesize = ss; in hmac_create() 237 inst->alg.init = hmac_init; in hmac_create() 239 inst->alg.final = hmac_final; in hmac_create() [all …]
|
H A D | rng.c | 33 struct rng_alg *alg = crypto_rng_alg(tfm); in crypto_rng_reset() local 38 atomic64_inc(&rng_get_stat(alg)->seed_cnt); in crypto_rng_reset() 52 err = alg->seed(tfm, seed, slen); in crypto_rng_reset() 56 return crypto_rng_errstat(alg, err); in crypto_rng_reset() 73 struct sk_buff *skb, struct crypto_alg *alg) in crypto_rng_report() argument 81 rrng.seedsize = seedsize(alg); in crypto_rng_report() 95 struct sk_buff *skb, struct crypto_alg *alg) in crypto_rng_report_stat() argument 97 struct rng_alg *rng = __crypto_rng_alg(alg); in crypto_rng_report_stat() 203 struct crypto_alg *base = &alg->base; in crypto_register_rng() 205 if (alg->seedsize > PAGE_SIZE / 8) in crypto_register_rng() [all …]
|
H A D | crypto_engine.c | 77 struct crypto_engine_alg *alg; in crypto_pump_requests() local 154 op = &alg->op; in crypto_pump_requests() 574 if (!alg->op.do_one_request) in crypto_engine_register_aead() 585 crypto_unregister_aead(&alg->base); in crypto_engine_unregister_aead() 619 if (!alg->op.do_one_request) in crypto_engine_register_ahash() 630 crypto_unregister_ahash(&alg->base); in crypto_engine_unregister_ahash() 665 if (!alg->op.do_one_request) in crypto_engine_register_akcipher() 676 crypto_unregister_akcipher(&alg->base); in crypto_engine_unregister_akcipher() 682 if (!alg->op.do_one_request) in crypto_engine_register_kpp() 693 crypto_unregister_kpp(&alg->base); in crypto_engine_unregister_kpp() [all …]
|
/openbmc/linux/fs/verity/ |
H A D | hash_algs.c | 45 struct fsverity_hash_alg *alg; in fsverity_get_hash_alg() local 58 return alg; in fsverity_get_hash_alg() 62 if (alg->tfm != NULL) in fsverity_get_hash_alg() 70 alg->name); in fsverity_get_hash_alg() 71 alg = ERR_PTR(-ENOPKG); in fsverity_get_hash_alg() 77 alg = ERR_CAST(tfm); in fsverity_get_hash_alg() 96 alg = ERR_PTR(err); in fsverity_get_hash_alg() 99 return alg; in fsverity_get_hash_alg() 120 desc->tfm = alg->tfm; in fsverity_prepare_hash_state() 226 if (!alg->name) in fsverity_check_hash_algs() [all …]
|
/openbmc/qemu/crypto/ |
H A D | cipher.c | 74 assert(alg < G_N_ELEMENTS(alg_key_len)); in qcrypto_cipher_get_block_len() 75 return alg_block_len[alg]; in qcrypto_cipher_get_block_len() 81 assert(alg < G_N_ELEMENTS(alg_key_len)); in qcrypto_cipher_get_key_len() 82 return alg_key_len[alg]; in qcrypto_cipher_get_key_len() 89 if (alg >= G_N_ELEMENTS(alg_block_len)) { in qcrypto_cipher_get_iv_len() 97 return alg_block_len[alg]; in qcrypto_cipher_get_iv_len() 111 alg); in qcrypto_cipher_validate_key_length() 116 if (alg == QCRYPTO_CIPHER_ALG_DES || in qcrypto_cipher_validate_key_length() 117 alg == QCRYPTO_CIPHER_ALG_3DES) { in qcrypto_cipher_validate_key_length() 132 if (alg_key_len[alg] != nkey) { in qcrypto_cipher_validate_key_length() [all …]
|
H A D | hash.c | 35 size_t qcrypto_hash_digest_len(QCryptoHashAlgorithm alg) in qcrypto_hash_digest_len() argument 37 assert(alg < G_N_ELEMENTS(qcrypto_hash_alg_size)); in qcrypto_hash_digest_len() 38 return qcrypto_hash_alg_size[alg]; in qcrypto_hash_digest_len() 41 int qcrypto_hash_bytesv(QCryptoHashAlgorithm alg, in qcrypto_hash_bytesv() argument 62 return qcrypto_hash_lib_driver.hash_bytesv(alg, iov, niov, in qcrypto_hash_bytesv() 68 int qcrypto_hash_bytes(QCryptoHashAlgorithm alg, in qcrypto_hash_bytes() argument 82 int qcrypto_hash_digestv(QCryptoHashAlgorithm alg, in qcrypto_hash_digestv() argument 106 int qcrypto_hash_digest(QCryptoHashAlgorithm alg, in qcrypto_hash_digest() argument 114 return qcrypto_hash_digestv(alg, &iov, 1, digest, errp); in qcrypto_hash_digest() 117 int qcrypto_hash_base64v(QCryptoHashAlgorithm alg, in qcrypto_hash_base64v() argument [all …]
|
H A D | hash-afalg.c | 23 qcrypto_afalg_hash_format_name(QCryptoHashAlgorithm alg, in qcrypto_afalg_hash_format_name() argument 30 switch (alg) { in qcrypto_afalg_hash_format_name() 54 error_setg(errp, "Unsupported hash algorithm %d", alg); in qcrypto_afalg_hash_format_name() 68 qcrypto_afalg_hash_hmac_ctx_new(QCryptoHashAlgorithm alg, in qcrypto_afalg_hash_hmac_ctx_new() argument 75 name = qcrypto_afalg_hash_format_name(alg, is_hmac, errp); in qcrypto_afalg_hash_hmac_ctx_new() 102 qcrypto_afalg_hash_ctx_new(QCryptoHashAlgorithm alg, in qcrypto_afalg_hash_ctx_new() argument 109 qcrypto_afalg_hmac_ctx_new(QCryptoHashAlgorithm alg, in qcrypto_afalg_hmac_ctx_new() argument 118 QCryptoHashAlgorithm alg, in qcrypto_afalg_hash_hmac_bytesv() argument 128 const int expect_len = qcrypto_hash_digest_len(alg); in qcrypto_afalg_hash_hmac_bytesv() 143 afalg = qcrypto_afalg_hash_ctx_new(alg, errp); in qcrypto_afalg_hash_hmac_bytesv() [all …]
|
/openbmc/linux/include/crypto/ |
H A D | akcipher.h | 302 return alg->max_size(tfm); in crypto_akcipher_maxsize() 306 struct akcipher_alg *alg) in akcipher_get_stat() argument 309 return &alg->stat; in akcipher_get_stat() 321 atomic64_inc(&akcipher_get_stat(alg)->err_cnt); in crypto_akcipher_errstat() 348 return crypto_akcipher_errstat(alg, alg->encrypt(req)); in crypto_akcipher_encrypt() 373 return crypto_akcipher_errstat(alg, alg->decrypt(req)); in crypto_akcipher_decrypt() 428 atomic64_inc(&akcipher_get_stat(alg)->sign_cnt); in crypto_akcipher_sign() 430 return crypto_akcipher_errstat(alg, alg->sign(req)); in crypto_akcipher_sign() 455 return crypto_akcipher_errstat(alg, alg->verify(req)); in crypto_akcipher_verify() 477 return alg->set_pub_key(tfm, key, keylen); in crypto_akcipher_set_pub_key() [all …]
|
H A D | kpp.h | 140 return container_of(alg, struct kpp_alg, base); in __crypto_kpp_alg() 297 return &alg->stat; in kpp_get_stat() 309 atomic64_inc(&kpp_get_stat(alg)->err_cnt); in crypto_kpp_errstat() 332 struct kpp_alg *alg = crypto_kpp_alg(tfm); in crypto_kpp_set_secret() local 337 return crypto_kpp_errstat(alg, alg->set_secret(tfm, buffer, len)); in crypto_kpp_set_secret() 356 struct kpp_alg *alg = crypto_kpp_alg(tfm); in crypto_kpp_generate_public_key() local 361 return crypto_kpp_errstat(alg, alg->generate_public_key(req)); in crypto_kpp_generate_public_key() 377 struct kpp_alg *alg = crypto_kpp_alg(tfm); in crypto_kpp_compute_shared_secret() local 382 return crypto_kpp_errstat(alg, alg->compute_shared_secret(req)); in crypto_kpp_compute_shared_secret() 397 struct kpp_alg *alg = crypto_kpp_alg(tfm); in crypto_kpp_maxsize() local [all …]
|
/openbmc/qemu/tests/unit/ |
H A D | test-crypto-cipher.c | 30 QCryptoCipherAlgorithm alg; member 46 .alg = QCRYPTO_CIPHER_ALG_AES_128, 63 .alg = QCRYPTO_CIPHER_ALG_AES_192, 159 .alg = QCRYPTO_CIPHER_ALG_DES, 168 .alg = QCRYPTO_CIPHER_ALG_DES, 177 .alg = QCRYPTO_CIPHER_ALG_DES, 194 .alg = QCRYPTO_CIPHER_ALG_3DES, 223 .alg = QCRYPTO_CIPHER_ALG_3DES, 236 .alg = QCRYPTO_CIPHER_ALG_3DES, 389 .alg = QCRYPTO_CIPHER_ALG_SM4, [all …]
|