Lines Matching refs:ret

72     int ret, n;  in dhm_read_bignum()  local
83 if( ( ret = mbedtls_mpi_read_binary( X, *p, n ) ) != 0 ) in dhm_read_bignum()
84 return( MBEDTLS_ERR_DHM_READ_PARAMS_FAILED + ret ); in dhm_read_bignum()
103 int ret = MBEDTLS_ERR_DHM_BAD_INPUT_DATA; in dhm_check_range() local
113 ret = 0; in dhm_check_range()
118 return( ret ); in dhm_check_range()
133 int ret; in mbedtls_dhm_read_params() local
135 if( ( ret = dhm_read_bignum( &ctx->P, p, end ) ) != 0 || in mbedtls_dhm_read_params()
136 ( ret = dhm_read_bignum( &ctx->G, p, end ) ) != 0 || in mbedtls_dhm_read_params()
137 ( ret = dhm_read_bignum( &ctx->GY, p, end ) ) != 0 ) in mbedtls_dhm_read_params()
138 return( ret ); in mbedtls_dhm_read_params()
140 if( ( ret = dhm_check_range( &ctx->GY, &ctx->P ) ) != 0 ) in mbedtls_dhm_read_params()
141 return( ret ); in mbedtls_dhm_read_params()
156 int ret, count = 0; in mbedtls_dhm_make_params() local
184 if( ( ret = dhm_check_range( &ctx->GX, &ctx->P ) ) != 0 ) in mbedtls_dhm_make_params()
185 return( ret ); in mbedtls_dhm_make_params()
210 if( ret != 0 ) in mbedtls_dhm_make_params()
211 return( MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED + ret ); in mbedtls_dhm_make_params()
222 int ret; in mbedtls_dhm_read_public() local
227 if( ( ret = mbedtls_mpi_read_binary( &ctx->GY, input, ilen ) ) != 0 ) in mbedtls_dhm_read_public()
228 return( MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED + ret ); in mbedtls_dhm_read_public()
241 int ret, count = 0; in mbedtls_dhm_make_public() local
267 if( ( ret = dhm_check_range( &ctx->GX, &ctx->P ) ) != 0 ) in mbedtls_dhm_make_public()
268 return( ret ); in mbedtls_dhm_make_public()
274 if( ret != 0 ) in mbedtls_dhm_make_public()
275 return( MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED + ret ); in mbedtls_dhm_make_public()
289 int ret, count; in dhm_update_blinding() local
342 return( ret ); in dhm_update_blinding()
353 int ret; in mbedtls_dhm_calc_secret() local
359 if( ( ret = dhm_check_range( &ctx->GY, &ctx->P ) ) != 0 ) in mbedtls_dhm_calc_secret()
360 return( ret ); in mbedtls_dhm_calc_secret()
392 if( ret != 0 ) in mbedtls_dhm_calc_secret()
393 return( MBEDTLS_ERR_DHM_CALC_SECRET_FAILED + ret ); in mbedtls_dhm_calc_secret()
418 int ret; in mbedtls_dhm_parse_dhm() local
428 ret = MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT; in mbedtls_dhm_parse_dhm()
430 ret = mbedtls_pem_read_buffer( &pem, in mbedtls_dhm_parse_dhm()
435 if( ret == 0 ) in mbedtls_dhm_parse_dhm()
442 else if( ret != MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT ) in mbedtls_dhm_parse_dhm()
445 p = ( ret == 0 ) ? pem.buf : (unsigned char *) dhmin; in mbedtls_dhm_parse_dhm()
458 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_dhm_parse_dhm()
461 ret = MBEDTLS_ERR_DHM_INVALID_FORMAT + ret; in mbedtls_dhm_parse_dhm()
467 if( ( ret = mbedtls_asn1_get_mpi( &p, end, &dhm->P ) ) != 0 || in mbedtls_dhm_parse_dhm()
468 ( ret = mbedtls_asn1_get_mpi( &p, end, &dhm->G ) ) != 0 ) in mbedtls_dhm_parse_dhm()
470 ret = MBEDTLS_ERR_DHM_INVALID_FORMAT + ret; in mbedtls_dhm_parse_dhm()
480 ret = mbedtls_asn1_get_mpi( &p, end, &rec ); in mbedtls_dhm_parse_dhm()
482 if ( ret != 0 ) in mbedtls_dhm_parse_dhm()
484 ret = MBEDTLS_ERR_DHM_INVALID_FORMAT + ret; in mbedtls_dhm_parse_dhm()
489 ret = MBEDTLS_ERR_DHM_INVALID_FORMAT + in mbedtls_dhm_parse_dhm()
495 ret = 0; in mbedtls_dhm_parse_dhm()
503 if( ret != 0 ) in mbedtls_dhm_parse_dhm()
506 return( ret ); in mbedtls_dhm_parse_dhm()
564 int ret; in mbedtls_dhm_parse_dhmfile() local
568 if( ( ret = load_file( path, &buf, &n ) ) != 0 ) in mbedtls_dhm_parse_dhmfile()
569 return( ret ); in mbedtls_dhm_parse_dhmfile()
571 ret = mbedtls_dhm_parse_dhm( dhm, buf, n ); in mbedtls_dhm_parse_dhmfile()
576 return( ret ); in mbedtls_dhm_parse_dhmfile()
597 int ret; in mbedtls_dhm_self_test() local
605 if( ( ret = mbedtls_dhm_parse_dhm( &dhm, in mbedtls_dhm_self_test()
612 ret = 1; in mbedtls_dhm_self_test()
622 return( ret ); in mbedtls_dhm_self_test()