Lines Matching refs:ret
51 int ret = MBEDTLS_ERR_MD_BAD_INPUT_DATA; in mbedtls_hmac_drbg_update() local
55 if ((ret = mbedtls_md_hmac_reset(&ctx->md_ctx)) != 0) { in mbedtls_hmac_drbg_update()
58 if ((ret = mbedtls_md_hmac_update(&ctx->md_ctx, in mbedtls_hmac_drbg_update()
62 if ((ret = mbedtls_md_hmac_update(&ctx->md_ctx, in mbedtls_hmac_drbg_update()
67 if ((ret = mbedtls_md_hmac_update(&ctx->md_ctx, in mbedtls_hmac_drbg_update()
72 if ((ret = mbedtls_md_hmac_finish(&ctx->md_ctx, K)) != 0) { in mbedtls_hmac_drbg_update()
77 if ((ret = mbedtls_md_hmac_starts(&ctx->md_ctx, K, md_len)) != 0) { in mbedtls_hmac_drbg_update()
80 if ((ret = mbedtls_md_hmac_update(&ctx->md_ctx, in mbedtls_hmac_drbg_update()
84 if ((ret = mbedtls_md_hmac_finish(&ctx->md_ctx, ctx->V)) != 0) { in mbedtls_hmac_drbg_update()
91 return ret; in mbedtls_hmac_drbg_update()
101 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_seed_buf() local
103 if ((ret = mbedtls_md_setup(&ctx->md_ctx, md_info, 1)) != 0) { in mbedtls_hmac_drbg_seed_buf()
104 return ret; in mbedtls_hmac_drbg_seed_buf()
116 if ((ret = mbedtls_md_hmac_starts(&ctx->md_ctx, ctx->V, in mbedtls_hmac_drbg_seed_buf()
118 return ret; in mbedtls_hmac_drbg_seed_buf()
122 if ((ret = mbedtls_hmac_drbg_update(ctx, data, data_len)) != 0) { in mbedtls_hmac_drbg_seed_buf()
123 return ret; in mbedtls_hmac_drbg_seed_buf()
140 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in hmac_drbg_reseed_core() local
161 if ((ret = ctx->f_entropy(ctx->p_entropy, in hmac_drbg_reseed_core()
177 if ((ret = ctx->f_entropy(ctx->p_entropy, in hmac_drbg_reseed_core()
194 if ((ret = mbedtls_hmac_drbg_update(ctx, seed, seedlen)) != 0) { in hmac_drbg_reseed_core()
204 return ret; in hmac_drbg_reseed_core()
229 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_seed() local
232 if ((ret = mbedtls_md_setup(&ctx->md_ctx, md_info, 1)) != 0) { in mbedtls_hmac_drbg_seed()
233 return ret; in mbedtls_hmac_drbg_seed()
248 if ((ret = mbedtls_md_hmac_starts(&ctx->md_ctx, ctx->V, md_size)) != 0) { in mbedtls_hmac_drbg_seed()
249 return ret; in mbedtls_hmac_drbg_seed()
269 if ((ret = hmac_drbg_reseed_core(ctx, custom, len, in mbedtls_hmac_drbg_seed()
271 return ret; in mbedtls_hmac_drbg_seed()
310 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_random_with_add() local
330 if ((ret = mbedtls_hmac_drbg_reseed(ctx, additional, add_len)) != 0) { in mbedtls_hmac_drbg_random_with_add()
331 return ret; in mbedtls_hmac_drbg_random_with_add()
339 if ((ret = mbedtls_hmac_drbg_update(ctx, in mbedtls_hmac_drbg_random_with_add()
349 if ((ret = mbedtls_md_hmac_reset(&ctx->md_ctx)) != 0) { in mbedtls_hmac_drbg_random_with_add()
352 if ((ret = mbedtls_md_hmac_update(&ctx->md_ctx, in mbedtls_hmac_drbg_random_with_add()
356 if ((ret = mbedtls_md_hmac_finish(&ctx->md_ctx, ctx->V)) != 0) { in mbedtls_hmac_drbg_random_with_add()
366 if ((ret = mbedtls_hmac_drbg_update(ctx, in mbedtls_hmac_drbg_random_with_add()
376 return ret; in mbedtls_hmac_drbg_random_with_add()
384 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_random() local
388 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_hmac_drbg_random()
389 return ret; in mbedtls_hmac_drbg_random()
393 ret = mbedtls_hmac_drbg_random_with_add(ctx, output, out_len, NULL, 0); in mbedtls_hmac_drbg_random()
401 return ret; in mbedtls_hmac_drbg_random()
428 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_write_seed_file() local
439 if ((ret = mbedtls_hmac_drbg_random(ctx, buf, sizeof(buf))) != 0) { in mbedtls_hmac_drbg_write_seed_file()
444 ret = MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR; in mbedtls_hmac_drbg_write_seed_file()
448 ret = 0; in mbedtls_hmac_drbg_write_seed_file()
454 return ret; in mbedtls_hmac_drbg_write_seed_file()
459 int ret = 0; in mbedtls_hmac_drbg_update_seed_file() local
474 ret = MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG; in mbedtls_hmac_drbg_update_seed_file()
478 ret = MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR; in mbedtls_hmac_drbg_update_seed_file()
484 ret = mbedtls_hmac_drbg_update(ctx, buf, n); in mbedtls_hmac_drbg_update_seed_file()
491 if (ret != 0) { in mbedtls_hmac_drbg_update_seed_file()
492 return ret; in mbedtls_hmac_drbg_update_seed_file()