<div dir="ltr"><div><div><div><div><div><div><div>Hi,<br><br></div>Executing this code:<br><br>crypto:generate_key(ecdh, secp112r2).<br><br></div>on centos 6/7 I get this error:<br><br>1> crypto:generate_key(ecdh, secp112r2).<br>** exception error: bad argument<br>     in function  crypto:ec_key_generate/2<br>        called as crypto:ec_key_generate({{prime_field,<br>                                              <<219,124,42,191,98,227,94,102,128,118,190,173,32,139>>},<br>                                          {<<97,39,194,76,5,243,138,10,170,246,92,14,240,44>>,<br>                                           <<81,222,241,129,93,181,237,116,252,195,76,133,215,9>>,<br>                                           <<0,39,87,161,17,77,105,110,103,104,117,97,81,117,83,22,<br>                                             192,94,11,212>>},<br>                                          <<4,75,163,10,181,232,146,180,225,100,157,208,146,134,67,<br>                                            173,205,70,245,136,46,55,71,222,243,...>>,<br>                                          <<54,223,10,175,216,184,215,89,124,161,5,32,208,75>>,<br>                                          <<4>>},<br>                                         undefined)<br>2> <br><br><br></div>The same code on Ubuntu works correctly:<br><br>4> crypto:generate_key(ecdh, secp112r2).<br>{<<4,80,204,3,54,107,208,108,63,20,107,12,38,106,212,97,<br>   102,31,150,82,196,11,163,51,255,158,213,19,...>>,<br> <<44,243,165,184,148,43,124,19,234,144,220,206,39,234>>}<br>5><br><br><br><br></div>Notes: <br>I tried with different Erlang VM from starting from 18.3.<br></div>I tried also to rebuild the last OPENSSL version on centos without success.<br><br><br></div>The code above is a semplication from my original problem that is the follow:<br>Args={{prime_field,<<255,255,255,255,255,255,255,255,255,255,<br>255,255,255,255,255,255,0,0,0,0,0,0,0,0,<br>0,0,0,1>>},<br>{<<"ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿþ">>,<br><<180,5,10,133,12,4,179,171,245,65,50,86,80,68,176,183,<br>215,191,216,186,39,11,57,67,35,85,255,180>>,<br><<189,113,52,71,153,213,199,252,220,69,181,159,163,185,<br>171,143,106,148,139,197>>},<br><<4,183,14,12,189,107,180,191,127,50,19,144,185,74,3,193,<br>211,86,194,17,34,52,50,128,214,17,92,29,33,189,55,99,<br>136,181,247,35,251,76,34,223,230,205,67,117,160,90,7,<br>71,100,68,213,129,153,133,0,126,52>>,<br><<255,255,255,255,255,255,255,255,255,255,255,255,255,<br>255,22,162,224,184,240,62,19,221,41,69,92,92,42,61>>,<br><<1>>}.<br><br>crypto:generate_key(ecdh, Args).<br><br></div>it works on ubuntu and not in Centos 6/7<br><div><div><div><br></div><div>Thank you!<br></div><div><div><div><div><div><div><br><br>GaS</div></div></div></div></div></div></div></div></div>