Home
last modified time | relevance | path

Searched refs:ret (Results 1 – 25 of 59) 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()
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 …]
Dalgapi.c303 int ret = -EAGAIN; in __crypto_register_alg() local
310 ret = -EEXIST; in __crypto_register_alg()
353 larval = ERR_PTR(ret); in __crypto_register_alg()
473 int ret; in crypto_unregister_alg() local
477 ret = crypto_remove_alg(alg, &list); in crypto_unregister_alg()
480 if (WARN(ret, "Algorithm %s is not registered", alg->cra_driver_name)) in crypto_unregister_alg()
495 int i, ret; in crypto_register_algs() local
498 ret = crypto_register_alg(&algs[i]); in crypto_register_algs()
499 if (ret) in crypto_register_algs()
509 return ret; in crypto_register_algs()
[all …]
Decdsa.c149 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 …]
Decdh.c58 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 …]
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()
/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.c158 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 …]
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.c226 int ret; in asymmetric_key_hex_to_key_id() local
238 ret = __asymmetric_key_hex_to_key_id(id, match_id, asciihexlen / 2); in asymmetric_key_hex_to_key_id()
239 if (ret < 0) { in asymmetric_key_hex_to_key_id()
374 int ret; in asymmetric_key_preparse() local
383 ret = -EBADMSG; in asymmetric_key_preparse()
387 ret = parser->parse(prep); in asymmetric_key_preparse()
388 if (ret != -EBADMSG) { in asymmetric_key_preparse()
390 ret); in asymmetric_key_preparse()
396 pr_devel("<==%s() = %d\n", __func__, ret); in asymmetric_key_preparse()
397 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