Lines Matching refs:md_ctx

280     mbedtls_md_context_t md_ctx;  in tls1_prf()  local
283 mbedtls_md_init( &md_ctx ); in tls1_prf()
303 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in tls1_prf()
306 mbedtls_md_hmac_starts( &md_ctx, S1, hs ); in tls1_prf()
307 mbedtls_md_hmac_update( &md_ctx, tmp + 20, nb ); in tls1_prf()
308 mbedtls_md_hmac_finish( &md_ctx, 4 + tmp ); in tls1_prf()
312 mbedtls_md_hmac_reset ( &md_ctx ); in tls1_prf()
313 mbedtls_md_hmac_update( &md_ctx, 4 + tmp, 16 + nb ); in tls1_prf()
314 mbedtls_md_hmac_finish( &md_ctx, h_i ); in tls1_prf()
316 mbedtls_md_hmac_reset ( &md_ctx ); in tls1_prf()
317 mbedtls_md_hmac_update( &md_ctx, 4 + tmp, 16 ); in tls1_prf()
318 mbedtls_md_hmac_finish( &md_ctx, 4 + tmp ); in tls1_prf()
326 mbedtls_md_free( &md_ctx ); in tls1_prf()
334 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in tls1_prf()
337 mbedtls_md_hmac_starts( &md_ctx, S2, hs ); in tls1_prf()
338 mbedtls_md_hmac_update( &md_ctx, tmp + 20, nb ); in tls1_prf()
339 mbedtls_md_hmac_finish( &md_ctx, tmp ); in tls1_prf()
343 mbedtls_md_hmac_reset ( &md_ctx ); in tls1_prf()
344 mbedtls_md_hmac_update( &md_ctx, tmp, 20 + nb ); in tls1_prf()
345 mbedtls_md_hmac_finish( &md_ctx, h_i ); in tls1_prf()
347 mbedtls_md_hmac_reset ( &md_ctx ); in tls1_prf()
348 mbedtls_md_hmac_update( &md_ctx, tmp, 20 ); in tls1_prf()
349 mbedtls_md_hmac_finish( &md_ctx, tmp ); in tls1_prf()
357 mbedtls_md_free( &md_ctx ); in tls1_prf()
378 mbedtls_md_context_t md_ctx; in tls_prf_generic() local
381 mbedtls_md_init( &md_ctx ); in tls_prf_generic()
399 if ( ( ret = mbedtls_md_setup( &md_ctx, md_info, 1 ) ) != 0 ) in tls_prf_generic()
402 mbedtls_md_hmac_starts( &md_ctx, secret, slen ); in tls_prf_generic()
403 mbedtls_md_hmac_update( &md_ctx, tmp + md_len, nb ); in tls_prf_generic()
404 mbedtls_md_hmac_finish( &md_ctx, tmp ); in tls_prf_generic()
408 mbedtls_md_hmac_reset ( &md_ctx ); in tls_prf_generic()
409 mbedtls_md_hmac_update( &md_ctx, tmp, md_len + nb ); in tls_prf_generic()
410 mbedtls_md_hmac_finish( &md_ctx, h_i ); in tls_prf_generic()
412 mbedtls_md_hmac_reset ( &md_ctx ); in tls_prf_generic()
413 mbedtls_md_hmac_update( &md_ctx, tmp, md_len ); in tls_prf_generic()
414 mbedtls_md_hmac_finish( &md_ctx, tmp ); in tls_prf_generic()
422 mbedtls_md_free( &md_ctx ); in tls_prf_generic()
1206 static void ssl_mac( mbedtls_md_context_t *md_ctx, unsigned char *secret, in ssl_mac() argument
1213 int md_size = mbedtls_md_get_size( md_ctx->md_info ); in ssl_mac()
1214 int md_type = mbedtls_md_get_type( md_ctx->md_info ); in ssl_mac()
1228 mbedtls_md_starts( md_ctx ); in ssl_mac()
1229 mbedtls_md_update( md_ctx, secret, md_size ); in ssl_mac()
1230 mbedtls_md_update( md_ctx, padding, padlen ); in ssl_mac()
1231 mbedtls_md_update( md_ctx, header, 11 ); in ssl_mac()
1232 mbedtls_md_update( md_ctx, buf, len ); in ssl_mac()
1233 mbedtls_md_finish( md_ctx, buf + len ); in ssl_mac()
1236 mbedtls_md_starts( md_ctx ); in ssl_mac()
1237 mbedtls_md_update( md_ctx, secret, md_size ); in ssl_mac()
1238 mbedtls_md_update( md_ctx, padding, padlen ); in ssl_mac()
1239 mbedtls_md_update( md_ctx, buf + len, md_size ); in ssl_mac()
1240 mbedtls_md_finish( md_ctx, buf + len ); in ssl_mac()