[erlang-questions] crypto ECDSA private key -> public

Andreas Schultz aschultz@REDACTED
Wed Oct 29 16:43:47 CET 2014


Hi Semmit,

The attached patch adds crypto:generate_key/3 with private key for ecdh.
Sample:

Erlang/OTP 18 [DEVELOPMENT] [erts-7.0] [source-937f447] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> {Pub, Priv} = crypto:generate_key(ecdh, secp112r1).
{<<4,40,132,38,255,209,253,37,204,31,26,207,136,215,167,
   143,157,58,176,10,191,31,177,127,84,17,123,89,...>>,
 <<52,78,247,5,151,208,119,88,134,92,144,155,48,10>>}
2> {Pub, Priv} = crypto:generate_key(ecdh, secp112r1, Priv).
{<<4,40,132,38,255,209,253,37,204,31,26,207,136,215,167,
   143,157,58,176,10,191,31,177,127,84,17,123,89,...>>,
 <<52,78,247,5,151,208,119,88,134,92,144,155,48,10>>}

The only test I have done is the shell snippet above. I don't have the time
(or motivation) to update the documentation and write the unit tests for this.

So, if you really want this in R18, you'll have to prepare the pull request
yourself (add documentation and tests).

Andreas

----- On 29 Oct, 2014, at 14:13, Ingela Andin ingela.andin@REDACTED wrote:

> Hi!
> 
> I think that generate:key/3 should do the job, but the only way to guarantee
> that it will do it soon is if someone
> contributes the code. Probably not a very big job but probably not on top of
> Ericsson's priority list either so I can not
> promise anything regarding when we have time to do it.
> 
> Regards Ingela Erlang/OTP Team - Ericsson AB
> 
> 
> 2014-10-29 13:02 GMT+01:00 semmit mondo < semmitmondo@REDACTED > :
> 
> 
> 
> 
> 
> 
> Humm that was a very big refactor and it sounds like we might have missed an
> aspect.
> The function should probably be made available through generate_key/3.
> Does this mean that I can hope generate_key/3 will do the job soon,
> perhaps in the next release?
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-- 
-- 
Dipl. Inform.
Andreas Schultz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generate_key_ecdh_private.patch
Type: text/x-patch
Size: 3109 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141029/ea0b4ec3/attachment.bin>


More information about the erlang-questions mailing list