Class: BSVShimECGroup
- Inherits:
-
Object
- Object
- BSVShimECGroup
- Defined in:
- lib/bsv/primitives/openssl_ec_shim.rb
Overview
Shim Group for secp256k1.
Instance Method Summary collapse
- #curve_name ⇒ Object
- #generator ⇒ Object
-
#initialize(curve_name) ⇒ BSVShimECGroup
constructor
A new instance of BSVShimECGroup.
- #order ⇒ Object
Constructor Details
#initialize(curve_name) ⇒ BSVShimECGroup
Returns a new instance of BSVShimECGroup.
25 26 27 |
# File 'lib/bsv/primitives/openssl_ec_shim.rb', line 25 def initialize(curve_name) raise ArgumentError, "unsupported curve: #{curve_name}" unless curve_name == 'secp256k1' end |
Instance Method Details
#curve_name ⇒ Object
37 38 39 |
# File 'lib/bsv/primitives/openssl_ec_shim.rb', line 37 def curve_name 'secp256k1' end |
#generator ⇒ Object
33 34 35 |
# File 'lib/bsv/primitives/openssl_ec_shim.rb', line 33 def generator @generator ||= BSVShimECPoint.from_secp_point(self, BSV::Primitives::Secp256k1::Point.generator) end |
#order ⇒ Object
29 30 31 |
# File 'lib/bsv/primitives/openssl_ec_shim.rb', line 29 def order @order ||= OpenSSL::BN.new(BSV::Primitives::Secp256k1::N.to_s) end |