Class: ECC::Curve
- Inherits:
-
Object
- Object
- ECC::Curve
- Defined in:
- lib/elliptic-lite/base.rb
Instance Attribute Summary collapse
-
#a ⇒ Object
readonly
Returns the value of attribute a.
-
#b ⇒ Object
readonly
Returns the value of attribute b.
-
#f ⇒ Object
readonly
Returns the value of attribute f.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#field?(other) ⇒ Boolean
matching field (operations type) class?.
-
#initialize(a:, b:, f: IntegerOp) ⇒ Curve
constructor
field (operations type) class.
Constructor Details
Instance Attribute Details
#a ⇒ Object (readonly)
Returns the value of attribute a.
23 24 25 |
# File 'lib/elliptic-lite/base.rb', line 23 def a @a end |
#b ⇒ Object (readonly)
Returns the value of attribute b.
23 24 25 |
# File 'lib/elliptic-lite/base.rb', line 23 def b @b end |
#f ⇒ Object (readonly)
Returns the value of attribute f.
23 24 25 |
# File 'lib/elliptic-lite/base.rb', line 23 def f @f end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/elliptic-lite/base.rb', line 36 def ==(other) if other.is_a?( Curve ) && field?( other ) self.a == other.a && self.b == other.b else false end end |
#field?(other) ⇒ Boolean
matching field (operations type) class?
32 33 34 |
# File 'lib/elliptic-lite/base.rb', line 32 def field?( other ) ## matching field (operations type) class? @f == other.f end |