diff options
author | emboss <emboss@ruby-lang.org> | 2012-06-10 02:38:40 +0000 |
---|---|---|
committer | emboss <emboss@ruby-lang.org> | 2012-06-10 02:38:40 +0000 |
commit | e432c4e66ed79624b61c4b1fd20dc8a569923ac6 (patch) | |
tree | ab0dfb40d1d83f0b20de862e2dded4133284fc02 /test | |
parent | e8ba6aa35e7e5980b85cab26404a6152fd29533e (diff) | |
download | ruby-openssl-history-e432c4e66ed79624b61c4b1fd20dc8a569923ac6.tar.gz |
* ext/openssl/ossl_pkey_ec.c
test/openssl/test_pkey_ec.rb: Add support for EC_POINT_mul.
Patch provided by Sambasiva Suda. Thanks!
[ruby-core:44408][ruby-trunk - Feature #6310]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/test_pkey_ec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_pkey_ec.rb b/test/test_pkey_ec.rb index a663bb0..7b266a7 100644 --- a/test/test_pkey_ec.rb +++ b/test/test_pkey_ec.rb @@ -184,6 +184,22 @@ class OpenSSL::TestEC < Test::Unit::TestCase assert(pem) end + def test_ec_point_mul + ec = OpenSSL::TestUtils::TEST_KEY_EC_P256V1 + p1 = ec.public_key + bn1 = OpenSSL::BN.new('10') + bn2 = OpenSSL::BN.new('20') + + p2 = p1.mul(bn1) + assert(p1.group == p2.group) + p2 = p1.mul(bn1, bn2) + assert(p1.group == p2.group) + p2 = p1.mul([bn1, bn2], [p1]) + assert(p1.group == p2.group) + p2 = p1.mul([bn1, bn2], [p1], bn2) + assert(p1.group == p2.group) + end + # test Group: asn1_flag, point_conversion end |