[27] pry(main)> secret='100057108055106048110037051094112064114038050069035073097053043122033082121074107056090102067'
=> "100057108055106048110037051094112064114038050069035073097053043122033082121074107056090102067"
[28] pry(main)> s=SecretSharing::Shamir.new(5,3)
=> #<SecretSharing::Shamir:0x0000000771f820
@k=3,
@n=5,
@received_shares=[],
@secret=nil,
@shares=[]>
[29] pry(main)> s.set_fixed_secret(secret)
=> #<OpenSSL::BN:0x0000000784c810>
[30] pry(main)> shares=s.shares.map(&:to_s)
=> ["001FF69184824D423CC4BA75B320143BB541358BC03C0DF81BC899DF25F267E3B334304E7DD81807DB5A4D",
"00279F04A8FE67F4331423AE9B867529800816314A1B77ED518F1390073495648F2FE98411547D3E6B8A4D",
"003A0B40BA0C9D4FCD6AF67D7D8827460B297031517EC08C011997F1EAA843EFF9CA0A88CA92EB6DAB614D",
"004173B45B7ACED550BC932E259252A9156A5438BD665E7D42A682704D04D7385F302935CA9936294607E4D",
"005F2F13A1DF5803EE2ED8DD2E5D7F0B627B9040D8D0EDC5CD7AC0C8B82424267AD983FFAE55E01E06BF4D"]
[31] pry(main)> r=SecretSharing::Shamir.new(3)
=> #<SecretSharing::Shamir:0x000000078f4880
@k=3,
@n=3,
@received_shares=[],
@secret=nil,
@shares=[]>
[32] pry(main)> r<<shares[0]
=> false
[33] pry(main)> r<<shares[1]
=> false
[34] pry(main)> r<<shares[4]
OpenSSL::BNError: no inverse
from /home/assaf/.rvm/gems/ruby-2.0.0-p353/gems/secretsharing-0.3/lib/secretsharing/shamir.rb:225:in `mod_inverse'
[35] pry(main)>
[36] pry(main)> r2=SecretSharing::Shamir.new(3)
=> #<SecretSharing::Shamir:0x00000006119dc8
@k=3,
@n=3,
@received_shares=[],
@secret=nil,
@shares=[]>
[37] pry(main)> r2<<shares[2]
=> false
[38] pry(main)> r2<<shares[1]
=> false
[39] pry(main)> r2<<shares[0]
=> true
[40] pry(main)> r2.secret.to_s
=> "100057108055106048110037051094112064114038050069035073097053043122033082121074107056090102067"
[41] pry(main)>