class ECDSA::Signature

Instances of this class represents ECDSA signatures, which are simply a pair of integers named ‘r` and `s`.

Attributes

r[R]

@return (Integer)

s[R]

@return (Integer)

Public Class Methods

new(r, s) click to toggle source

@param r (Integer) the value of r. @param s (Integer) the value of s.

# File lib/ecdsa/signature.rb, line 13
def initialize(r, s)
  @r, @s = r, s
  r.is_a?(Integer) or raise ArgumentError, 'r is not an integer.'
  s.is_a?(Integer) or raise ArgumentError, 's is not an integer.'
end

Public Instance Methods

components() click to toggle source

Returns an array containing ‘r` first and `s` second. @return (Array)

# File lib/ecdsa/signature.rb, line 21
def components
  [r, s]
end