|| key == NULL
        || (ctx = EVP_MAC_CTX_new(mac)) == NULL
        || !EVP_MAC_init(ctx, (const unsigned char *)key, strlen(key),
                         params))
        goto err;

    while ( (read_l = read(STDIN_FILENO, buf, sizeof(buf))) &gt; 0) {
        if (!EVP_MAC_update(ctx, buf, read_l))
            goto err;
    }

    if (!EVP_MAC_final(ctx, buf, &amp;final_l, sizeof(buf)))
        goto err;

    printf(&quot;Result: &quot;);
    for (i = 0; i &lt; final_l; i++)
        printf(&quot;%02X&qu