Class: WOTS::Signature
Overview
WOTS+ signature.
Instance Attribute Summary collapse
-
#param ⇒ Object
readonly
Returns the value of attribute param.
-
#sigs ⇒ Object
readonly
Returns the value of attribute sigs.
Instance Method Summary collapse
-
#initialize(param, sigs) ⇒ Signature
constructor
A new instance of Signature.
Methods included from Util
#bin_to_hex, #hex_string?, #hex_to_bin
Constructor Details
#initialize(param, sigs) ⇒ Signature
Returns a new instance of Signature.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/wots/signature.rb', line 8 def initialize(param, sigs) raise ArgumentError, "param must be WOTS::Param." unless param.is_a?(WOTS::Param) raise ArgumentError, "sigs must be Array." unless sigs.is_a?(Array) raise ArgumentError, "The length of sigs must be the same as param#len." unless sigs.length == param.len sigs.each do |sig| raise ArgumentError, "sig must be hex string." unless hex_string?(sig) raise ArgumentError, "sig must be #{param.n} bytes." unless hex_to_bin(sig).bytesize == param.n end @param = param @sigs = sigs end |
Instance Attribute Details
#param ⇒ Object (readonly)
Returns the value of attribute param.
6 7 8 |
# File 'lib/wots/signature.rb', line 6 def param @param end |
#sigs ⇒ Object (readonly)
Returns the value of attribute sigs.
6 7 8 |
# File 'lib/wots/signature.rb', line 6 def sigs @sigs end |