<div dir="ltr"><div dir="auto"><span class="gmail_default" style="font-family:arial,sans-serif">I have to correct myself, in `master` (and very soon in the 3.0.0 alpha1 release) `pkeyutl` already has support for sign/verify files with Ed25519 keys.<br><br>```<br>λ /tmp/test25519/ ### Ensure OpenSSL dev build is in use for this shell<br>λ /tmp/test25519/ which openssl ; openssl version<br>/opt/openssl-master/bin/openssl<br>OpenSSL 3.0.0-dev xx XXX xxxx (Library: OpenSSL 3.0.0-dev xx XXX xxxx)<br>λ /tmp/test25519/ ### Generate Ed25519 private key<br>λ /tmp/test25519/ openssl genpkey -algorithm Ed25519 -out priv.pem<br>λ /tmp/test25519/ ### Extract pub key from private key<br>λ /tmp/test25519/ openssl pkey -in priv.pem -pubout -out pub.pem<br>λ /tmp/test25519/ ###<br>λ /tmp/test25519/ ### Up to this point all the commands were compatible<br>λ /tmp/test25519/ ### with OpenSSL 1.1.1 releases, the next one is the<br>λ /tmp/test25519/ ### one that requires OpenSSL 3.0.0-dev as `pkeyutl`<br>λ /tmp/test25519/ ### now has support for `-rawin` which is required<br>λ /tmp/test25519/ ### for signing/veryfing files with Ed25519 keys. <br>λ /tmp/test25519/ ###<br>λ /tmp/test25519/ ### Generate a signature `sig.dat` for the file<br>λ /tmp/test25519/ ### `/bin/ls` using `priv.key` private Ed25519 key;<br>λ /tmp/test25519/ openssl pkeyutl -sign -inkey priv.pem -out sig.dat \<br>    -rawin -in /bin/ls<br>λ /tmp/test25519/ ### Verify the file `/bin/ls` against a signature<br>λ /tmp/test25519/ ### `sig.dat` under the public Ed25519 key `pub.pem`.<br>λ /tmp/test25519/ ### Success is expected.<br>λ /tmp/test25519/ openssl pkeyutl -verify -pubin -inkey pub.pem \<br>    -rawin -in /bin/ls -sigfile sig.dat<br>Signature Verified Successfully<br>λ /tmp/test25519/ ### Verify the file `/bin/echo` against a signature<br>λ /tmp/test25519/ ### `sig.dat` under the public Ed25519 key `pub.pem`.<br>λ /tmp/test25519/ ### Failure is expected.<br>λ /tmp/test25519/ openssl pkeyutl -verify -pubin -inkey pub.pem \<br>    -rawin -in /bin/echo -sigfile sig.dat<br>Signature Verification Failure<br></span></div><div dir="auto"><span class="gmail_default" style="font-family:arial,sans-serif">```</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 22, 2020, 19:12 Viktor Dukhovni <<a href="mailto:openssl-users@dukhovni.org" target="_blank">openssl-users@dukhovni.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Apr 22, 2020 at 01:27:03PM +0200, Nicola Tuveri wrote:<br>
<br>
> Unfortunately at the moment the command line utilities do not support<br>
> generating Ed25519 or Ed448 signatures for files.<br>
> <br>
> The reason is that in OpenSSL at the moment we only support pureEd25519,<br>
> which does not prehash the "message" to be signed, as Viktor mentioned<br>
> before.<br>
<br>
Which means no support in dgst(1), but that manpage suggests pkeyutl(1),<br>
which e.g. for RSA supports signing raw (unhashed input), but sadly the<br>
EVP_PKEY_METHOD for ed25519 has a NULL sign() member, instead, somewhat<br>
ironically, it has a digestsign() method.  This is presumably to<br>
distinguish between the pure and prehash variants.  Therefore, presently<br>
pkeyutl(1) indeed appears to not implement signing and verifying with<br>
ed25519, this looks doable with modest effort.<br>
<br>
-- <br>
    Viktor.<br>
</blockquote></div>