Home
last modified time | relevance | path

Searched refs:ret (Results 1 – 25 of 56) sorted by relevance

123

/crypto/
Ddeflate.c44 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 …]
Dtcrypt.c140 static inline int do_one_aead_op(struct aead_request *req, int ret) in do_one_aead_op() argument
144 return crypto_wait_req(ret, wait); in do_one_aead_op()
188 int ret = 0; in test_mb_aead_jiffies() local
197 ret = do_mult_aead_op(data, enc, num_mb, rc); in test_mb_aead_jiffies()
198 if (ret) in test_mb_aead_jiffies()
207 return ret; in test_mb_aead_jiffies()
214 int ret = 0; in test_mb_aead_cycles() local
224 ret = do_mult_aead_op(data, enc, num_mb, rc); in test_mb_aead_cycles()
225 if (ret) in test_mb_aead_cycles()
234 ret = do_mult_aead_op(data, enc, num_mb, rc); in test_mb_aead_cycles()
[all …]
Ddrbg.c246 int ret = 0; in drbg_fips_continuous_test() local
265 ret = memcmp(drbg->prev, entropy, entropylen); in drbg_fips_continuous_test()
266 if (!ret) in drbg_fips_continuous_test()
323 int ret = 0; in drbg_ctr_bcc() local
340 ret = drbg_kcapi_sym(drbg, out, &data); in drbg_ctr_bcc()
341 if (ret) in drbg_ctr_bcc()
342 return ret; in drbg_ctr_bcc()
352 ret = drbg_kcapi_sym(drbg, out, &data); in drbg_ctr_bcc()
354 return ret; in drbg_ctr_bcc()
401 int ret = -EFAULT; in drbg_ctr_df() local
[all …]
Dzstd.c34 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 …]
Ddh.c127 int ret; in dh_is_pubkey_valid() local
132 ret = mpi_powm(val, y, ctx->q, ctx->p); in dh_is_pubkey_valid()
134 if (ret) { in dh_is_pubkey_valid()
136 return ret; in dh_is_pubkey_valid()
139 ret = mpi_cmp_ui(val, 1); in dh_is_pubkey_valid()
143 if (ret != 0) in dh_is_pubkey_valid()
155 int ret = 0; in dh_compute_value() local
162 ret = -EINVAL; in dh_compute_value()
169 ret = -EINVAL; in dh_compute_value()
172 ret = dh_is_pubkey_valid(ctx, base); in dh_compute_value()
[all …]
Drsa.c59 int ret = 0; in rsa_enc() local
66 ret = -EINVAL; in rsa_enc()
70 ret = -ENOMEM; in rsa_enc()
75 ret = _rsa_enc(pkey, c, m); in rsa_enc()
76 if (ret) in rsa_enc()
79 ret = mpi_write_to_sgl(c, req->dst, req->dst_len, &sign); in rsa_enc()
80 if (ret) in rsa_enc()
84 ret = -EBADMSG; in rsa_enc()
90 return ret; in rsa_enc()
98 int ret = 0; in rsa_dec() local
[all …]
Djitterentropy-kcapi.c117 int ret = 0; in jent_kcapi_init() local
121 ret = -ENOMEM; in jent_kcapi_init()
124 return ret; in jent_kcapi_init()
143 int ret = 0; in jent_kcapi_random() local
149 ret = -EFAULT; in jent_kcapi_random()
153 ret = jent_read_entropy(rng->entropy_collector, rdata, dlen); in jent_kcapi_random()
156 if (ret < -1) { in jent_kcapi_random()
158 (ret == -2) ? "Repetition Count Test" : in jent_kcapi_random()
163 ret = -EAGAIN; in jent_kcapi_random()
168 if (ret == -1) in jent_kcapi_random()
[all …]
Dcrypto_engine.c30 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()
76 int ret; in crypto_pump_requests() local
143 ret = engine->prepare_crypt_hardware(engine); in crypto_pump_requests()
144 if (ret) { in crypto_pump_requests()
153 ret = enginectx->op.prepare_request(engine, async_req); in crypto_pump_requests()
154 if (ret) { in crypto_pump_requests()
156 ret); in crypto_pump_requests()
162 ret = -EINVAL; in crypto_pump_requests()
[all …]
Dalgapi.c223 int ret = -EAGAIN; in __crypto_register_alg() local
233 ret = -EEXIST; in __crypto_register_alg()
259 ret = -ENOENT; in __crypto_register_alg()
280 larval = ERR_PTR(ret); in __crypto_register_alg()
450 int ret; in crypto_unregister_alg() local
454 ret = crypto_remove_alg(alg, &list); in crypto_unregister_alg()
457 if (WARN(ret, "Algorithm %s is not registered", alg->cra_driver_name)) in crypto_unregister_alg()
472 int i, ret; in crypto_register_algs() local
475 ret = crypto_register_alg(&algs[i]); in crypto_register_algs()
476 if (ret) in crypto_register_algs()
[all …]
Daead.c26 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 …]
Dscompress.c110 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 …]
Dpcrypt.c81 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 …]
D842.c124 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()
Dlz4hc.c135 int ret; in lz4hc_mod_init() local
137 ret = crypto_register_alg(&alg_lz4hc); in lz4hc_mod_init()
138 if (ret) in lz4hc_mod_init()
139 return ret; in lz4hc_mod_init()
141 ret = crypto_register_scomp(&scomp); in lz4hc_mod_init()
142 if (ret) { in lz4hc_mod_init()
144 return ret; in lz4hc_mod_init()
147 return ret; in lz4hc_mod_init()
Dlz4.c134 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()
Dlzo-rle.c137 int ret; in lzorle_mod_init() local
139 ret = crypto_register_alg(&alg); in lzorle_mod_init()
140 if (ret) in lzorle_mod_init()
141 return ret; in lzorle_mod_init()
143 ret = crypto_register_scomp(&scomp); in lzorle_mod_init()
144 if (ret) { in lzorle_mod_init()
146 return ret; in lzorle_mod_init()
149 return ret; in lzorle_mod_init()
/crypto/asymmetric_keys/
Dasym_tpm.c41 int ret; in tpm_loadkey2() local
46 ret = oiap(tb, &authhandle, enonce); in tpm_loadkey2()
47 if (ret < 0) { in tpm_loadkey2()
48 pr_info("oiap failed (%d)\n", ret); in tpm_loadkey2()
49 return ret; in tpm_loadkey2()
53 ret = tpm_get_random(NULL, nonceodd, TPM_NONCE_SIZE); in tpm_loadkey2()
54 if (ret < 0) { in tpm_loadkey2()
55 pr_info("tpm_get_random failed (%d)\n", ret); in tpm_loadkey2()
56 return ret; in tpm_loadkey2()
60 ret = TSS_authhmac(authdata, keyauth, SHA1_DIGEST_SIZE, enonce, in tpm_loadkey2()
[all …]
Dpublic_key.c112 int ret, len; in software_key_query() local
114 ret = software_key_determine_akcipher(params->encoding, in software_key_query()
117 if (ret < 0) in software_key_query()
118 return ret; in software_key_query()
124 ret = -ENOMEM; in software_key_query()
136 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_query()
138 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_query()
139 if (ret < 0) in software_key_query()
153 ret = 0; in software_key_query()
159 pr_devel("<==%s() = %d\n", __func__, ret); in software_key_query()
[all …]
Dpkcs7_verify.c29 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 …]
Dverify_pefile.c250 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 …]
Dx509_public_key.c29 int ret; in x509_get_sig_params() local
69 ret = -ENOMEM; in x509_get_sig_params()
80 ret = crypto_shash_digest(desc, cert->tbs, cert->tbs_size, sig->digest); in x509_get_sig_params()
81 if (ret < 0) in x509_get_sig_params()
84 ret = is_hash_blacklisted(sig->digest, sig->digest_size, "tbs"); in x509_get_sig_params()
85 if (ret == -EKEYREJECTED) { in x509_get_sig_params()
89 ret = 0; in x509_get_sig_params()
96 pr_devel("<==%s() = %d\n", __func__, ret); in x509_get_sig_params()
97 return ret; in x509_get_sig_params()
106 int ret = 0; in x509_check_for_self_signed() local
[all …]
Drestrict.c32 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
204 ret = key_validate(key); in key_or_keyring_common()
205 if (ret == 0) in key_or_keyring_common()
[all …]
Dpkcs7_trust.c29 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()
Dasymmetric_type.c224 int ret; in asymmetric_key_hex_to_key_id() local
236 ret = __asymmetric_key_hex_to_key_id(id, match_id, asciihexlen / 2); in asymmetric_key_hex_to_key_id()
237 if (ret < 0) { in asymmetric_key_hex_to_key_id()
372 int ret; in asymmetric_key_preparse() local
381 ret = -EBADMSG; in asymmetric_key_preparse()
385 ret = parser->parse(prep); in asymmetric_key_preparse()
386 if (ret != -EBADMSG) { in asymmetric_key_preparse()
388 ret); in asymmetric_key_preparse()
394 pr_devel("<==%s() = %d\n", __func__, ret); in asymmetric_key_preparse()
395 return ret; in asymmetric_key_preparse()
[all …]
Dsignature.c47 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()

123