Specs: Test Chalsa#random*

master
Didactic Drunk 2022-05-22 18:32:11 -07:00
parent 527ffe9c06
commit 8db8b410a2
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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