107 lines
5.2 KiB
HTML
107 lines
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<style>
|
|
table.head, table.foot { width: 100%; }
|
|
td.head-rtitle, td.foot-os { text-align: right; }
|
|
td.head-vol { text-align: center; }
|
|
div.Pp { margin: 1ex 0ex; }
|
|
</style>
|
|
<link rel="stylesheet" href="style.css" type="text/css" media="all"/>
|
|
<title>CRYPTO_FROM_EDDSA_PRIVATE(3MONOCYPHER)</title>
|
|
</head>
|
|
<body>
|
|
<table class="head">
|
|
<tr>
|
|
<td class="head-ltitle">CRYPTO_FROM_EDDSA_PRIVATE(3MONOCYPHER)</td>
|
|
<td class="head-vol">3MONOCYPHER</td>
|
|
<td class="head-rtitle">CRYPTO_FROM_EDDSA_PRIVATE(3MONOCYPHER)</td>
|
|
</tr>
|
|
</table>
|
|
<div class="manual-text">
|
|
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
|
<b class="Nm" title="Nm">crypto_from_eddsa_private</b>,
|
|
<b class="Nm" title="Nm">crypto_from_eddsa_public</b> —
|
|
<span class="Nd" title="Nd">conversion of key pairs for EdDSA with BLAKE2b to
|
|
X25519 key pairs</span>
|
|
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
|
<b class="In" title="In">#include
|
|
<<a class="In" title="In">monocypher.h</a>></b>
|
|
<div class="Pp"></div>
|
|
<var class="Ft" title="Ft">void</var>
|
|
<br/>
|
|
<b class="Fn" title="Fn">crypto_from_eddsa_private</b>(<var class="Fa" title="Fa">uint8_t
|
|
x25519[32]</var>, <var class="Fa" title="Fa">const uint8_t eddsa[32]</var>);
|
|
<div class="Pp"></div>
|
|
<var class="Ft" title="Ft">void</var>
|
|
<br/>
|
|
<b class="Fn" title="Fn">crypto_from_eddsa_public</b>(<var class="Fa" title="Fa">uint8_t
|
|
x25519[32]</var>, <var class="Fa" title="Fa">const uint8_t eddsa[32]</var>);
|
|
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
|
These functions convert keys for use with
|
|
<a class="Xr" title="Xr" href="crypto_sign.html">crypto_sign(3monocypher)</a>
|
|
(EdDSA with the BLAKE2b hash function) to keys for use with
|
|
<a class="Xr" title="Xr" href="crypto_key_exchange.html">crypto_key_exchange(3monocypher)</a>
|
|
and
|
|
<a class="Xr" title="Xr" href="crypto_x25519.html">crypto_x25519(3monocypher)</a>.
|
|
This may be useful in some resource-constrained contexts or when no other key
|
|
is available (for example, when retrieving SSH public keys from GitHub and
|
|
reusing the SSH public keys as X25519 public keys).
|
|
<div class="Pp"></div>
|
|
The <b class="Fn" title="Fn">crypto_from_eddsa_private</b>() function converts
|
|
an EdDSA (with BLAKE2b) private key to an X25519 private key. The
|
|
<b class="Fn" title="Fn">crypto_from_eddsa_public</b>() function converts an
|
|
EdDSA public key to an X25519 public key.
|
|
<div class="Pp"></div>
|
|
X25519 key pairs cannot be converted back to EdDSA key pairs. The conversion of
|
|
private keys is specific to EdDSA with BLAKE2b because of the way EdDSA works.
|
|
In particular, this means that the output of
|
|
<b class="Fn" title="Fn">crypto_from_eddsa_private</b>() differs from
|
|
<a class="Xr" title="Xr" href="crypto_from_ed25519_private.html">crypto_from_ed25519_private(3monocypher)</a>
|
|
in the optional code. However, the output of
|
|
<b class="Fn" title="Fn">crypto_from_eddsa_public</b>() is identical to
|
|
<a class="Xr" title="Xr" href="crypto_from_ed25519_public.html">crypto_from_ed25519_public(3monocypher)</a>.
|
|
<div class="Pp"></div>
|
|
The arguments are:
|
|
<dl class="Bl-tag">
|
|
<dt class="It-tag"> </dt>
|
|
<dd class="It-tag"> </dd>
|
|
<dt class="It-tag"><var class="Fa" title="Fa">eddsa</var></dt>
|
|
<dd class="It-tag">The signing public key or private key to convert to a
|
|
X25519 public key or private key, respectively.</dd>
|
|
<dt class="It-tag"> </dt>
|
|
<dd class="It-tag"> </dd>
|
|
<dt class="It-tag"><var class="Fa" title="Fa">x25519</var></dt>
|
|
<dd class="It-tag">The converted private key or public key.</dd>
|
|
</dl>
|
|
<div class="Pp"></div>
|
|
The arguments may overlap or point at the same buffer.
|
|
<h1 class="Sh" title="Sh" id="RETURN_VALUES"><a class="selflink" href="#RETURN_VALUES">RETURN
|
|
VALUES</a></h1>
|
|
These functions return nothing. They cannot fail.
|
|
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
|
|
ALSO</a></h1>
|
|
<a class="Xr" title="Xr" href="crypto_key_exchange_public_key.html">crypto_key_exchange_public_key(3monocypher)</a>,
|
|
<a class="Xr" title="Xr" href="crypto_sign_public_key.html">crypto_sign_public_key(3monocypher)</a>,
|
|
<a class="Xr" title="Xr" href="intro.html">intro(3monocypher)</a>
|
|
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
|
The <b class="Fn" title="Fn">crypto_from_eddsa_private</b>() and
|
|
<b class="Fn" title="Fn">crypto_from_eddsa_public</b>() functions first
|
|
appeared in Monocypher 3.1.0.
|
|
<h1 class="Sh" title="Sh" id="SECURITY_CONSIDERATIONS"><a class="selflink" href="#SECURITY_CONSIDERATIONS">SECURITY
|
|
CONSIDERATIONS</a></h1>
|
|
It is generally considered poor form to reuse the same key for different
|
|
purposes. While this conversion is technically safe, avoid these functions
|
|
nonetheless unless you are particularly resource-constrained or have some
|
|
other kind of hard requirement. It is otherwise an unnecessary risk
|
|
factor.</div>
|
|
<table class="foot">
|
|
<tr>
|
|
<td class="foot-date">March 25, 2020</td>
|
|
<td class="foot-os">Linux 4.15.0-106-generic</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|