Home
last modified time | relevance | path

Searched refs:err (Results 1 – 25 of 66) sorted by relevance

123

/crypto/
Dfips140-selftests.c177 fips_handle_alloc_tfm_error(const char *impl, int err) in fips_handle_alloc_tfm_error() argument
179 if (err == -ENOENT) { in fips_handle_alloc_tfm_error()
193 pr_err("failed to allocate %s tfm: %d\n", impl, err); in fips_handle_alloc_tfm_error()
194 return err; in fips_handle_alloc_tfm_error()
203 int err; in fips_test_aes_library() local
208 err = aes_expandkey(&ctx, vec->key, vec->key_size); in fips_test_aes_library()
209 if (err) { in fips_test_aes_library()
210 pr_err("aes_expandkey() failed: %d\n", err); in fips_test_aes_library()
211 return err; in fips_test_aes_library()
214 err = fips_check_result(block, vec->ciphertext, AES_BLOCK_SIZE, in fips_test_aes_library()
[all …]
Drsa-pkcs1pad.c111 int err; in pkcs1pad_set_pub_key() local
115 err = crypto_akcipher_set_pub_key(ctx->child, key, keylen); in pkcs1pad_set_pub_key()
116 if (err) in pkcs1pad_set_pub_key()
117 return err; in pkcs1pad_set_pub_key()
120 err = crypto_akcipher_maxsize(ctx->child); in pkcs1pad_set_pub_key()
121 if (err > PAGE_SIZE) in pkcs1pad_set_pub_key()
124 ctx->key_size = err; in pkcs1pad_set_pub_key()
132 int err; in pkcs1pad_set_priv_key() local
136 err = crypto_akcipher_set_priv_key(ctx->child, key, keylen); in pkcs1pad_set_priv_key()
137 if (err) in pkcs1pad_set_priv_key()
[all …]
Dalgif_hash.c71 int err; in hash_sendmsg() local
81 err = crypto_wait_req(crypto_ahash_init(&ctx->req), &ctx->wait); in hash_sendmsg()
82 if (err) in hash_sendmsg()
96 err = copied ? 0 : len; in hash_sendmsg()
102 err = crypto_wait_req(crypto_ahash_update(&ctx->req), in hash_sendmsg()
105 if (err) in hash_sendmsg()
112 err = 0; in hash_sendmsg()
116 err = hash_alloc_result(sk, ctx); in hash_sendmsg()
117 if (err) in hash_sendmsg()
121 err = crypto_wait_req(crypto_ahash_final(&ctx->req), in hash_sendmsg()
[all …]
Dxts.c47 int err; in xts_setkey() local
49 err = xts_verify_key(parent, key, keylen); in xts_setkey()
50 if (err) in xts_setkey()
51 return err; in xts_setkey()
64 err = crypto_cipher_setkey(tweak, key + keylen, keylen); in xts_setkey()
65 if (err) in xts_setkey()
66 return err; in xts_setkey()
91 int err; in xts_xor_tweak() local
98 err = skcipher_walk_virt(&w, req, false); in xts_xor_tweak()
127 err = skcipher_walk_done(&w, avail); in xts_xor_tweak()
[all …]
Dchacha20poly1305.c70 static inline void async_done_continue(struct aead_request *req, int err, in async_done_continue() argument
73 if (!err) { in async_done_continue()
77 err = cont(req); in async_done_continue()
80 if (err != -EINPROGRESS && err != -EBUSY) in async_done_continue()
81 aead_request_complete(req, err); in async_done_continue()
118 static void chacha_decrypt_done(struct crypto_async_request *areq, int err) in chacha_decrypt_done() argument
120 async_done_continue(areq->data, err, poly_verify_tag); in chacha_decrypt_done()
129 int err; in chacha_decrypt() local
146 err = crypto_skcipher_decrypt(&creq->req); in chacha_decrypt()
147 if (err) in chacha_decrypt()
[all …]
Dahash.c79 int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) in crypto_hash_walk_done() argument
85 if (walk->entrylen && (walk->offset & alignmask) && !err) { in crypto_hash_walk_done()
101 if (err) in crypto_hash_walk_done()
102 return err; in crypto_hash_walk_done()
176 int err; in crypto_ahash_setkey() local
179 err = ahash_setkey_unaligned(tfm, key, keylen); in crypto_ahash_setkey()
181 err = tfm->setkey(tfm, key, keylen); in crypto_ahash_setkey()
183 if (unlikely(err)) { in crypto_ahash_setkey()
185 return err; in crypto_ahash_setkey()
256 static void ahash_restore_req(struct ahash_request *req, int err) in ahash_restore_req() argument
[all …]
Dgcm.c107 int err; in crypto_gcm_setkey() local
112 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_gcm_setkey()
113 if (err) in crypto_gcm_setkey()
114 return err; in crypto_gcm_setkey()
131 err = crypto_wait_req(crypto_skcipher_encrypt(&data->req), in crypto_gcm_setkey()
134 if (err) in crypto_gcm_setkey()
140 err = crypto_ahash_setkey(ghash, (u8 *)&data->hash, sizeof(be128)); in crypto_gcm_setkey()
143 return err; in crypto_gcm_setkey()
200 static void gcm_hash_len_done(struct crypto_async_request *areq, int err);
249 static void gcm_hash_len_done(struct crypto_async_request *areq, int err) in gcm_hash_len_done() argument
[all …]
Dccm.c93 int err; in crypto_ccm_setkey() local
98 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_ccm_setkey()
99 if (err) in crypto_ccm_setkey()
100 return err; in crypto_ccm_setkey()
179 int ilen, err; in crypto_ccm_auth() local
182 err = format_input(odata, req, cryptlen); in crypto_ccm_auth()
183 if (err) in crypto_ccm_auth()
202 err = crypto_ahash_init(ahreq); in crypto_ccm_auth()
203 if (err) in crypto_ccm_auth()
205 err = crypto_ahash_update(ahreq); in crypto_ccm_auth()
[all …]
Dtestmgr.c751 int err; in build_cipher_test_sglists() local
754 err = build_test_sglist(&tsgls->src, cfg->src_divs, alignmask, in build_cipher_test_sglists()
759 if (err) in build_cipher_test_sglists()
760 return err; in build_cipher_test_sglists()
805 int err; \
807 err = prepare_keybuf((key), (ksize), (cfg), (alignmask), \
809 if (err == 0) { \
810 err = setkey_f((tfm), keyptr, (ksize)); \
813 err; \
1161 static inline int check_shash_op(const char *op, int err, in check_shash_op() argument
[all …]
Dauthenc.c40 static void authenc_request_complete(struct aead_request *req, int err) in authenc_request_complete() argument
42 if (err != -EINPROGRESS) in authenc_request_complete()
43 aead_request_complete(req, err); in authenc_request_complete()
91 int err = -EINVAL; in crypto_authenc_setkey() local
99 err = crypto_ahash_setkey(auth, keys.authkey, keys.authkeylen); in crypto_authenc_setkey()
100 if (err) in crypto_authenc_setkey()
106 err = crypto_skcipher_setkey(enc, keys.enckey, keys.enckeylen); in crypto_authenc_setkey()
109 return err; in crypto_authenc_setkey()
112 static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err) in authenc_geniv_ahash_done() argument
121 if (err) in authenc_geniv_ahash_done()
[all …]
Dauthencesn.c43 static void authenc_esn_request_complete(struct aead_request *req, int err) in authenc_esn_request_complete() argument
45 if (err != -EINPROGRESS) in authenc_esn_request_complete()
46 aead_request_complete(req, err); in authenc_esn_request_complete()
65 int err = -EINVAL; in crypto_authenc_esn_setkey() local
73 err = crypto_ahash_setkey(auth, keys.authkey, keys.authkeylen); in crypto_authenc_esn_setkey()
74 if (err) in crypto_authenc_esn_setkey()
80 err = crypto_skcipher_setkey(enc, keys.enckey, keys.enckeylen); in crypto_authenc_esn_setkey()
83 return err; in crypto_authenc_esn_setkey()
111 int err) in authenc_esn_geniv_ahash_done() argument
115 err = err ?: crypto_authenc_esn_genicv_tail(req, 0); in authenc_esn_geniv_ahash_done()
[all …]
Dalgif_skcipher.c61 int err = 0; in _skcipher_recvmsg() local
65 err = af_alg_wait_for_data(sk, flags, bs); in _skcipher_recvmsg()
66 if (err) in _skcipher_recvmsg()
67 return err; in _skcipher_recvmsg()
77 err = af_alg_get_rsgl(sk, msg, flags, areq, ctx->used, &len); in _skcipher_recvmsg()
78 if (err) in _skcipher_recvmsg()
99 err = -ENOMEM; in _skcipher_recvmsg()
121 err = ctx->enc ? in _skcipher_recvmsg()
126 if (err == -EINPROGRESS) in _skcipher_recvmsg()
136 err = crypto_wait_req(ctx->enc ? in _skcipher_recvmsg()
[all …]
Dfips140-alg-registration.c194 int err = 0; \
197 err = fips140_store_init_function(base_alg, alg->field);\
198 if (err == 0) \
201 err; \
309 int err; in fips140_crypto_register_algs() local
312 err = fips140_prepare_alg(&algs[i]); in fips140_crypto_register_algs()
313 if (err) in fips140_crypto_register_algs()
314 return err; in fips140_crypto_register_algs()
323 int err; in fips140_crypto_register_aeads() local
326 err = fips140_prepare_aead_alg(&algs[i]); in fips140_crypto_register_aeads()
[all …]
Dadiantum.c129 int err; in adiantum_setkey() local
136 err = crypto_skcipher_setkey(tctx->streamcipher, key, keylen); in adiantum_setkey()
137 if (err) in adiantum_setkey()
138 return err; in adiantum_setkey()
154 err = crypto_wait_req(crypto_skcipher_encrypt(&data->req), &data->wait); in adiantum_setkey()
155 if (err) in adiantum_setkey()
164 err = crypto_cipher_setkey(tctx->blockcipher, keyp, in adiantum_setkey()
166 if (err) in adiantum_setkey()
177 err = crypto_shash_setkey(tctx->hash, keyp, NHPOLY1305_KEY_SIZE); in adiantum_setkey()
182 return err; in adiantum_setkey()
[all …]
Dalgif_aead.c103 int err = 0; in _aead_recvmsg() local
110 err = af_alg_wait_for_data(sk, flags, 0); in _aead_recvmsg()
111 if (err) in _aead_recvmsg()
112 return err; in _aead_recvmsg()
159 err = af_alg_get_rsgl(sk, msg, flags, areq, outlen, &usedpages); in _aead_recvmsg()
160 if (err) in _aead_recvmsg()
174 err = -EINVAL; in _aead_recvmsg()
195 err = -EFAULT; in _aead_recvmsg()
226 err = crypto_aead_copy_sgl(null_tfm, tsgl_src, in _aead_recvmsg()
228 if (err) in _aead_recvmsg()
[all …]
Dessiv.c71 int err; in essiv_skcipher_setkey() local
77 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen); in essiv_skcipher_setkey()
78 if (err) in essiv_skcipher_setkey()
79 return err; in essiv_skcipher_setkey()
81 err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt); in essiv_skcipher_setkey()
82 if (err) in essiv_skcipher_setkey()
83 return err; in essiv_skcipher_setkey()
100 int err; in essiv_aead_setkey() local
105 err = crypto_aead_setkey(tctx->u.aead, key, keylen); in essiv_aead_setkey()
106 if (err) in essiv_aead_setkey()
[all …]
Dgeniv.c50 int err; in aead_geniv_alloc() local
52 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask); in aead_geniv_alloc()
53 if (err) in aead_geniv_alloc()
54 return ERR_PTR(err); in aead_geniv_alloc()
62 err = crypto_grab_aead(spawn, aead_crypto_instance(inst), in aead_geniv_alloc()
64 if (err) in aead_geniv_alloc()
72 err = -EINVAL; in aead_geniv_alloc()
76 err = -ENAMETOOLONG; in aead_geniv_alloc()
104 inst = ERR_PTR(err); in aead_geniv_alloc()
114 int err; in aead_init_geniv() local
[all …]
Daf_alg.c62 int err = -EEXIST; in af_alg_register_type() local
71 err = -ENOMEM; in af_alg_register_type()
80 err = 0; in af_alg_register_type()
85 return err; in af_alg_register_type()
92 int err = -ENOENT; in af_alg_unregister_type() local
101 err = 0; in af_alg_unregister_type()
106 return err; in af_alg_unregister_type()
153 int err; in alg_bind() local
187 err = -EBUSY; in alg_bind()
195 err = 0; in alg_bind()
[all …]
Dlrw.c73 int err, bsize = LRW_BLOCK_SIZE; in lrw_setkey() local
81 err = crypto_skcipher_setkey(child, key, keylen - bsize); in lrw_setkey()
82 if (err) in lrw_setkey()
83 return err; in lrw_setkey()
150 int err; in lrw_xor_tweak() local
158 err = skcipher_walk_virt(&w, req, false); in lrw_xor_tweak()
159 if (err) in lrw_xor_tweak()
160 return err; in lrw_xor_tweak()
192 err = skcipher_walk_done(&w, avail); in lrw_xor_tweak()
195 return err; in lrw_xor_tweak()
[all …]
Dseqiv.c21 static void seqiv_aead_encrypt_complete2(struct aead_request *req, int err) in seqiv_aead_encrypt_complete2() argument
26 if (err == -EINPROGRESS || err == -EBUSY) in seqiv_aead_encrypt_complete2()
29 if (err) in seqiv_aead_encrypt_complete2()
40 int err) in seqiv_aead_encrypt_complete() argument
44 seqiv_aead_encrypt_complete2(req, err); in seqiv_aead_encrypt_complete()
45 aead_request_complete(req, err); in seqiv_aead_encrypt_complete()
57 int err; in seqiv_aead_encrypt() local
78 err = crypto_skcipher_encrypt(nreq); in seqiv_aead_encrypt()
79 if (err) in seqiv_aead_encrypt()
80 return err; in seqiv_aead_encrypt()
[all …]
Dcryptd.c133 int err; in cryptd_enqueue_request() local
139 err = crypto_enqueue_request(&cpu_queue->queue, request); in cryptd_enqueue_request()
143 if (err == -ENOSPC) in cryptd_enqueue_request()
156 return err; in cryptd_enqueue_request()
240 static void cryptd_skcipher_complete(struct skcipher_request *req, int err) in cryptd_skcipher_complete() argument
248 rctx->complete(&req->base, err); in cryptd_skcipher_complete()
251 if (err != -EINPROGRESS && refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_skcipher_complete()
256 int err) in cryptd_skcipher_encrypt() argument
265 if (unlikely(err == -EINPROGRESS)) in cryptd_skcipher_encrypt()
274 err = crypto_skcipher_encrypt(subreq); in cryptd_skcipher_encrypt()
[all …]
Dpcrypt.c66 static void pcrypt_aead_done(struct crypto_async_request *areq, int err) in pcrypt_aead_done() argument
72 padata->info = err; in pcrypt_aead_done()
94 int err; in pcrypt_aead_encrypt() local
117 err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu); in pcrypt_aead_encrypt()
118 if (!err) in pcrypt_aead_encrypt()
120 if (err == -EBUSY) in pcrypt_aead_encrypt()
123 return err; in pcrypt_aead_encrypt()
143 int err; in pcrypt_aead_decrypt() local
166 err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu); in pcrypt_aead_decrypt()
167 if (!err) in pcrypt_aead_decrypt()
[all …]
Ddes_generic.c23 int err; in des_setkey() local
25 err = des_expand_key(dctx, key, keylen); in des_setkey()
26 if (err == -ENOKEY) { in des_setkey()
28 err = -EINVAL; in des_setkey()
30 err = 0; in des_setkey()
32 if (err) in des_setkey()
34 return err; in des_setkey()
55 int err; in des3_ede_setkey() local
57 err = des3_ede_expand_key(dctx, key, keylen); in des3_ede_setkey()
58 if (err == -ENOKEY) { in des3_ede_setkey()
[all …]
Drng.c35 int err; in crypto_rng_reset() local
42 err = get_random_bytes_wait(buf, slen); in crypto_rng_reset()
43 if (err) in crypto_rng_reset()
49 err = crypto_rng_alg(tfm)->seed(tfm, seed, slen); in crypto_rng_reset()
50 crypto_stats_rng_seed(alg, err); in crypto_rng_reset()
53 return err; in crypto_rng_reset()
119 int err; in crypto_get_default_rng() local
124 err = PTR_ERR(rng); in crypto_get_default_rng()
128 err = crypto_rng_reset(rng, NULL, crypto_rng_seedsize(rng)); in crypto_get_default_rng()
129 if (err) { in crypto_get_default_rng()
[all …]
Dcbc.c77 int err; in crypto_cbc_encrypt() local
79 err = skcipher_walk_virt(&walk, req, false); in crypto_cbc_encrypt()
83 err = crypto_cbc_encrypt_inplace(&walk, skcipher); in crypto_cbc_encrypt()
85 err = crypto_cbc_encrypt_segment(&walk, skcipher); in crypto_cbc_encrypt()
86 err = skcipher_walk_done(&walk, err); in crypto_cbc_encrypt()
89 return err; in crypto_cbc_encrypt()
159 int err; in crypto_cbc_decrypt() local
161 err = skcipher_walk_virt(&walk, req, false); in crypto_cbc_decrypt()
165 err = crypto_cbc_decrypt_inplace(&walk, skcipher); in crypto_cbc_decrypt()
167 err = crypto_cbc_decrypt_segment(&walk, skcipher); in crypto_cbc_decrypt()
[all …]

123