Lines Matching refs:err
113 int err; in hctr2_hash_tweaklen() local
119 err = crypto_shash_init(shash); in hctr2_hash_tweaklen()
120 if (err) in hctr2_hash_tweaklen()
121 return err; in hctr2_hash_tweaklen()
122 err = crypto_shash_update(shash, (u8 *)tweak_length_block, in hctr2_hash_tweaklen()
124 if (err) in hctr2_hash_tweaklen()
125 return err; in hctr2_hash_tweaklen()
134 int err; in hctr2_setkey() local
140 err = crypto_cipher_setkey(tctx->blockcipher, key, keylen); in hctr2_setkey()
141 if (err) in hctr2_setkey()
142 return err; in hctr2_setkey()
148 err = crypto_skcipher_setkey(tctx->xctr, key, keylen); in hctr2_setkey()
149 if (err) in hctr2_setkey()
150 return err; in hctr2_setkey()
162 err = crypto_shash_setkey(tctx->polyval, hbar, BLOCKCIPHER_BLOCK_SIZE); in hctr2_setkey()
163 if (err) in hctr2_setkey()
164 return err; in hctr2_setkey()
176 int err; in hctr2_hash_tweak() local
180 err = crypto_shash_import(hash_desc, hctr2_hashed_tweaklen(tctx, has_remainder)); in hctr2_hash_tweak()
181 if (err) in hctr2_hash_tweak()
182 return err; in hctr2_hash_tweak()
183 err = crypto_shash_update(hash_desc, req->iv, TWEAK_SIZE); in hctr2_hash_tweak()
184 if (err) in hctr2_hash_tweak()
185 return err; in hctr2_hash_tweak()
203 int err = 0; in hctr2_hash_message() local
211 err = crypto_shash_update(hash_desc, miter.addr, n); in hctr2_hash_message()
212 if (err) in hctr2_hash_message()
217 if (err) in hctr2_hash_message()
218 return err; in hctr2_hash_message()
221 err = crypto_shash_update(hash_desc, padding, in hctr2_hash_message()
223 if (err) in hctr2_hash_message()
224 return err; in hctr2_hash_message()
236 int err; in hctr2_finish() local
241 err = crypto_shash_import(hash_desc, hctr2_hashed_tweak(tctx, rctx)); in hctr2_finish()
242 if (err) in hctr2_finish()
243 return err; in hctr2_finish()
244 err = hctr2_hash_message(req, rctx->bulk_part_dst, digest); in hctr2_finish()
245 if (err) in hctr2_finish()
246 return err; in hctr2_finish()
255 static void hctr2_xctr_done(void *data, int err) in hctr2_xctr_done() argument
259 if (!err) in hctr2_xctr_done()
260 err = hctr2_finish(req); in hctr2_xctr_done()
262 skcipher_request_complete(req, err); in hctr2_xctr_done()
272 int err; in hctr2_crypt() local
290 err = hctr2_hash_tweak(req); in hctr2_crypt()
291 if (err) in hctr2_crypt()
292 return err; in hctr2_crypt()
293 err = hctr2_hash_message(req, rctx->bulk_part_src, digest); in hctr2_crypt()
294 if (err) in hctr2_crypt()
295 return err; in hctr2_crypt()
343 int err; in hctr2_init_tfm() local
351 err = PTR_ERR(blockcipher); in hctr2_init_tfm()
357 err = PTR_ERR(polyval); in hctr2_init_tfm()
382 return err; in hctr2_init_tfm()
417 int err; in hctr2_create_common() local
419 err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_SKCIPHER, &mask); in hctr2_create_common()
420 if (err) in hctr2_create_common()
421 return err; in hctr2_create_common()
429 err = crypto_grab_skcipher(&ictx->xctr_spawn, in hctr2_create_common()
432 if (err) in hctr2_create_common()
436 err = -EINVAL; in hctr2_create_common()
448 err = crypto_grab_cipher(&ictx->blockcipher_spawn, in hctr2_create_common()
451 if (err) in hctr2_create_common()
456 err = -EINVAL; in hctr2_create_common()
461 err = crypto_grab_shash(&ictx->polyval_spawn, in hctr2_create_common()
464 if (err) in hctr2_create_common()
469 err = -EINVAL; in hctr2_create_common()
475 err = -ENAMETOOLONG; in hctr2_create_common()
508 err = skcipher_register_instance(tmpl, inst); in hctr2_create_common()
509 if (err) { in hctr2_create_common()
513 return err; in hctr2_create_common()