Expose Sodium::Sign::SecretKey#seed.

This commit is contained in:
Didactic Drunk 2020-07-18 22:21:09 -07:00
parent c998625056
commit f0213b88c8
2 changed files with 7 additions and 0 deletions

View File

@ -52,6 +52,8 @@ describe Sodium::Sign::SecretKey do
key2 = Sodium::Sign::SecretKey.new seed: seed
key1.to_slice.should eq key2.to_slice
key1.public_key.to_slice.should eq key2.public_key.to_slice
key1.seed.should eq seed
key1.seed.should eq key2.seed
end
it "signs and verifies" do

View File

@ -70,6 +70,11 @@ module Sodium
end
end
def seed
# BUG: Generate seed if not set.
@seed.not_nil!.to_slice
end
# Signs message and returns a detached signature.
# Verify using `secret_key.public_key.verify_detached(message, sig)`
def sign_detached(message)