Class: FROST::SecretShare
- Inherits:
-
Object
- Object
- FROST::SecretShare
- Defined in:
- lib/frost/secret_share.rb
Overview
A secret share generated by performing a (t-out-of-n) secret sharing scheme.
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#share ⇒ Object
readonly
Returns the value of attribute share.
Instance Method Summary collapse
-
#initialize(identifier, share, group) ⇒ SecretShare
constructor
Generate secret share.
-
#to_key ⇒ FROST::SigningKey
Generate signing share key.
-
#to_point ⇒ ECDSA::Point
Compute public key.
Constructor Details
#initialize(identifier, share, group) ⇒ SecretShare
Generate secret share.
11 12 13 14 15 16 17 18 19 |
# File 'lib/frost/secret_share.rb', line 11 def initialize(identifier, share, group) raise ArgumentError, "identifier must be Integer." unless identifier.is_a?(Integer) raise ArgumentError, "share must be Integer." unless share.is_a?(Integer) raise ArgumentError, "group must be ECDSA::Group" unless group.is_a?(ECDSA::Group) @identifier = identifier @share = share @group = group end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
6 7 8 |
# File 'lib/frost/secret_share.rb', line 6 def group @group end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/frost/secret_share.rb', line 4 def identifier @identifier end |
#share ⇒ Object (readonly)
Returns the value of attribute share.
5 6 7 |
# File 'lib/frost/secret_share.rb', line 5 def share @share end |
Instance Method Details
#to_key ⇒ FROST::SigningKey
Generate signing share key.
29 30 31 |
# File 'lib/frost/secret_share.rb', line 29 def to_key FROST::SigningKey.new(share, group) end |
#to_point ⇒ ECDSA::Point
Compute public key.
23 24 25 |
# File 'lib/frost/secret_share.rb', line 23 def to_point group.generator * share end |