r */</code></pre>

<p>Second step: compute the ECDSA signature of a SHA-256 hash value using ECDSA_do_sign():</p>

<pre><code>sig = ECDSA_do_sign(digest, 32, eckey);
if (sig == NULL)
    /* error */</code></pre>

<p>or using ECDSA_sign():</p>

<pre><code>unsigned char *buffer, *pp;
int buf_len;

buf_len = ECDSA_size(eckey);
buffer = OPENSSL_malloc(buf_len);
pp = buffer;
if (ECDSA_sign(0, dgst, dgstlen, pp, &amp;buf_len, eckey) == 0)
    /* error */</code></pre>

<p>Third step: verify the created ECDSA signa