Lines Matching refs:ret
86 int idx, ret = 0;
89 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) {
90 return ret;
96 ret = MBEDTLS_ERR_ENTROPY_MAX_SOURCES;
114 return ret;
127 int ret = 0;
130 if ((ret = mbedtls_md(mbedtls_md_info_from_type(MBEDTLS_ENTROPY_MD),
147 ret = mbedtls_md_setup(&ctx->accumulator,
149 if (ret != 0) {
152 ret = mbedtls_md_starts(&ctx->accumulator);
153 if (ret != 0) {
158 if ((ret = mbedtls_md_update(&ctx->accumulator, header, 2)) != 0) {
161 ret = mbedtls_md_update(&ctx->accumulator, p, use_len);
166 return ret;
172 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
175 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) {
176 return ret;
180 ret = entropy_update(ctx, MBEDTLS_ENTROPY_SOURCE_MANUAL, data, len);
188 return ret;
196 int ret = MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
215 if ((ret = ctx->source[i].f_source(ctx->source[i].p_source,
224 if ((ret = entropy_update(ctx, (unsigned char) i,
226 return ret;
233 ret = MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE;
239 return ret;
247 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
250 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) {
251 return ret;
255 ret = entropy_gather_internal(ctx);
263 return ret;
268 int ret, count = 0, i, thresholds_reached;
283 if ((ret = mbedtls_entropy_update_nv_seed(ctx)) != 0) {
284 return ret;
290 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) {
291 return ret;
300 ret = MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
304 if ((ret = entropy_gather_internal(ctx)) != 0) {
327 if ((ret = mbedtls_md_finish(&ctx->accumulator, buf)) != 0) {
336 ret = mbedtls_md_setup(&ctx->accumulator,
338 if (ret != 0) {
341 ret = mbedtls_md_starts(&ctx->accumulator);
342 if (ret != 0) {
345 if ((ret = mbedtls_md_update(&ctx->accumulator, buf,
353 if ((ret = mbedtls_md(mbedtls_md_info_from_type(MBEDTLS_ENTROPY_MD),
364 ret = 0;
375 return ret;
381 int ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR;
385 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) {
386 return ret;
395 ret = mbedtls_entropy_update_manual(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE);
397 return ret;
404 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
408 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) {
409 ret = MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
414 ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR;
422 ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR;
426 ret = 0;
435 return ret;
440 int ret = 0;
461 ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR;
463 ret = mbedtls_entropy_update_manual(ctx, buf, n);
470 if (ret != 0) {
471 return ret;
497 int ret = 0;
503 if ((ret = mbedtls_hardware_poll(NULL, buf + entropy_len,
505 return ret;
513 ret = 1;
516 return ret;
548 int ret = 0;
559 if ((ret = mbedtls_entropy_source_self_test_gather(buf0, sizeof(buf0))) != 0) {
562 if ((ret = mbedtls_entropy_source_self_test_gather(buf1, sizeof(buf1))) != 0) {
567 if ((ret = mbedtls_entropy_source_self_test_check_bits(buf0, sizeof(buf0))) != 0) {
570 if ((ret = mbedtls_entropy_source_self_test_check_bits(buf1, sizeof(buf1))) != 0) {
576 ret = memcmp(buf0, buf1, sizeof(buf0)) == 0;
580 if (ret != 0) {
589 return ret != 0;
601 int ret = 1;
614 if ((ret = mbedtls_entropy_gather(&ctx)) != 0) {
618 ret = mbedtls_entropy_add_source(&ctx, entropy_dummy_source, NULL, 16,
620 if (ret != 0) {
624 if ((ret = mbedtls_entropy_update_manual(&ctx, buf, sizeof(buf))) != 0) {
637 if ((ret = mbedtls_entropy_func(&ctx, buf, sizeof(buf))) != 0) {
648 ret = 1;
654 if ((ret = mbedtls_entropy_source_self_test(0)) != 0) {
663 if (ret != 0) {
672 return ret != 0;