Class: BSVShimECGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/primitives/openssl_ec_shim.rb

Overview

Shim Group for secp256k1.

Instance Method Summary collapse

Constructor Details

#initialize(curve_name) ⇒ BSVShimECGroup

Returns a new instance of BSVShimECGroup.

Raises:

  • (ArgumentError)


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_nameObject



37
38
39
# File 'lib/bsv/primitives/openssl_ec_shim.rb', line 37

def curve_name
  'secp256k1'
end

#generatorObject



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

#orderObject



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