Class: ECC::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/elliptic-lite/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(g:, n:) ⇒ Group

add generator alias for g - why? why not? add order alias for n - why? why not?



57
58
59
60
61
62
# File 'lib/elliptic-lite/base.rb', line 57

def initialize( g:, n: )
  @g, @n = g, n

  ## note: generator point (scalar multiplied by n - group order results in infinity point)
  ## pp @n*@g  #=> Point(:infinity)
end

Instance Attribute Details

#gObject (readonly)

Returns the value of attribute g.



54
55
56
# File 'lib/elliptic-lite/base.rb', line 54

def g
  @g
end

#nObject (readonly)

Returns the value of attribute n.



54
55
56
# File 'lib/elliptic-lite/base.rb', line 54

def n
  @n
end

Instance Method Details

#point(*args) ⇒ Object

note: get point class from generator point



65
# File 'lib/elliptic-lite/base.rb', line 65

def point( *args )  @g.class.new( *args );  end