Lines Matching refs:err
103 int err; in crypto_gcm_setkey() local
108 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_gcm_setkey()
109 if (err) in crypto_gcm_setkey()
110 return err; in crypto_gcm_setkey()
127 err = crypto_wait_req(crypto_skcipher_encrypt(&data->req), in crypto_gcm_setkey()
130 if (err) in crypto_gcm_setkey()
136 err = crypto_ahash_setkey(ghash, (u8 *)&data->hash, sizeof(be128)); in crypto_gcm_setkey()
139 return err; in crypto_gcm_setkey()
196 static void gcm_hash_len_done(void *data, int err);
245 static void gcm_hash_len_done(void *data, int err) in gcm_hash_len_done() argument
249 if (err) in gcm_hash_len_done()
252 err = gcm_hash_len_continue(req, 0); in gcm_hash_len_done()
253 if (err == -EINPROGRESS) in gcm_hash_len_done()
257 aead_request_complete(req, err); in gcm_hash_len_done()
266 static void gcm_hash_crypt_remain_done(void *data, int err) in gcm_hash_crypt_remain_done() argument
270 if (err) in gcm_hash_crypt_remain_done()
273 err = gcm_hash_crypt_remain_continue(req, 0); in gcm_hash_crypt_remain_done()
274 if (err == -EINPROGRESS) in gcm_hash_crypt_remain_done()
278 aead_request_complete(req, err); in gcm_hash_crypt_remain_done()
296 static void gcm_hash_crypt_done(void *data, int err) in gcm_hash_crypt_done() argument
300 if (err) in gcm_hash_crypt_done()
303 err = gcm_hash_crypt_continue(req, 0); in gcm_hash_crypt_done()
304 if (err == -EINPROGRESS) in gcm_hash_crypt_done()
308 aead_request_complete(req, err); in gcm_hash_crypt_done()
324 static void gcm_hash_assoc_remain_done(void *data, int err) in gcm_hash_assoc_remain_done() argument
328 if (err) in gcm_hash_assoc_remain_done()
331 err = gcm_hash_assoc_remain_continue(req, 0); in gcm_hash_assoc_remain_done()
332 if (err == -EINPROGRESS) in gcm_hash_assoc_remain_done()
336 aead_request_complete(req, err); in gcm_hash_assoc_remain_done()
352 static void gcm_hash_assoc_done(void *data, int err) in gcm_hash_assoc_done() argument
356 if (err) in gcm_hash_assoc_done()
359 err = gcm_hash_assoc_continue(req, 0); in gcm_hash_assoc_done()
360 if (err == -EINPROGRESS) in gcm_hash_assoc_done()
364 aead_request_complete(req, err); in gcm_hash_assoc_done()
377 static void gcm_hash_init_done(void *data, int err) in gcm_hash_init_done() argument
381 if (err) in gcm_hash_init_done()
384 err = gcm_hash_init_continue(req, 0); in gcm_hash_init_done()
385 if (err == -EINPROGRESS) in gcm_hash_init_done()
389 aead_request_complete(req, err); in gcm_hash_init_done()
430 static void gcm_encrypt_done(void *data, int err) in gcm_encrypt_done() argument
434 if (err) in gcm_encrypt_done()
437 err = gcm_encrypt_continue(req, 0); in gcm_encrypt_done()
438 if (err == -EINPROGRESS) in gcm_encrypt_done()
442 aead_request_complete(req, err); in gcm_encrypt_done()
474 static void gcm_decrypt_done(void *data, int err) in gcm_decrypt_done() argument
478 if (!err) in gcm_decrypt_done()
479 err = crypto_gcm_verify(req); in gcm_decrypt_done()
481 aead_request_complete(req, err); in gcm_decrypt_done()
523 int err; in crypto_gcm_init_tfm() local
530 err = PTR_ERR(ctr); in crypto_gcm_init_tfm()
550 return err; in crypto_gcm_init_tfm()
580 int err; in crypto_gcm_create_common() local
582 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask); in crypto_gcm_create_common()
583 if (err) in crypto_gcm_create_common()
584 return err; in crypto_gcm_create_common()
591 err = crypto_grab_ahash(&ctx->ghash, aead_crypto_instance(inst), in crypto_gcm_create_common()
593 if (err) in crypto_gcm_create_common()
597 err = -EINVAL; in crypto_gcm_create_common()
602 err = crypto_grab_skcipher(&ctx->ctr, aead_crypto_instance(inst), in crypto_gcm_create_common()
604 if (err) in crypto_gcm_create_common()
609 err = -EINVAL; in crypto_gcm_create_common()
614 err = -ENAMETOOLONG; in crypto_gcm_create_common()
642 err = aead_register_instance(tmpl, inst); in crypto_gcm_create_common()
643 if (err) { in crypto_gcm_create_common()
647 return err; in crypto_gcm_create_common()
705 int err; in crypto_rfc4106_setauthsize() local
707 err = crypto_rfc4106_check_authsize(authsize); in crypto_rfc4106_setauthsize()
708 if (err) in crypto_rfc4106_setauthsize()
709 return err; in crypto_rfc4106_setauthsize()
757 int err; in crypto_rfc4106_encrypt() local
759 err = crypto_ipsec_check_assoclen(req->assoclen); in crypto_rfc4106_encrypt()
760 if (err) in crypto_rfc4106_encrypt()
761 return err; in crypto_rfc4106_encrypt()
770 int err; in crypto_rfc4106_decrypt() local
772 err = crypto_ipsec_check_assoclen(req->assoclen); in crypto_rfc4106_decrypt()
773 if (err) in crypto_rfc4106_decrypt()
774 return err; in crypto_rfc4106_decrypt()
826 int err; in crypto_rfc4106_create() local
828 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask); in crypto_rfc4106_create()
829 if (err) in crypto_rfc4106_create()
830 return err; in crypto_rfc4106_create()
837 err = crypto_grab_aead(spawn, aead_crypto_instance(inst), in crypto_rfc4106_create()
839 if (err) in crypto_rfc4106_create()
844 err = -EINVAL; in crypto_rfc4106_create()
854 err = -ENAMETOOLONG; in crypto_rfc4106_create()
883 err = aead_register_instance(tmpl, inst); in crypto_rfc4106_create()
884 if (err) { in crypto_rfc4106_create()
888 return err; in crypto_rfc4106_create()
1012 int err; in crypto_rfc4543_create() local
1014 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_AEAD, &mask); in crypto_rfc4543_create()
1015 if (err) in crypto_rfc4543_create()
1016 return err; in crypto_rfc4543_create()
1023 err = crypto_grab_aead(&ctx->aead, aead_crypto_instance(inst), in crypto_rfc4543_create()
1025 if (err) in crypto_rfc4543_create()
1030 err = -EINVAL; in crypto_rfc4543_create()
1040 err = -ENAMETOOLONG; in crypto_rfc4543_create()
1069 err = aead_register_instance(tmpl, inst); in crypto_rfc4543_create()
1070 if (err) { in crypto_rfc4543_create()
1074 return err; in crypto_rfc4543_create()
1099 int err; in crypto_gcm_module_init() local
1107 err = crypto_register_templates(crypto_gcm_tmpls, in crypto_gcm_module_init()
1109 if (err) in crypto_gcm_module_init()
1112 return err; in crypto_gcm_module_init()