• Home
  • Raw
  • Download

Lines Matching refs:ret

246 	int ret = 0;  in drbg_fips_continuous_test()  local
265 ret = memcmp(drbg->prev, entropy, entropylen); in drbg_fips_continuous_test()
266 if (!ret) in drbg_fips_continuous_test()
323 int ret = 0; in drbg_ctr_bcc() local
340 ret = drbg_kcapi_sym(drbg, out, &data); in drbg_ctr_bcc()
341 if (ret) in drbg_ctr_bcc()
342 return ret; in drbg_ctr_bcc()
352 ret = drbg_kcapi_sym(drbg, out, &data); in drbg_ctr_bcc()
354 return ret; in drbg_ctr_bcc()
401 int ret = -EFAULT; in drbg_ctr_df() local
472 ret = drbg_ctr_bcc(drbg, temp + templen, K, &bcc_list); in drbg_ctr_df()
473 if (ret) in drbg_ctr_df()
495 ret = drbg_kcapi_sym(drbg, X, &cipherin); in drbg_ctr_df()
496 if (ret) in drbg_ctr_df()
507 ret = 0; in drbg_ctr_df()
513 return ret; in drbg_ctr_df()
534 int ret = -EFAULT; in drbg_ctr_update() local
553 ret = crypto_skcipher_setkey(drbg->ctr_handle, drbg->C, in drbg_ctr_update()
555 if (ret) in drbg_ctr_update()
561 ret = drbg_ctr_df(drbg, df_data, drbg_statelen(drbg), seed); in drbg_ctr_update()
562 if (ret) in drbg_ctr_update()
566 ret = drbg_kcapi_sym_ctr(drbg, df_data, drbg_statelen(drbg), in drbg_ctr_update()
568 if (ret) in drbg_ctr_update()
569 return ret; in drbg_ctr_update()
572 ret = crypto_skcipher_setkey(drbg->ctr_handle, temp, in drbg_ctr_update()
574 if (ret) in drbg_ctr_update()
580 ret = 0; in drbg_ctr_update()
586 return ret; in drbg_ctr_update()
598 int ret; in drbg_ctr_generate() local
603 ret = drbg_ctr_update(drbg, addtl, 2); in drbg_ctr_generate()
604 if (ret) in drbg_ctr_generate()
609 ret = drbg_kcapi_sym_ctr(drbg, NULL, 0, buf, len); in drbg_ctr_generate()
610 if (ret) in drbg_ctr_generate()
611 return ret; in drbg_ctr_generate()
614 ret = drbg_ctr_update(drbg, NULL, 3); in drbg_ctr_generate()
615 if (ret) in drbg_ctr_generate()
616 len = ret; in drbg_ctr_generate()
657 int ret = -EFAULT; in drbg_hmac_update() local
687 ret = drbg_kcapi_hash(drbg, drbg->C, &seedlist); in drbg_hmac_update()
688 if (ret) in drbg_hmac_update()
689 return ret; in drbg_hmac_update()
693 ret = drbg_kcapi_hash(drbg, drbg->V, &vdatalist); in drbg_hmac_update()
694 if (ret) in drbg_hmac_update()
695 return ret; in drbg_hmac_update()
699 return ret; in drbg_hmac_update()
712 int ret = 0; in drbg_hmac_generate() local
718 ret = drbg_hmac_update(drbg, addtl, 1); in drbg_hmac_generate()
719 if (ret) in drbg_hmac_generate()
720 return ret; in drbg_hmac_generate()
728 ret = drbg_kcapi_hash(drbg, drbg->V, &datalist); in drbg_hmac_generate()
729 if (ret) in drbg_hmac_generate()
730 return ret; in drbg_hmac_generate()
741 ret = drbg_hmac_update(drbg, addtl, 1); in drbg_hmac_generate()
743 ret = drbg_hmac_update(drbg, NULL, 1); in drbg_hmac_generate()
744 if (ret) in drbg_hmac_generate()
745 return ret; in drbg_hmac_generate()
825 int ret = 0; in drbg_hash_df() local
843 ret = drbg_kcapi_hash(drbg, tmp, entropylist); in drbg_hash_df()
844 if (ret) in drbg_hash_df()
856 return ret; in drbg_hash_df()
863 int ret = 0; in drbg_hash_update() local
884 ret = drbg_hash_df(drbg, drbg->V, drbg_statelen(drbg), &datalist); in drbg_hash_update()
885 if (ret) in drbg_hash_update()
895 ret = drbg_hash_df(drbg, drbg->C, drbg_statelen(drbg), &datalist2); in drbg_hash_update()
899 return ret; in drbg_hash_update()
906 int ret = 0; in drbg_hash_process_addtl() local
921 ret = drbg_kcapi_hash(drbg, drbg->scratchpad, &datalist); in drbg_hash_process_addtl()
922 if (ret) in drbg_hash_process_addtl()
931 return ret; in drbg_hash_process_addtl()
940 int ret = 0; in drbg_hash_hashgen() local
954 ret = drbg_kcapi_hash(drbg, dst, &datalist); in drbg_hash_hashgen()
955 if (ret) { in drbg_hash_hashgen()
956 len = ret; in drbg_hash_hashgen()
981 int ret = 0; in drbg_hash_generate() local
991 ret = drbg_hash_process_addtl(drbg, addtl); in drbg_hash_generate()
992 if (ret) in drbg_hash_generate()
993 return ret; in drbg_hash_generate()
1003 ret = drbg_kcapi_hash(drbg, drbg->scratchpad, &datalist); in drbg_hash_generate()
1004 if (ret) { in drbg_hash_generate()
1005 len = ret; in drbg_hash_generate()
1041 int ret = drbg->d_ops->update(drbg, seed, reseed); in __drbg_seed() local
1043 if (ret) in __drbg_seed()
1044 return ret; in __drbg_seed()
1071 return ret; in __drbg_seed()
1078 int ret; in drbg_get_random_bytes() local
1082 ret = drbg_fips_continuous_test(drbg, entropy); in drbg_get_random_bytes()
1083 if (ret && ret != -EAGAIN) in drbg_get_random_bytes()
1084 return ret; in drbg_get_random_bytes()
1085 } while (ret); in drbg_get_random_bytes()
1096 int ret; in drbg_seed_from_random() local
1104 ret = drbg_get_random_bytes(drbg, entropy, entropylen); in drbg_seed_from_random()
1105 if (ret) in drbg_seed_from_random()
1108 ret = __drbg_seed(drbg, &seedlist, true, DRBG_SEED_STATE_FULL); in drbg_seed_from_random()
1112 return ret; in drbg_seed_from_random()
1129 int ret; in drbg_seed() local
1165 ret = drbg_get_random_bytes(drbg, entropy, entropylen); in drbg_seed()
1166 if (ret) in drbg_seed()
1175 ret = crypto_rng_get_bytes(drbg->jent, in drbg_seed()
1178 if (ret) { in drbg_seed()
1179 pr_devel("DRBG: jent failed with %d\n", ret); in drbg_seed()
1195 if (!reseed || ret != -EAGAIN) in drbg_seed()
1221 ret = __drbg_seed(drbg, &seedlist, reseed, new_seed_state); in drbg_seed()
1226 return ret; in drbg_seed()
1258 int ret = -ENOMEM; in drbg_alloc_state() local
1278 ret = -EOPNOTSUPP; in drbg_alloc_state()
1282 ret = drbg->d_ops->crypto_init(drbg); in drbg_alloc_state()
1283 if (ret < 0) in drbg_alloc_state()
1286 drbg->Vbuf = kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL); in drbg_alloc_state()
1288 ret = -ENOMEM; in drbg_alloc_state()
1291 drbg->V = PTR_ALIGN(drbg->Vbuf, ret + 1); in drbg_alloc_state()
1292 drbg->Cbuf = kmalloc(drbg_statelen(drbg) + ret, GFP_KERNEL); in drbg_alloc_state()
1294 ret = -ENOMEM; in drbg_alloc_state()
1297 drbg->C = PTR_ALIGN(drbg->Cbuf, ret + 1); in drbg_alloc_state()
1311 drbg->scratchpadbuf = kzalloc(sb_size + ret, GFP_KERNEL); in drbg_alloc_state()
1313 ret = -ENOMEM; in drbg_alloc_state()
1316 drbg->scratchpad = PTR_ALIGN(drbg->scratchpadbuf, ret + 1); in drbg_alloc_state()
1323 ret = -ENOMEM; in drbg_alloc_state()
1335 return ret; in drbg_alloc_state()
1551 int ret; in drbg_instantiate() local
1574 ret = drbg_alloc_state(drbg); in drbg_instantiate()
1575 if (ret) in drbg_instantiate()
1578 ret = drbg_prepare_hrng(drbg); in drbg_instantiate()
1579 if (ret) in drbg_instantiate()
1585 ret = drbg_seed(drbg, pers, reseed); in drbg_instantiate()
1587 if (ret && !reseed) in drbg_instantiate()
1591 return ret; in drbg_instantiate()
1595 return ret; in drbg_instantiate()
1600 return ret; in drbg_instantiate()
1818 int ret; in drbg_kcapi_sym_ctr() local
1836 ret = crypto_wait_req(crypto_skcipher_encrypt(drbg->ctr_req), in drbg_kcapi_sym_ctr()
1838 if (ret) in drbg_kcapi_sym_ctr()
1849 ret = 0; in drbg_kcapi_sym_ctr()
1852 return ret; in drbg_kcapi_sym_ctr()
1983 int ret = -EFAULT; in drbg_healthcheck_sanity() local
2029 ret = drbg_seed(drbg, &addtl, false); in drbg_healthcheck_sanity()
2030 BUG_ON(0 == ret); in drbg_healthcheck_sanity()
2089 int ret; in drbg_init() local
2091 ret = drbg_healthcheck_sanity(); in drbg_init()
2092 if (ret) in drbg_init()
2093 return ret; in drbg_init()