Lines Matching refs:md_ctx

465                       size_t slen, mbedtls_md_context_t *md_ctx )  in mgf_mask()  argument
476 hlen = mbedtls_md_get_size( md_ctx->md_info ); in mgf_mask()
487 mbedtls_md_starts( md_ctx ); in mgf_mask()
488 mbedtls_md_update( md_ctx, src, slen ); in mgf_mask()
489 mbedtls_md_update( md_ctx, counter, 4 ); in mgf_mask()
490 mbedtls_md_finish( md_ctx, mask ); in mgf_mask()
520 mbedtls_md_context_t md_ctx; in mbedtls_rsa_rsaes_oaep_encrypt() local
556 mbedtls_md_init( &md_ctx ); in mbedtls_rsa_rsaes_oaep_encrypt()
557 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_encrypt()
559 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsaes_oaep_encrypt()
565 &md_ctx ); in mbedtls_rsa_rsaes_oaep_encrypt()
569 &md_ctx ); in mbedtls_rsa_rsaes_oaep_encrypt()
571 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsaes_oaep_encrypt()
696 mbedtls_md_context_t md_ctx; in mbedtls_rsa_rsaes_oaep_decrypt() local
732 mbedtls_md_init( &md_ctx ); in mbedtls_rsa_rsaes_oaep_decrypt()
733 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsaes_oaep_decrypt()
735 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsaes_oaep_decrypt()
745 &md_ctx ); in mbedtls_rsa_rsaes_oaep_decrypt()
749 &md_ctx ); in mbedtls_rsa_rsaes_oaep_decrypt()
751 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsaes_oaep_decrypt()
937 mbedtls_md_context_t md_ctx; in mbedtls_rsa_rsassa_pss_sign() local
980 mbedtls_md_init( &md_ctx ); in mbedtls_rsa_rsassa_pss_sign()
981 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsassa_pss_sign()
983 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsassa_pss_sign()
988 mbedtls_md_starts( &md_ctx ); in mbedtls_rsa_rsassa_pss_sign()
989 mbedtls_md_update( &md_ctx, p, 8 ); in mbedtls_rsa_rsassa_pss_sign()
990 mbedtls_md_update( &md_ctx, hash, hashlen ); in mbedtls_rsa_rsassa_pss_sign()
991 mbedtls_md_update( &md_ctx, salt, slen ); in mbedtls_rsa_rsassa_pss_sign()
992 mbedtls_md_finish( &md_ctx, p ); in mbedtls_rsa_rsassa_pss_sign()
999 mgf_mask( sig + offset, olen - hlen - 1 - offset, p, hlen, &md_ctx ); in mbedtls_rsa_rsassa_pss_sign()
1001 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsassa_pss_sign()
1197 mbedtls_md_context_t md_ctx; in mbedtls_rsa_rsassa_pss_verify_ext() local
1253 mbedtls_md_init( &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()
1254 if( ( ret = mbedtls_md_setup( &md_ctx, md_info, 0 ) ) != 0 ) in mbedtls_rsa_rsassa_pss_verify_ext()
1256 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()
1260 mgf_mask( p, siglen - hlen - 1, p + siglen - hlen - 1, hlen, &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()
1270 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()
1280 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()
1287 mbedtls_md_starts( &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()
1288 mbedtls_md_update( &md_ctx, zeros, 8 ); in mbedtls_rsa_rsassa_pss_verify_ext()
1289 mbedtls_md_update( &md_ctx, hash, hashlen ); in mbedtls_rsa_rsassa_pss_verify_ext()
1290 mbedtls_md_update( &md_ctx, p, slen ); in mbedtls_rsa_rsassa_pss_verify_ext()
1291 mbedtls_md_finish( &md_ctx, result ); in mbedtls_rsa_rsassa_pss_verify_ext()
1293 mbedtls_md_free( &md_ctx ); in mbedtls_rsa_rsassa_pss_verify_ext()