From: Nokan Emiro Date: 2012-10-28T18:46:36+09:00 Subject: Re: OpenSSL ECDSA public key from private --f46d044787c5b14a5504cd1b6dc4 Content-Type: text/plain; charset=UTF-8 > > > #mul method. > > It can be called in four ways: > > point.mul(bn) => point > point.mul(bn, bn) => point > point.mul([bn], [point]) => point > point.mul([bn], [point], bn) => point > > The EC_POINT_mul function is called if you pass one or two OpenSSL::BN > objects to it. > > If I execute this script: > > require 'openssl' > key=OpenSSL::PKey::EC.new('secp256k1') > bn1=OpenSSL::BN::new('123') > bn2=OpenSSL::BN::new('456') > pubkey=OpenSSL::PKey::EC::Point.new(key.group).mul(bn1,bn2) > p pubkey.to_bn.to_s > > I get a beautiful 155-digit number. Then, I have no idea about what > all these big numbers should be... > I'm sure I made a mistake but for me this script does not work. The problem is that OpenSSL::PKey::EC::Point does not have a #mul method in it. 1.9.3-p194 :001 > require 'openssl' => true 1.9.3-p194 :002 > key = OpenSSL::PKey::EC.new 'secp256k1' => # 1.9.3-p194 :003 > OpenSSL::PKey::EC::Point.new(key.group).methods.grep /mul/ => [] 1.9.3-p194 :004 > :( --f46d044787c5b14a5504cd1b6dc4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

#mul method.

It can be called in four ways:

=C2=A0 =C2=A0point.mul(bn) =C2=A0=3D> point
=C2=A0 =C2=A0point.mul(bn, bn) =3D> point
=C2=A0 =C2=A0point.mul([bn], [point]) =3D> point
=C2=A0 =C2=A0point.mul([bn], [point], bn) =3D> point

The EC_POINT_mul function is called if you pass one or two OpenSSL::BN
objects to it.

If I execute this script:

require 'openssl'
key=3DOpenSSL::PKey::EC.new('secp256k1')
bn1=3DOpenSSL::BN::new('123')
bn2=3DOpenSSL::BN::new('456')
pubkey=3DOpenSSL::PKey::EC::Point.new(key.group).mul(bn1,bn2)
p pubkey.to_bn.to_s

I get a beautiful 155-digit number. Then, I have no idea about what
all these big numbers should be...

I= 9;m sure I made a mistake but for me this script does not work. =C2=A0Theproblem is that=C2=A0OpenSSL::PKey::EC::Point does not have a #mul
=
method in it.

1.9.3-p194 :001 > require &#= 39;openssl'
=C2=A0=3D> true=C2=A0
1.9.3-p194 :00= 2 > key =3D OpenSSL::PKey::EC.new 'secp256k1'
=C2=A0= =3D> #<OpenSSL::PKey::EC:0x00000001cbb960>=C2=A0
1.9.3-p194 :003 > OpenSSL::PKey::EC::Point.new(key.group).methods.g= rep /mul/
=C2=A0=3D> []=C2=A0
1.9.3-p194 :004 >= =C2=A0

:(

--f46d044787c5b14a5504cd1b6dc4--