/crypto/ |
D | algif_hash.c | 76 int err; in hash_sendmsg() local 86 err = af_alg_wait_for_completion(crypto_ahash_init(&ctx->req), in hash_sendmsg() 88 if (err) in hash_sendmsg() 102 err = copied ? 0 : len; in hash_sendmsg() 108 err = af_alg_wait_for_completion(crypto_ahash_update(&ctx->req), in hash_sendmsg() 111 if (err) in hash_sendmsg() 118 err = 0; in hash_sendmsg() 122 err = hash_alloc_result(sk, ctx); in hash_sendmsg() 123 if (err) in hash_sendmsg() 127 err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req), in hash_sendmsg() [all …]
|
D | rsa-pkcs1pad.c | 113 int err; in pkcs1pad_set_pub_key() local 117 err = crypto_akcipher_set_pub_key(ctx->child, key, keylen); in pkcs1pad_set_pub_key() 118 if (err) in pkcs1pad_set_pub_key() 119 return err; in pkcs1pad_set_pub_key() 122 err = crypto_akcipher_maxsize(ctx->child); in pkcs1pad_set_pub_key() 123 if (err < 0) in pkcs1pad_set_pub_key() 124 return err; in pkcs1pad_set_pub_key() 126 if (err > PAGE_SIZE) in pkcs1pad_set_pub_key() 129 ctx->key_size = err; in pkcs1pad_set_pub_key() 137 int err; in pkcs1pad_set_priv_key() local [all …]
|
D | chacha20poly1305.c | 76 static inline void async_done_continue(struct aead_request *req, int err, in async_done_continue() argument 79 if (!err) in async_done_continue() 80 err = cont(req); in async_done_continue() 82 if (err != -EINPROGRESS && err != -EBUSY) in async_done_continue() 83 aead_request_complete(req, err); in async_done_continue() 120 static void chacha_decrypt_done(struct crypto_async_request *areq, int err) in chacha_decrypt_done() argument 122 async_done_continue(areq->data, err, poly_verify_tag); in chacha_decrypt_done() 131 int err; in chacha_decrypt() local 152 err = crypto_skcipher_decrypt(&creq->req); in chacha_decrypt() 153 if (err) in chacha_decrypt() [all …]
|
D | ahash.c | 85 int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) in crypto_hash_walk_done() argument 92 if (nbytes && walk->offset & alignmask && !err) { in crypto_hash_walk_done() 115 if (err) in crypto_hash_walk_done() 116 return err; in crypto_hash_walk_done() 196 int err; in crypto_ahash_setkey() local 199 err = ahash_setkey_unaligned(tfm, key, keylen); in crypto_ahash_setkey() 201 err = tfm->setkey(tfm, key, keylen); in crypto_ahash_setkey() 203 if (err) in crypto_ahash_setkey() 204 return err; in crypto_ahash_setkey() 280 static void ahash_restore_req(struct ahash_request *req, int err) in ahash_restore_req() argument [all …]
|
D | af_alg.c | 65 int err = -EEXIST; in af_alg_register_type() local 74 err = -ENOMEM; in af_alg_register_type() 83 err = 0; in af_alg_register_type() 88 return err; in af_alg_register_type() 95 int err = -ENOENT; in af_alg_unregister_type() local 104 err = 0; in af_alg_unregister_type() 109 return err; in af_alg_unregister_type() 158 int err; in alg_bind() local 188 err = -EBUSY; in alg_bind() 196 err = 0; in alg_bind() [all …]
|
D | ccm.c | 88 int err = 0; in crypto_ccm_setkey() local 93 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_ccm_setkey() 96 if (err) in crypto_ccm_setkey() 102 err = crypto_cipher_setkey(tfm, key, keylen); in crypto_ccm_setkey() 107 return err; in crypto_ccm_setkey() 261 int err; in crypto_ccm_auth() local 264 err = format_input(odata, req, cryptlen); in crypto_ccm_auth() 265 if (err) in crypto_ccm_auth() 284 return err; in crypto_ccm_auth() 287 static void crypto_ccm_encrypt_done(struct crypto_async_request *areq, int err) in crypto_ccm_encrypt_done() argument [all …]
|
D | algif_aead.c | 149 int err = -ERESTARTSYS; in aead_wait_for_data() local 162 err = 0; in aead_wait_for_data() 170 return err; in aead_wait_for_data() 206 int err = -EINVAL; in aead_sendmsg() local 209 err = af_alg_cmsg_send(msg, &con); in aead_sendmsg() 210 if (err) in aead_sendmsg() 211 return err; in aead_sendmsg() 250 err = memcpy_from_msg(page_address(sg_page(sg)) + in aead_sendmsg() 253 if (err) in aead_sendmsg() 269 err = -EMSGSIZE; in aead_sendmsg() [all …]
|
D | gcm.c | 82 int err; member 101 static void crypto_gcm_setkey_done(struct crypto_async_request *req, int err) in crypto_gcm_setkey_done() argument 105 if (err == -EINPROGRESS) in crypto_gcm_setkey_done() 108 result->err = err; in crypto_gcm_setkey_done() 127 int err; in crypto_gcm_setkey() local 132 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_gcm_setkey() 135 if (err) in crypto_gcm_setkey() 136 return err; in crypto_gcm_setkey() 153 err = crypto_skcipher_encrypt(&data->req); in crypto_gcm_setkey() 154 if (err == -EINPROGRESS || err == -EBUSY) { in crypto_gcm_setkey() [all …]
|
D | authenc.c | 45 static void authenc_request_complete(struct aead_request *req, int err) in authenc_request_complete() argument 47 if (err != -EINPROGRESS) in authenc_request_complete() 48 aead_request_complete(req, err); in authenc_request_complete() 88 int err = -EINVAL; in crypto_authenc_setkey() local 96 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() 111 return err; in crypto_authenc_setkey() 118 static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err) in authenc_geniv_ahash_done() argument 127 if (err) in authenc_geniv_ahash_done() [all …]
|
D | authencesn.c | 48 static void authenc_esn_request_complete(struct aead_request *req, int err) in authenc_esn_request_complete() argument 50 if (err != -EINPROGRESS) in authenc_esn_request_complete() 51 aead_request_complete(req, err); in authenc_esn_request_complete() 70 int err = -EINVAL; in crypto_authenc_esn_setkey() local 78 err = crypto_ahash_setkey(auth, keys.authkey, keys.authkeylen); in crypto_authenc_esn_setkey() 82 if (err) in crypto_authenc_esn_setkey() 88 err = crypto_skcipher_setkey(enc, keys.enckey, keys.enckeylen); in crypto_authenc_esn_setkey() 93 return err; in crypto_authenc_esn_setkey() 125 int err) in authenc_esn_geniv_ahash_done() argument 129 err = err ?: crypto_authenc_esn_genicv_tail(req, 0); in authenc_esn_geniv_ahash_done() [all …]
|
D | cryptd.c | 123 int cpu, err; in cryptd_enqueue_request() local 131 err = crypto_enqueue_request(&cpu_queue->queue, request); in cryptd_enqueue_request() 136 if (err == -EBUSY && !may_backlog) in cryptd_enqueue_request() 150 return err; in cryptd_enqueue_request() 211 int err; in cryptd_blkcipher_setkey() local 216 err = crypto_blkcipher_setkey(child, key, keylen); in cryptd_blkcipher_setkey() 219 return err; in cryptd_blkcipher_setkey() 224 int err, in cryptd_blkcipher_crypt() argument 238 if (unlikely(err == -EINPROGRESS)) in cryptd_blkcipher_crypt() 245 err = crypt(&desc, req->dst, req->src, req->nbytes); in cryptd_blkcipher_crypt() [all …]
|
D | algif_skcipher.c | 100 static void skcipher_async_cb(struct crypto_async_request *req, int err) in skcipher_async_cb() argument 108 iocb->ki_complete(iocb, err, err); in skcipher_async_cb() 211 int err = -ERESTARTSYS; in skcipher_wait_for_wmem() local 224 err = 0; in skcipher_wait_for_wmem() 230 return err; in skcipher_wait_for_wmem() 256 int err = -ERESTARTSYS; in skcipher_wait_for_data() local 270 err = 0; in skcipher_wait_for_data() 278 return err; in skcipher_wait_for_data() 316 int err; in skcipher_sendmsg() local 320 err = af_alg_cmsg_send(msg, &con); in skcipher_sendmsg() [all …]
|
D | mcryptd.c | 104 int cpu, err; in mcryptd_enqueue_request() local 112 err = crypto_enqueue_request(&cpu_queue->queue, request); in mcryptd_enqueue_request() 118 return err; in mcryptd_enqueue_request() 226 int err; in mcryptd_alloc_instance() local 234 err = -ENAMETOOLONG; in mcryptd_alloc_instance() 250 p = ERR_PTR(err); in mcryptd_alloc_instance() 303 int err; in mcryptd_hash_setkey() local 308 err = crypto_ahash_setkey(child, key, keylen); in mcryptd_hash_setkey() 311 return err; in mcryptd_hash_setkey() 332 static void mcryptd_hash_init(struct crypto_async_request *req_async, int err) in mcryptd_hash_init() argument [all …]
|
D | aead.c | 66 int err; in crypto_aead_setauthsize() local 72 err = crypto_aead_alg(tfm)->setauthsize(tfm, authsize); in crypto_aead_setauthsize() 73 if (err) in crypto_aead_setauthsize() 74 return err; in crypto_aead_setauthsize() 201 int err; in aead_geniv_alloc() local 224 err = crypto_grab_aead(spawn, name, type, mask); in aead_geniv_alloc() 225 if (err) in aead_geniv_alloc() 233 err = -EINVAL; in aead_geniv_alloc() 237 err = -ENAMETOOLONG; in aead_geniv_alloc() 266 inst = ERR_PTR(err); in aead_geniv_alloc() [all …]
|
D | algapi.c | 202 goto err; in __crypto_register_alg() 213 goto err; in __crypto_register_alg() 220 goto err; in __crypto_register_alg() 226 goto err; in __crypto_register_alg() 252 err: in __crypto_register_alg() 257 void crypto_alg_tested(const char *name, int err) in crypto_alg_tested() argument 275 printk(KERN_ERR "alg: Unexpected test result for %s: %d\n", name, err); in crypto_alg_tested() 281 if (err || list_empty(&alg->cra_list)) in crypto_alg_tested() 350 int err; in crypto_wait_for_test() local 352 err = crypto_probing_notify(CRYPTO_MSG_ALG_REGISTER, larval->adult); in crypto_wait_for_test() [all …]
|
D | seqiv.c | 28 static void seqiv_aead_encrypt_complete2(struct aead_request *req, int err) in seqiv_aead_encrypt_complete2() argument 33 if (err == -EINPROGRESS) in seqiv_aead_encrypt_complete2() 36 if (err) in seqiv_aead_encrypt_complete2() 47 int err) in seqiv_aead_encrypt_complete() argument 51 seqiv_aead_encrypt_complete2(req, err); in seqiv_aead_encrypt_complete() 52 aead_request_complete(req, err); in seqiv_aead_encrypt_complete() 64 int err; in seqiv_aead_encrypt() local 85 err = crypto_skcipher_encrypt(nreq); in seqiv_aead_encrypt() 86 if (err) in seqiv_aead_encrypt() 87 return err; in seqiv_aead_encrypt() [all …]
|
D | api.c | 372 int err = -ENOMEM; in __crypto_alloc_tfm() local 381 err = crypto_init_ops(tfm, type, mask); in __crypto_alloc_tfm() 382 if (err) in __crypto_alloc_tfm() 385 if (!tfm->exit && alg->cra_init && (err = alg->cra_init(tfm))) in __crypto_alloc_tfm() 393 if (err == -EAGAIN) in __crypto_alloc_tfm() 397 tfm = ERR_PTR(err); in __crypto_alloc_tfm() 428 int err; in crypto_alloc_base() local 435 err = PTR_ERR(alg); in crypto_alloc_base() 436 goto err; in crypto_alloc_base() 444 err = PTR_ERR(tfm); in crypto_alloc_base() [all …]
|
D | xts.c | 38 int err; in setkey() local 40 err = xts_check_key(parent, key, keylen); in setkey() 41 if (err) in setkey() 42 return err; in setkey() 52 err = crypto_cipher_setkey(child, key + keylen/2, keylen/2); in setkey() 53 if (err) in setkey() 54 return err; in setkey() 65 err = crypto_cipher_setkey(child, key, keylen/2); in setkey() 66 if (err) in setkey() 67 return err; in setkey() [all …]
|
D | ctr.c | 43 int err; in crypto_ctr_setkey() local 48 err = crypto_cipher_setkey(child, key, keylen); in crypto_ctr_setkey() 52 return err; in crypto_ctr_setkey() 136 int err; in crypto_ctr_crypt() local 139 err = blkcipher_walk_virt_block(desc, &walk, bsize); in crypto_ctr_crypt() 147 err = blkcipher_walk_done(desc, &walk, nbytes); in crypto_ctr_crypt() 152 err = blkcipher_walk_done(desc, &walk, 0); in crypto_ctr_crypt() 155 return err; in crypto_ctr_crypt() 185 int err; in crypto_ctr_alloc() local 187 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER); in crypto_ctr_alloc() [all …]
|
D | cts.c | 79 int err; in crypto_cts_setkey() local 84 err = crypto_skcipher_setkey(child, key, keylen); in crypto_cts_setkey() 87 return err; in crypto_cts_setkey() 90 static void cts_cbc_crypt_done(struct crypto_async_request *areq, int err) in cts_cbc_crypt_done() argument 94 if (err == -EINPROGRESS) in cts_cbc_crypt_done() 97 skcipher_request_complete(req, err); in cts_cbc_crypt_done() 130 static void crypto_cts_encrypt_done(struct crypto_async_request *areq, int err) in crypto_cts_encrypt_done() argument 134 if (err) in crypto_cts_encrypt_done() 137 err = cts_cbc_encrypt(req); in crypto_cts_encrypt_done() 138 if (err == -EINPROGRESS || in crypto_cts_encrypt_done() [all …]
|
D | pcrypt.c | 126 static void pcrypt_aead_done(struct crypto_async_request *areq, int err) in pcrypt_aead_done() argument 132 padata->info = err; in pcrypt_aead_done() 153 int err; in pcrypt_aead_encrypt() local 173 err = pcrypt_do_parallel(padata, &ctx->cb_cpu, &pencrypt); in pcrypt_aead_encrypt() 174 if (!err) in pcrypt_aead_encrypt() 177 return err; in pcrypt_aead_encrypt() 195 int err; in pcrypt_aead_decrypt() local 215 err = pcrypt_do_parallel(padata, &ctx->cb_cpu, &pdecrypt); in pcrypt_aead_decrypt() 216 if (!err) in pcrypt_aead_decrypt() 219 return err; in pcrypt_aead_decrypt() [all …]
|
D | rng.c | 43 int err; in crypto_rng_reset() local 54 err = crypto_rng_alg(tfm)->seed(tfm, seed, slen); in crypto_rng_reset() 57 return err; in crypto_rng_reset() 127 int err; in crypto_get_default_rng() local 132 err = PTR_ERR(rng); in crypto_get_default_rng() 136 err = crypto_rng_reset(rng, NULL, crypto_rng_seedsize(rng)); in crypto_get_default_rng() 137 if (err) { in crypto_get_default_rng() 146 err = 0; in crypto_get_default_rng() 151 return err; in crypto_get_default_rng() 166 int err = -EBUSY; in crypto_del_default_rng() local [all …]
|
D | crypto_user.c | 215 int err = 0; in crypto_report_alg() local 220 err = -EMSGSIZE; in crypto_report_alg() 226 err = crypto_report_one(alg, ualg, skb); in crypto_report_alg() 227 if (err) { in crypto_report_alg() 235 return err; in crypto_report_alg() 245 int err; in crypto_report() local 254 err = -ENOMEM; in crypto_report() 264 err = crypto_report_alg(alg, &info); in crypto_report() 269 if (err) in crypto_report() 270 return err; in crypto_report() [all …]
|
D | shash.c | 41 int err; in shash_setkey_unaligned() local 50 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned() 52 return err; in shash_setkey_unaligned() 60 int err; in crypto_shash_setkey() local 63 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey() 65 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey() 67 if (err) in crypto_shash_setkey() 68 return err; in crypto_shash_setkey() 93 int err; in shash_update_unaligned() local 99 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned() [all …]
|
D | hmac.c | 63 int err; in hmac_setkey() local 65 err = crypto_shash_digest(shash, inkey, keylen, ipad); in hmac_setkey() 66 if (err) in hmac_setkey() 67 return err; in hmac_setkey() 186 int err; in hmac_create() local 190 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SHASH); in hmac_create() 191 if (err) in hmac_create() 192 return err; in hmac_create() 200 err = -EINVAL; in hmac_create() 211 err = PTR_ERR(inst); in hmac_create() [all …]
|