Class: ECC::Group
- Inherits:
-
Object
- Object
- ECC::Group
- Defined in:
- lib/elliptic-lite/base.rb
Instance Attribute Summary collapse
-
#g ⇒ Object
readonly
Returns the value of attribute g.
-
#n ⇒ Object
readonly
Returns the value of attribute n.
Instance Method Summary collapse
-
#initialize(g:, n:) ⇒ Group
constructor
add generator alias for g - why? why not? add order alias for n - why? why not?.
-
#point(*args) ⇒ Object
note: get point class from generator point.
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
#g ⇒ Object (readonly)
Returns the value of attribute g.
54 55 56 |
# File 'lib/elliptic-lite/base.rb', line 54 def g @g end |
#n ⇒ Object (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 |