Lines Matching refs:err

63 	void (*complete)(struct aead_request *req, int err);
79 int err; member
93 static void crypto_gcm_setkey_done(struct crypto_async_request *req, int err) in crypto_gcm_setkey_done() argument
97 if (err == -EINPROGRESS) in crypto_gcm_setkey_done()
100 result->err = err; in crypto_gcm_setkey_done()
119 int err; in crypto_gcm_setkey() local
125 err = crypto_ablkcipher_setkey(ctr, key, keylen); in crypto_gcm_setkey()
126 if (err) in crypto_gcm_setkey()
127 return err; in crypto_gcm_setkey()
147 err = crypto_ablkcipher_encrypt(&data->req); in crypto_gcm_setkey()
148 if (err == -EINPROGRESS || err == -EBUSY) { in crypto_gcm_setkey()
149 err = wait_for_completion_interruptible( in crypto_gcm_setkey()
151 if (!err) in crypto_gcm_setkey()
152 err = data->result.err; in crypto_gcm_setkey()
155 if (err) in crypto_gcm_setkey()
161 err = crypto_ahash_setkey(ghash, (u8 *)&data->hash, sizeof(be128)); in crypto_gcm_setkey()
167 return err; in crypto_gcm_setkey()
226 static void gcm_hash_len_done(struct crypto_async_request *areq, int err);
227 static void gcm_hash_final_done(struct crypto_async_request *areq, int err);
290 static void __gcm_hash_final_done(struct aead_request *req, int err) in __gcm_hash_final_done() argument
295 if (!err) in __gcm_hash_final_done()
298 gctx->complete(req, err); in __gcm_hash_final_done()
301 static void gcm_hash_final_done(struct crypto_async_request *areq, int err) in gcm_hash_final_done() argument
305 __gcm_hash_final_done(req, err); in gcm_hash_final_done()
308 static void __gcm_hash_len_done(struct aead_request *req, int err) in __gcm_hash_len_done() argument
312 if (!err) { in __gcm_hash_len_done()
313 err = gcm_hash_final(req, pctx); in __gcm_hash_len_done()
314 if (err == -EINPROGRESS || err == -EBUSY) in __gcm_hash_len_done()
318 __gcm_hash_final_done(req, err); in __gcm_hash_len_done()
321 static void gcm_hash_len_done(struct crypto_async_request *areq, int err) in gcm_hash_len_done() argument
325 __gcm_hash_len_done(req, err); in gcm_hash_len_done()
328 static void __gcm_hash_crypt_remain_done(struct aead_request *req, int err) in __gcm_hash_crypt_remain_done() argument
332 if (!err) { in __gcm_hash_crypt_remain_done()
333 err = gcm_hash_len(req, pctx); in __gcm_hash_crypt_remain_done()
334 if (err == -EINPROGRESS || err == -EBUSY) in __gcm_hash_crypt_remain_done()
338 __gcm_hash_len_done(req, err); in __gcm_hash_crypt_remain_done()
342 int err) in gcm_hash_crypt_remain_done() argument
346 __gcm_hash_crypt_remain_done(req, err); in gcm_hash_crypt_remain_done()
349 static void __gcm_hash_crypt_done(struct aead_request *req, int err) in __gcm_hash_crypt_done() argument
355 if (!err) { in __gcm_hash_crypt_done()
358 err = gcm_hash_remain(req, pctx, remain, in __gcm_hash_crypt_done()
360 if (err == -EINPROGRESS || err == -EBUSY) in __gcm_hash_crypt_done()
364 __gcm_hash_crypt_remain_done(req, err); in __gcm_hash_crypt_done()
367 static void gcm_hash_crypt_done(struct crypto_async_request *areq, int err) in gcm_hash_crypt_done() argument
371 __gcm_hash_crypt_done(req, err); in gcm_hash_crypt_done()
374 static void __gcm_hash_assoc_remain_done(struct aead_request *req, int err) in __gcm_hash_assoc_remain_done() argument
381 if (!err && gctx->cryptlen) { in __gcm_hash_assoc_remain_done()
385 err = gcm_hash_update(req, pctx, compl, in __gcm_hash_assoc_remain_done()
387 if (err == -EINPROGRESS || err == -EBUSY) in __gcm_hash_assoc_remain_done()
392 __gcm_hash_crypt_done(req, err); in __gcm_hash_assoc_remain_done()
394 __gcm_hash_crypt_remain_done(req, err); in __gcm_hash_assoc_remain_done()
398 int err) in gcm_hash_assoc_remain_done() argument
402 __gcm_hash_assoc_remain_done(req, err); in gcm_hash_assoc_remain_done()
405 static void __gcm_hash_assoc_done(struct aead_request *req, int err) in __gcm_hash_assoc_done() argument
410 if (!err) { in __gcm_hash_assoc_done()
413 err = gcm_hash_remain(req, pctx, remain, in __gcm_hash_assoc_done()
415 if (err == -EINPROGRESS || err == -EBUSY) in __gcm_hash_assoc_done()
419 __gcm_hash_assoc_remain_done(req, err); in __gcm_hash_assoc_done()
422 static void gcm_hash_assoc_done(struct crypto_async_request *areq, int err) in gcm_hash_assoc_done() argument
426 __gcm_hash_assoc_done(req, err); in gcm_hash_assoc_done()
429 static void __gcm_hash_init_done(struct aead_request *req, int err) in __gcm_hash_init_done() argument
435 if (!err && req->assoclen) { in __gcm_hash_init_done()
439 err = gcm_hash_update(req, pctx, compl, in __gcm_hash_init_done()
441 if (err == -EINPROGRESS || err == -EBUSY) in __gcm_hash_init_done()
446 __gcm_hash_assoc_done(req, err); in __gcm_hash_init_done()
448 __gcm_hash_assoc_remain_done(req, err); in __gcm_hash_init_done()
451 static void gcm_hash_init_done(struct crypto_async_request *areq, int err) in gcm_hash_init_done() argument
455 __gcm_hash_init_done(req, err); in gcm_hash_init_done()
466 int err; in gcm_hash() local
472 err = crypto_ahash_init(ahreq); in gcm_hash()
473 if (err) in gcm_hash()
474 return err; in gcm_hash()
477 err = gcm_hash_update(req, pctx, compl, req->assoc, req->assoclen); in gcm_hash()
478 if (err) in gcm_hash()
479 return err; in gcm_hash()
481 err = gcm_hash_remain(req, pctx, remain, in gcm_hash()
483 if (err) in gcm_hash()
484 return err; in gcm_hash()
488 err = gcm_hash_update(req, pctx, compl, gctx->src, gctx->cryptlen); in gcm_hash()
489 if (err) in gcm_hash()
490 return err; in gcm_hash()
492 err = gcm_hash_remain(req, pctx, remain, in gcm_hash()
494 if (err) in gcm_hash()
495 return err; in gcm_hash()
497 err = gcm_hash_len(req, pctx); in gcm_hash()
498 if (err) in gcm_hash()
499 return err; in gcm_hash()
500 err = gcm_hash_final(req, pctx); in gcm_hash()
501 if (err) in gcm_hash()
502 return err; in gcm_hash()
517 static void gcm_enc_hash_done(struct aead_request *req, int err) in gcm_enc_hash_done() argument
521 if (!err) in gcm_enc_hash_done()
524 aead_request_complete(req, err); in gcm_enc_hash_done()
527 static void gcm_encrypt_done(struct crypto_async_request *areq, int err) in gcm_encrypt_done() argument
532 if (!err) { in gcm_encrypt_done()
533 err = gcm_hash(req, pctx); in gcm_encrypt_done()
534 if (err == -EINPROGRESS || err == -EBUSY) in gcm_encrypt_done()
536 else if (!err) { in gcm_encrypt_done()
542 aead_request_complete(req, err); in gcm_encrypt_done()
550 int err; in crypto_gcm_encrypt() local
560 err = crypto_ablkcipher_encrypt(abreq); in crypto_gcm_encrypt()
561 if (err) in crypto_gcm_encrypt()
562 return err; in crypto_gcm_encrypt()
564 err = gcm_hash(req, pctx); in crypto_gcm_encrypt()
565 if (err) in crypto_gcm_encrypt()
566 return err; in crypto_gcm_encrypt()
588 static void gcm_decrypt_done(struct crypto_async_request *areq, int err) in gcm_decrypt_done() argument
593 if (!err) in gcm_decrypt_done()
594 err = crypto_gcm_verify(req, pctx); in gcm_decrypt_done()
596 aead_request_complete(req, err); in gcm_decrypt_done()
599 static void gcm_dec_hash_done(struct aead_request *req, int err) in gcm_dec_hash_done() argument
605 if (!err) { in gcm_dec_hash_done()
609 err = crypto_ablkcipher_decrypt(abreq); in gcm_dec_hash_done()
610 if (err == -EINPROGRESS || err == -EBUSY) in gcm_dec_hash_done()
612 else if (!err) in gcm_dec_hash_done()
613 err = crypto_gcm_verify(req, pctx); in gcm_dec_hash_done()
616 aead_request_complete(req, err); in gcm_dec_hash_done()
627 int err; in crypto_gcm_decrypt() local
637 err = gcm_hash(req, pctx); in crypto_gcm_decrypt()
638 if (err) in crypto_gcm_decrypt()
639 return err; in crypto_gcm_decrypt()
644 err = crypto_ablkcipher_decrypt(abreq); in crypto_gcm_decrypt()
645 if (err) in crypto_gcm_decrypt()
646 return err; in crypto_gcm_decrypt()
659 int err; in crypto_gcm_init_tfm() local
666 err = PTR_ERR(ctr); in crypto_gcm_init_tfm()
686 return err; in crypto_gcm_init_tfm()
708 int err; in crypto_gcm_alloc_common() local
723 err = -ENOMEM; in crypto_gcm_alloc_common()
730 err = crypto_init_ahash_spawn(&ctx->ghash, &ghash_ahash_alg->halg, in crypto_gcm_alloc_common()
732 if (err) in crypto_gcm_alloc_common()
736 err = crypto_grab_skcipher(&ctx->ctr, ctr_name, 0, in crypto_gcm_alloc_common()
739 if (err) in crypto_gcm_alloc_common()
749 err = -EINVAL; in crypto_gcm_alloc_common()
753 err = -ENAMETOOLONG; in crypto_gcm_alloc_common()
789 inst = ERR_PTR(err); in crypto_gcm_alloc_common()
863 int err; in crypto_rfc4106_setkey() local
874 err = crypto_aead_setkey(child, key, keylen); in crypto_rfc4106_setkey()
878 return err; in crypto_rfc4106_setkey()
971 int err; in crypto_rfc4106_alloc() local
990 err = crypto_grab_aead(spawn, ccm_name, 0, in crypto_rfc4106_alloc()
992 if (err) in crypto_rfc4106_alloc()
997 err = -EINVAL; in crypto_rfc4106_alloc()
1007 err = -ENAMETOOLONG; in crypto_rfc4106_alloc()
1044 inst = ERR_PTR(err); in crypto_rfc4106_alloc()
1074 int err; in crypto_rfc4543_setkey() local
1085 err = crypto_aead_setkey(child, key, keylen); in crypto_rfc4543_setkey()
1089 return err; in crypto_rfc4543_setkey()
1103 static void crypto_rfc4543_done(struct crypto_async_request *areq, int err) in crypto_rfc4543_done() argument
1109 if (!err) { in crypto_rfc4543_done()
1115 aead_request_complete(req, err); in crypto_rfc4543_done()
1200 int err; in crypto_rfc4543_encrypt() local
1203 err = crypto_rfc4543_copy_src_to_dst(req, true); in crypto_rfc4543_encrypt()
1204 if (err) in crypto_rfc4543_encrypt()
1205 return err; in crypto_rfc4543_encrypt()
1209 err = crypto_aead_encrypt(subreq); in crypto_rfc4543_encrypt()
1210 if (err) in crypto_rfc4543_encrypt()
1211 return err; in crypto_rfc4543_encrypt()
1221 int err; in crypto_rfc4543_decrypt() local
1224 err = crypto_rfc4543_copy_src_to_dst(req, false); in crypto_rfc4543_decrypt()
1225 if (err) in crypto_rfc4543_decrypt()
1226 return err; in crypto_rfc4543_decrypt()
1243 int err = 0; in crypto_rfc4543_init_tfm() local
1250 err = PTR_ERR(null); in crypto_rfc4543_init_tfm()
1268 return err; in crypto_rfc4543_init_tfm()
1287 int err; in crypto_rfc4543_alloc() local
1307 err = crypto_grab_aead(spawn, ccm_name, 0, in crypto_rfc4543_alloc()
1309 if (err) in crypto_rfc4543_alloc()
1315 err = crypto_grab_skcipher(&ctx->null, "ecb(cipher_null)", 0, in crypto_rfc4543_alloc()
1317 if (err) in crypto_rfc4543_alloc()
1322 err = -EINVAL; in crypto_rfc4543_alloc()
1332 err = -ENAMETOOLONG; in crypto_rfc4543_alloc()
1371 inst = ERR_PTR(err); in crypto_rfc4543_alloc()
1394 int err; in crypto_gcm_module_init() local
1400 err = crypto_register_template(&crypto_gcm_base_tmpl); in crypto_gcm_module_init()
1401 if (err) in crypto_gcm_module_init()
1404 err = crypto_register_template(&crypto_gcm_tmpl); in crypto_gcm_module_init()
1405 if (err) in crypto_gcm_module_init()
1408 err = crypto_register_template(&crypto_rfc4106_tmpl); in crypto_gcm_module_init()
1409 if (err) in crypto_gcm_module_init()
1412 err = crypto_register_template(&crypto_rfc4543_tmpl); in crypto_gcm_module_init()
1413 if (err) in crypto_gcm_module_init()
1426 return err; in crypto_gcm_module_init()