{"id":3981,"date":"2022-12-20T17:28:35","date_gmt":"2022-12-20T20:28:35","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ed25519-man7-2\/"},"modified":"2022-12-20T17:28:35","modified_gmt":"2022-12-20T20:28:35","slug":"ed25519-man7-2","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ed25519-man7-2\/","title":{"rendered":"ED25519 (man7)"},"content":{"rendered":"<h1 align=\"center\">ED25519<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Ed25519, Ed448 \u2212 EVP_PKEY Ed25519 and Ed448 support<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>Ed25519<\/b> and <b>Ed448<\/b> <small>EVP_PKEY<\/small> implementation supports key generation, one-shot digest sign and digest verify using PureEdDSA and <b>Ed25519<\/b> or <b>Ed448<\/b> (see <small>RFC8032<\/small> ). It has associated private and public key formats compatible with <small>RFC 8410.<\/small><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">No additional parameters can be set during key generation, one-shot signing or verification. In particular, because PureEdDSA is used, a digest must <b><small>NOT<\/small><\/b> be specified when signing or verifying.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The PureEdDSA algorithm does not support the streaming mechanism of other signature algorithms using, for example, <b>EVP_DigestUpdate()<\/b>. The message to sign or verify must be passed using the one-shot <b>EVP_DigestSign()<\/b> and <b>EVP_DigestVerify()<\/b> functions.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When calling <b>EVP_DigestSignInit()<\/b> or <b>EVP_DigestVerifyInit()<\/b>, the digest <b>type<\/b> parameter <b><small>MUST<\/small><\/b> be set to <b><small>NULL<\/small><\/b> .<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Applications wishing to sign certificates (or other structures such as CRLs or certificate requests) using Ed25519 or Ed448 can either use <b>X509_sign()<\/b> or <b>X509_sign_ctx()<\/b> in the usual way.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A context for the <b>Ed25519<\/b> algorithm can be obtained by calling:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED25519, NULL);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For the <b>Ed448<\/b> algorithm a context can be obtained by calling:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED448, NULL);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Ed25519 or Ed448 private keys can be set directly using <b>EVP_PKEY_new_raw_private_key<\/b>(3) or loaded from a PKCS#8 private key file using <b>PEM_read_bio_PrivateKey<\/b>(3) (or similar function). Completely new keys can also be generated (see the example below). Setting a private key also sets the associated public key.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Ed25519 or Ed448 public keys can be set directly using <b>EVP_PKEY_new_raw_public_key<\/b>(3) or loaded from a SubjectPublicKeyInfo structure in a <small>PEM<\/small> file using <b>PEM_read_bio_PUBKEY<\/b>(3) (or similar function).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Ed25519 and Ed448 can be tested within <b>speed<\/b>(1) application since version 1.1.1. Valid algorithm names are <b>ed25519<\/b>, <b>ed448<\/b> and <b>eddsa<\/b>. If <b>eddsa<\/b> is specified, then both Ed25519 and Ed448 are benchmarked.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This example generates an <b><small>ED25519<\/small><\/b> private key and writes it to standard output in <small>PEM<\/small> format:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">#include <openssl\/evp.h> <br \/> #include <openssl\/pem.h> <br \/> &#8230; <br \/> EVP_PKEY *pkey = NULL; <br \/> EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED25519, NULL); <br \/> EVP_PKEY_keygen_init(pctx); <br \/> EVP_PKEY_keygen(pctx, &#038;pkey); <br \/> EVP_PKEY_CTX_free(pctx); <br \/> PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>EVP_PKEY_CTX_new<\/b>(3), <b>EVP_PKEY_keygen<\/b>(3), <b>EVP_DigestSignInit<\/b>(3), <b>EVP_DigestVerifyInit<\/b>(3),<\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright 2017\u22122020 The OpenSSL Project Authors. All Rights Reserved.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Licensed under the OpenSSL license (the &#8220;License&#8221;). You may not use this file except in compliance with the License. You can obtain a copy in the file <small>LICENSE<\/small> in the source distribution or at <https:\/\/www.openssl.org\/source\/license.html>.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Ed25519, Ed448 \u2212 EVP_PKEY Ed25519 and Ed448 support <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,1070,972],"class_list":["post-3981","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-ed448","tag-man7"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3981"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3981\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}