/crypto/ |
D | tcrypt.c | 129 static inline int do_one_aead_op(struct aead_request *req, int ret) in do_one_aead_op() argument 133 return crypto_wait_req(ret, wait); in do_one_aead_op() 177 int ret = 0; in test_mb_aead_jiffies() local 186 ret = do_mult_aead_op(data, enc, num_mb, rc); in test_mb_aead_jiffies() 187 if (ret) in test_mb_aead_jiffies() 196 return ret; in test_mb_aead_jiffies() 203 int ret = 0; in test_mb_aead_cycles() local 213 ret = do_mult_aead_op(data, enc, num_mb, rc); in test_mb_aead_cycles() 214 if (ret) in test_mb_aead_cycles() 223 ret = do_mult_aead_op(data, enc, num_mb, rc); in test_mb_aead_cycles() [all …]
|
D | deflate.c | 44 int ret = 0; in deflate_comp_init() local 50 ret = -ENOMEM; in deflate_comp_init() 54 ret = zlib_deflateInit(stream, 3); in deflate_comp_init() 56 ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED, in deflate_comp_init() 60 if (ret != Z_OK) { in deflate_comp_init() 61 ret = -EINVAL; in deflate_comp_init() 65 return ret; in deflate_comp_init() 73 int ret = 0; in deflate_decomp_init() local 78 ret = -ENOMEM; in deflate_decomp_init() 82 ret = zlib_inflateInit(stream); in deflate_decomp_init() [all …]
|
D | drbg.c | 247 int ret = 0; in drbg_fips_continuous_test() local 266 ret = memcmp(drbg->prev, entropy, entropylen); in drbg_fips_continuous_test() 267 if (!ret) in drbg_fips_continuous_test() 324 int ret = 0; in drbg_ctr_bcc() local 341 ret = drbg_kcapi_sym(drbg, out, &data); in drbg_ctr_bcc() 342 if (ret) in drbg_ctr_bcc() 343 return ret; in drbg_ctr_bcc() 353 ret = drbg_kcapi_sym(drbg, out, &data); in drbg_ctr_bcc() 355 return ret; in drbg_ctr_bcc() 402 int ret = -EFAULT; in drbg_ctr_df() local [all …]
|
D | zstd.c | 34 int ret = 0; in zstd_comp_init() local 40 ret = -ENOMEM; in zstd_comp_init() 46 ret = -EINVAL; in zstd_comp_init() 50 return ret; in zstd_comp_init() 58 int ret = 0; in zstd_decomp_init() local 63 ret = -ENOMEM; in zstd_decomp_init() 69 ret = -EINVAL; in zstd_decomp_init() 73 return ret; in zstd_decomp_init() 95 int ret; in __zstd_init() local 97 ret = zstd_comp_init(ctx); in __zstd_init() [all …]
|
D | jitterentropy-kcapi.c | 106 int ret = 0; in jent_kcapi_init() local 110 ret = -ENOMEM; in jent_kcapi_init() 113 return ret; in jent_kcapi_init() 132 int ret = 0; in jent_kcapi_random() local 136 ret = jent_read_entropy(rng->entropy_collector, rdata, dlen); in jent_kcapi_random() 138 if (ret == -3) { in jent_kcapi_random() 150 ret = -EFAULT; in jent_kcapi_random() 151 } else if (ret == -2) { in jent_kcapi_random() 154 ret = -EAGAIN; in jent_kcapi_random() 155 } else if (ret == -1) { in jent_kcapi_random() [all …]
|
D | rsa.c | 51 int ret = -ENOMEM; in _rsa_dec_crt() local 63 ret = mpi_powm(m_or_m1_or_h, c, key->dp, key->p); in _rsa_dec_crt() 64 if (ret) in _rsa_dec_crt() 68 ret = mpi_powm(m2, c, key->dq, key->q); in _rsa_dec_crt() 69 if (ret) in _rsa_dec_crt() 80 ret = 0; in _rsa_dec_crt() 85 return ret; in _rsa_dec_crt() 98 int ret = 0; in rsa_enc() local 105 ret = -EINVAL; in rsa_enc() 109 ret = -ENOMEM; in rsa_enc() [all …]
|
D | crypto_engine.c | 30 int ret; in crypto_finalize_request() local 51 ret = enginectx->op.unprepare_request(engine, req); in crypto_finalize_request() 52 if (ret) in crypto_finalize_request() 77 int ret; in crypto_pump_requests() local 141 ret = engine->prepare_crypt_hardware(engine); in crypto_pump_requests() 142 if (ret) { in crypto_pump_requests() 151 ret = enginectx->op.prepare_request(engine, async_req); in crypto_pump_requests() 152 if (ret) { in crypto_pump_requests() 154 ret); in crypto_pump_requests() 160 ret = -EINVAL; in crypto_pump_requests() [all …]
|
D | algapi.c | 309 int ret = -EAGAIN; in __crypto_register_alg() local 316 ret = -EEXIST; in __crypto_register_alg() 359 larval = ERR_PTR(ret); in __crypto_register_alg() 487 int ret; in crypto_unregister_alg() local 491 ret = crypto_remove_alg(alg, &list); in crypto_unregister_alg() 494 if (WARN(ret, "Algorithm %s is not registered", alg->cra_driver_name)) in crypto_unregister_alg() 509 int i, ret; in crypto_register_algs() local 512 ret = crypto_register_alg(&algs[i]); in crypto_register_algs() 513 if (ret) in crypto_register_algs() 523 return ret; in crypto_register_algs() [all …]
|
D | ecdsa.c | 149 int ret; in ecdsa_verify() local 162 ret = asn1_ber_decoder(&ecdsasignature_decoder, &sig_ctx, in ecdsa_verify() 164 if (ret < 0) in ecdsa_verify() 180 ret = _ecdsa_verify(ctx, hash, sig_ctx.r, sig_ctx.s); in ecdsa_verify() 185 return ret; in ecdsa_verify() 207 int ret; in ecdsa_ecc_ctx_reset() local 210 ret = ecdsa_ecc_ctx_init(ctx, curve_id); in ecdsa_ecc_ctx_reset() 211 if (ret == 0) in ecdsa_ecc_ctx_reset() 214 return ret; in ecdsa_ecc_ctx_reset() 228 int ret; in ecdsa_set_pub_key() local [all …]
|
D | ecdh.c | 58 int ret = -ENOMEM; in ecdh_compute_value() local 74 ret = -EINVAL; in ecdh_compute_value() 87 ret = crypto_ecdh_shared_secret(ctx->curve_id, ctx->ndigits, in ecdh_compute_value() 93 ret = ecc_make_pub_key(ctx->curve_id, ctx->ndigits, in ecdh_compute_value() 99 if (ret < 0) in ecdh_compute_value() 108 ret = -EINVAL; in ecdh_compute_value() 115 return ret; in ecdh_compute_value() 205 int ret; in ecdh_init() local 208 ret = crypto_register_kpp(&ecdh_nist_p192); in ecdh_init() 209 ecdh_nist_p192_registered = ret == 0; in ecdh_init() [all …]
|
D | aead.c | 26 int ret; in setkey_unaligned() local 37 ret = crypto_aead_alg(tfm)->setkey(tfm, alignbuffer, keylen); in setkey_unaligned() 40 return ret; in setkey_unaligned() 88 int ret; in crypto_aead_encrypt() local 92 ret = -ENOKEY; in crypto_aead_encrypt() 94 ret = crypto_aead_alg(aead)->encrypt(req); in crypto_aead_encrypt() 95 crypto_stats_aead_encrypt(cryptlen, alg, ret); in crypto_aead_encrypt() 96 return ret; in crypto_aead_encrypt() 105 int ret; in crypto_aead_decrypt() local 109 ret = -ENOKEY; in crypto_aead_decrypt() [all …]
|
D | scompress.c | 110 int ret = 0; in crypto_scomp_init_tfm() local 114 ret = crypto_scomp_alloc_scratches(); in crypto_scomp_init_tfm() 117 return ret; in crypto_scomp_init_tfm() 128 int ret; in scomp_acomp_comp_decomp() local 146 ret = crypto_scomp_compress(scomp, scratch->src, req->slen, in scomp_acomp_comp_decomp() 149 ret = crypto_scomp_decompress(scomp, scratch->src, req->slen, in scomp_acomp_comp_decomp() 151 if (!ret) { in scomp_acomp_comp_decomp() 155 ret = -ENOMEM; in scomp_acomp_comp_decomp() 159 ret = -ENOSPC; in scomp_acomp_comp_decomp() 167 return ret; in scomp_acomp_comp_decomp() [all …]
|
D | dh.c | 130 int ret; in dh_is_pubkey_valid() local 148 ret = mpi_powm(val, y, q, ctx->p); in dh_is_pubkey_valid() 150 if (ret) { in dh_is_pubkey_valid() 152 return ret; in dh_is_pubkey_valid() 155 ret = mpi_cmp_ui(val, 1); in dh_is_pubkey_valid() 159 if (ret != 0) in dh_is_pubkey_valid() 171 int ret = 0; in dh_compute_value() local 178 ret = -EINVAL; in dh_compute_value() 185 ret = -EINVAL; in dh_compute_value() 188 ret = dh_is_pubkey_valid(ctx, base); in dh_compute_value() [all …]
|
D | 842.c | 124 int ret; in crypto842_mod_init() local 126 ret = crypto_register_alg(&alg); in crypto842_mod_init() 127 if (ret) in crypto842_mod_init() 128 return ret; in crypto842_mod_init() 130 ret = crypto_register_scomp(&scomp); in crypto842_mod_init() 131 if (ret) { in crypto842_mod_init() 133 return ret; in crypto842_mod_init() 136 return ret; in crypto842_mod_init()
|
D | pcrypt.c | 81 int ret; in pcrypt_aead_enc() local 83 ret = crypto_aead_encrypt(req); in pcrypt_aead_enc() 85 if (ret == -EINPROGRESS) in pcrypt_aead_enc() 88 padata->info = ret; in pcrypt_aead_enc() 130 int ret; in pcrypt_aead_dec() local 132 ret = crypto_aead_decrypt(req); in pcrypt_aead_dec() 134 if (ret == -EINPROGRESS) in pcrypt_aead_dec() 137 padata->info = ret; in pcrypt_aead_dec() 313 int ret; in pcrypt_sysfs_add() local 316 ret = kobject_add(&pinst->kobj, NULL, "%s", name); in pcrypt_sysfs_add() [all …]
|
D | lz4.c | 134 int ret; in lz4_mod_init() local 136 ret = crypto_register_alg(&alg_lz4); in lz4_mod_init() 137 if (ret) in lz4_mod_init() 138 return ret; in lz4_mod_init() 140 ret = crypto_register_scomp(&scomp); in lz4_mod_init() 141 if (ret) { in lz4_mod_init() 143 return ret; in lz4_mod_init() 146 return ret; in lz4_mod_init()
|
/crypto/asymmetric_keys/ |
D | public_key.c | 158 int ret, len; in software_key_query() local 160 ret = software_key_determine_akcipher(pkey, params->encoding, in software_key_query() 162 if (ret < 0) in software_key_query() 163 return ret; in software_key_query() 169 ret = -ENOMEM; in software_key_query() 181 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_query() 183 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_query() 184 if (ret < 0) in software_key_query() 218 ret = 0; in software_key_query() 224 pr_devel("<==%s() = %d\n", __func__, ret); in software_key_query() [all …]
|
D | pkcs7_verify.c | 29 int ret; in pkcs7_digest() local 50 ret = -ENOMEM; in pkcs7_digest() 62 ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len, in pkcs7_digest() 64 if (ret < 0) in pkcs7_digest() 77 ret = -EKEYREJECTED; in pkcs7_digest() 84 ret = -EBADMSG; in pkcs7_digest() 92 ret = -EKEYREJECTED; in pkcs7_digest() 103 ret = crypto_shash_init(desc); in pkcs7_digest() 104 if (ret < 0) in pkcs7_digest() 107 ret = crypto_shash_update(desc, &tag, 1); in pkcs7_digest() [all …]
|
D | verify_pefile.c | 250 int ret; in pefile_digest_pe_contents() local 255 ret = crypto_shash_update(desc, pebuf, ctx->image_checksum_offset); in pefile_digest_pe_contents() 256 if (ret < 0) in pefile_digest_pe_contents() 257 return ret; in pefile_digest_pe_contents() 260 ret = crypto_shash_update(desc, pebuf + tmp, in pefile_digest_pe_contents() 262 if (ret < 0) in pefile_digest_pe_contents() 263 return ret; in pefile_digest_pe_contents() 266 ret = crypto_shash_update(desc, pebuf + tmp, ctx->header_size - tmp); in pefile_digest_pe_contents() 267 if (ret < 0) in pefile_digest_pe_contents() 268 return ret; in pefile_digest_pe_contents() [all …]
|
D | x509_public_key.c | 29 int ret; in x509_get_sig_params() local 57 ret = -ENOMEM; in x509_get_sig_params() 68 ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest); in x509_get_sig_params() 69 if (ret < 0) in x509_get_sig_params() 72 ret = is_hash_blacklisted(sig->digest, sig->digest_size, in x509_get_sig_params() 74 if (ret == -EKEYREJECTED) { in x509_get_sig_params() 78 ret = 0; in x509_get_sig_params() 85 pr_devel("<==%s() = %d\n", __func__, ret); in x509_get_sig_params() 86 return ret; in x509_get_sig_params() 95 int ret = 0; in x509_check_for_self_signed() local [all …]
|
D | selftest.c | 181 int ret, i; in fips_signature_selftest() local 196 ret = x509_load_certificate_list(certs_selftest_keys, in fips_signature_selftest() 198 if (ret < 0) in fips_signature_selftest() 199 panic("Can't allocate certs selftest keyring: %d\n", ret); in fips_signature_selftest() 207 panic("Certs selftest %d: pkcs7_parse_message() = %d\n", i, ret); in fips_signature_selftest() 211 ret = pkcs7_verify(pkcs7, VERIFYING_MODULE_SIGNATURE); in fips_signature_selftest() 212 if (ret < 0) in fips_signature_selftest() 213 panic("Certs selftest %d: pkcs7_verify() = %d\n", i, ret); in fips_signature_selftest() 215 ret = pkcs7_validate_trust(pkcs7, keyring); in fips_signature_selftest() 216 if (ret < 0) in fips_signature_selftest() [all …]
|
D | restrict.c | 32 int ret; in ca_keys_setup() local 39 ret = __asymmetric_key_hex_to_key_id(str + 3, p, hexlen); in ca_keys_setup() 40 if (ret < 0) in ca_keys_setup() 77 int ret; in restrict_link_by_signature() local 104 ret = -ENOKEY; in restrict_link_by_signature() 106 ret = verify_signature(key, sig); in restrict_link_by_signature() 108 return ret; in restrict_link_by_signature() 125 int ret; in key_or_keyring_common() local 214 ret = key_validate(key); in key_or_keyring_common() 215 if (ret == 0) in key_or_keyring_common() [all …]
|
D | pkcs7_trust.c | 29 int ret; in pkcs7_validate_trust_one() local 115 ret = verify_signature(key, sig); in pkcs7_validate_trust_one() 117 if (ret < 0) { in pkcs7_validate_trust_one() 118 if (ret == -ENOMEM) in pkcs7_validate_trust_one() 119 return ret; in pkcs7_validate_trust_one() 120 kleave(" = -EKEYREJECTED [verify %d]", ret); in pkcs7_validate_trust_one() 164 int ret; in pkcs7_validate_trust() local 170 ret = pkcs7_validate_trust_one(pkcs7, sinfo, trust_keyring); in pkcs7_validate_trust() 171 switch (ret) { in pkcs7_validate_trust() 182 return ret; in pkcs7_validate_trust()
|
D | signature.c | 47 int ret; in query_asymmetric_key() local 60 ret = subtype->query(params, info); in query_asymmetric_key() 62 pr_devel("<==%s() = %d\n", __func__, ret); in query_asymmetric_key() 63 return ret; in query_asymmetric_key() 141 int ret; in verify_signature() local 154 ret = subtype->verify_signature(key, sig); in verify_signature() 156 pr_devel("<==%s() = %d\n", __func__, ret); in verify_signature() 157 return ret; in verify_signature()
|
D | asymmetric_type.c | 239 int ret; in asymmetric_key_hex_to_key_id() local 251 ret = __asymmetric_key_hex_to_key_id(id, match_id, asciihexlen / 2); in asymmetric_key_hex_to_key_id() 252 if (ret < 0) { in asymmetric_key_hex_to_key_id() 405 int ret; in asymmetric_key_preparse() local 414 ret = -EBADMSG; in asymmetric_key_preparse() 418 ret = parser->parse(prep); in asymmetric_key_preparse() 419 if (ret != -EBADMSG) { in asymmetric_key_preparse() 421 ret); in asymmetric_key_preparse() 427 pr_devel("<==%s() = %d\n", __func__, ret); in asymmetric_key_preparse() 428 return ret; in asymmetric_key_preparse() [all …]
|