Specs: Test Chalsa#random*
parent
527ffe9c06
commit
8db8b410a2
|
@ -19,6 +19,13 @@ require "../../../src/sodium/cipher/chalsa"
|
||||||
cipher2.final.should eq Bytes.new(0)
|
cipher2.final.should eq Bytes.new(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "Random" do
|
||||||
|
cipher = Sodium::Cipher::{{ name.id }}.random
|
||||||
|
cipher.random_bytes(8).should_not eq(cipher.random_bytes(8))
|
||||||
|
r = 3.times.map { cipher.rand(65536) }.sum
|
||||||
|
r.should_not eq(0)
|
||||||
|
end
|
||||||
|
|
||||||
it "dups" do
|
it "dups" do
|
||||||
cipher1 = Sodium::Cipher::{{ name.id }}.new Bytes.new(Sodium::Cipher::{{ name.id }}::KEY_SIZE)
|
cipher1 = Sodium::Cipher::{{ name.id }}.new Bytes.new(Sodium::Cipher::{{ name.id }}::KEY_SIZE)
|
||||||
cipher2 = cipher1.dup
|
cipher2 = cipher1.dup
|
||||||
|
|
|
@ -98,6 +98,9 @@ describe Sodium::Sign::SecretKey do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pending "combined test vectors" do
|
||||||
|
end
|
||||||
|
|
||||||
it "RbNaCl detached test vectors" do
|
it "RbNaCl detached test vectors" do
|
||||||
detached_test_vectors.each do |vec|
|
detached_test_vectors.each do |vec|
|
||||||
seckey, plaintext, signature = sign_from_vec vec
|
seckey, plaintext, signature = sign_from_vec vec
|
||||||
|
|
Loading…
Reference in New Issue