From 8db8b410a286b5c6907d58095290beb0ee7c5ce8 Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Sun, 22 May 2022 18:32:11 -0700 Subject: [PATCH] Specs: Test Chalsa#random* --- spec/sodium/cipher/chalsa_spec.cr | 7 +++++++ spec/sodium/sign/secret_key_spec.cr | 3 +++ 2 files changed, 10 insertions(+) diff --git a/spec/sodium/cipher/chalsa_spec.cr b/spec/sodium/cipher/chalsa_spec.cr index 525f656..a992e4c 100644 --- a/spec/sodium/cipher/chalsa_spec.cr +++ b/spec/sodium/cipher/chalsa_spec.cr @@ -19,6 +19,13 @@ require "../../../src/sodium/cipher/chalsa" cipher2.final.should eq Bytes.new(0) 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 cipher1 = Sodium::Cipher::{{ name.id }}.new Bytes.new(Sodium::Cipher::{{ name.id }}::KEY_SIZE) cipher2 = cipher1.dup diff --git a/spec/sodium/sign/secret_key_spec.cr b/spec/sodium/sign/secret_key_spec.cr index 7150930..ab55eb1 100644 --- a/spec/sodium/sign/secret_key_spec.cr +++ b/spec/sodium/sign/secret_key_spec.cr @@ -98,6 +98,9 @@ describe Sodium::Sign::SecretKey do end end + pending "combined test vectors" do + end + it "RbNaCl detached test vectors" do detached_test_vectors.each do |vec| seckey, plaintext, signature = sign_from_vec vec