Class: BLS::Fr
Overview
Finite field over r.
Constant Summary collapse
- ORDER =
BLS::Curve::R
- ZERO =
Fr.new(0)
- ONE =
Fr.new(1)
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Fr
constructor
A new instance of Fr.
Methods included from Field
#==, #add, #div, #invert, #multiply, #negate, #pow, #square, #subtract, #to_s, #zero?
Constructor Details
#initialize(value) ⇒ Fr
Returns a new instance of Fr.
109 110 111 112 113 |
# File 'lib/bls/field.rb', line 109 def initialize(value) raise ArgumentError, 'value must be Integer.' unless value.is_a?(Integer) @value = BLS.mod(value, ORDER) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
107 108 109 |
# File 'lib/bls/field.rb', line 107 def value @value end |