MAC_CTX *ctx = NULL;

    unsigned char buf[4096];
    size_t read_l;
    size_t final_l;

    size_t i;

    OSSL_PARAM params[3];
    size_t params_n = 0;

    if (cipher != NULL)
        params[params_n++] =
            OSSL_PARAM_construct_utf8_string(&quot;cipher&quot;, (char*)cipher, 0);
    if (digest != NULL)
        params[params_n++] =
            OSSL_PARAM_construct_utf8_string(&quot;digest&quot;, (char*)digest, 0);
    params[params_n] = OSSL_PARAM_construct_end();

    if (mac == NULL
        