Expose Sodium::Sign::SecretKey#seed.
This commit is contained in:
parent
c998625056
commit
f0213b88c8
@ -52,6 +52,8 @@ describe Sodium::Sign::SecretKey do
|
|||||||
key2 = Sodium::Sign::SecretKey.new seed: seed
|
key2 = Sodium::Sign::SecretKey.new seed: seed
|
||||||
key1.to_slice.should eq key2.to_slice
|
key1.to_slice.should eq key2.to_slice
|
||||||
key1.public_key.to_slice.should eq key2.public_key.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
|
end
|
||||||
|
|
||||||
it "signs and verifies" do
|
it "signs and verifies" do
|
||||||
|
@ -70,6 +70,11 @@ module Sodium
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def seed
|
||||||
|
# BUG: Generate seed if not set.
|
||||||
|
@seed.not_nil!.to_slice
|
||||||
|
end
|
||||||
|
|
||||||
# Signs message and returns a detached signature.
|
# Signs message and returns a detached signature.
|
||||||
# Verify using `secret_key.public_key.verify_detached(message, sig)`
|
# Verify using `secret_key.public_key.verify_detached(message, sig)`
|
||||||
def sign_detached(message)
|
def sign_detached(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user