<div dir="ltr">Hi!<br><div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-28 10:48 GMT+01:00 Andreas Schultz <span dir="ltr"><<a href="mailto:aschultz@tpip.net" target="_blank">aschultz@tpip.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
----- On 27 Oct, 2014, at 23:24, semmit mondo <a href="mailto:semmitmondo@freemail.hu">semmitmondo@freemail.hu</a> wrote:<br>
<br>
> Yes and no.<br>
> According to the source of the crypto module generate_key/3<br>
> does accept a private key only for a few encryption method types.<br>
> This is the only function head that matches ecdh:<br>
> generate_key(ecdh, Curve, undefined) -> ...<br>
> There's no definition for ecdh with a 3rd param that is not<br>
> undefined. ...and generate_key/2 calls the above one:<br>
> generate_key(Type, Params) -><br>
> generate_key(Type, Params, undefined).<br>
> It would be the function I'm after...<br>
<br>
</span>The function you are looking for is ec_key_new in lib/crypto/c_src/crypto.c. That<br>
function is not exported to the Erlang world (originally it was in some faschion,<br>
but the crypto API restructuring un-exported it).<br>
<br></blockquote><div><br><br></div><div>Humm that was a very big refactor and it sounds like we might have missed an aspect.<br>The function should probably be made available through generate_key/3. <br><br></div><div><br></div><div>Regards Ingela Erlang/OTP Team - Ericsson AB<br></div><div><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Andreas<br>
<span class=""><br>
><br>
> Ingela Andin <<a href="mailto:ingela.andin@gmail.com">ingela.andin@gmail.com</a>> írta:<br>
><br>
><br>
> Hi!<br>
> There is also a function crypto:generate_key/3 that takes a private key as third<br>
> argument, maybe that is what you want?<br>
> Regards Ingela Erlang/OTP team - Ericsson AB<br>
> 2014-10-21 17:00 GMT+02:00 semmit mondo < <a href="mailto:semmitmondo@freemail.hu">semmitmondo@freemail.hu</a> > :<br>
><br>
><br>
> Hi,<br>
> How can I generate an ECDSA public key from the private one using crypto?<br>
> All I can do with it is to generate a public and private key pair at once:<br>
> {Pub, Priv} = crypto:generate_key(ecdh, prime239v3).<br>
> but can't calculate the public key if the private key was known beforehand.<br>
> (prime239v3 isn't important, it could be any EC curve...)<br>
><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</span>--<br>
--<br>
Dipl. Inform.<br>
Andreas Schultz<br>
<br>
email: <a href="mailto:as@travelping.com">as@travelping.com</a><br>
phone: <a href="tel:%2B49-391-819099-224" value="+49391819099224">+49-391-819099-224</a><br>
mobil: <a href="tel:%2B49-170-2226073" value="+491702226073">+49-170-2226073</a><br>
<br>
------------------- enabling your networks -------------------<br>
<br>
Travelping GmbH phone: <a href="tel:%2B49-391-819099229" value="+49391819099229">+49-391-819099229</a><br>
Roentgenstr. 13 fax: <a href="tel:%2B49-391-819099299" value="+49391819099299">+49-391-819099299</a><br>
D-39108 Magdeburg email: <a href="mailto:info@travelping.com">info@travelping.com</a><br>
GERMANY web: <a href="http://www.travelping.com" target="_blank">http://www.travelping.com</a><br>
<br>
Company Registration: Amtsgericht Stendal Reg No.: HRB 10578<br>
Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780<br>
--------------------------------------------------------------<br>
</blockquote></div><br></div></div></div>