Does OpenSSL -sign for ECDSA apply ASN1 encoding to the hash before signing?
<p>This SO question <a href="https://stackoverflow.com/questions/25421399/ecdsa-sign-using-openssl-without-asn1-encoding-the-hash">ECDSA sign using OpenSSL without ASN1 encoding the hash</a> states the OpenSSL perfoms ASN1 encoding to the hash before signing it.</p>

<p>In other words it states that OpenSSL performs the following steps when for an Elliptic curve key -sign is called:
a.  Calculate H = Hash(M)
b.  Encode H into ASN1 standard- H’
c.  Sign H’</p>

<p>And thus to avoid applyting step b it's neccessary to first calculate the digest, and then sign the digest using raw signing - pkeyutl for elliptic curver keys</p>

<p>However when I run BOTH -sign and -dgst+ -pkeyutl I am able to verify the signature using -verify in both cases. This implies that ASN1 encoding is NOT being applied to the hash.</p>

<p>Can anyone throw some light on this topic? I was not able to find documentation in the OpenSSL documentation.</p>