             forgery
             (bb/->indirect-byte-buf st/secret-key)))))
 
-    (is (u/array-eq st/ptext (ms/open ctext st/secret-key)))
+    (is (bb/bytes= st/ptext (ms/open ctext st/secret-key)))
 
     (let [forgery (r/randombytes (bb/buflen ctext))]
       (is (thrown-with-msg?

        two (byte-array [0 1 0])
        out (byte-array [0 0 0])]
    (is (identical? (#'ms/xor! out one two) out))
    (is (u/array-eq (byte-array [1 1 1]) out)))
  (let [one (byte-array [1 0 1])
        two (byte-array [0 1 0])]
    (is (identical? (#'ms/xor-inplace! one two) one))
    (is (u/array-eq (byte-array [1 1 1]) one))))

(deftest random-nonce!-test
  (let [a (#'ms/random-nonce!)
        b (#'ms/random-nonce!)]
    (is (not (u/array-eq a b)))
    (is (= s/noncebytes (bb/buflen a) (bb/buflen b)))))

(defn is-valid-magicnonce-ctext?


  (let [c1 (ms/secretbox-det st/ptext st/secret-key)
        c2 (ms/secretbox-det st/ptext st/secret-key)]
    (is (bb/bytes= c1 c2))))

(deftest secretbox-nmr-with-implicit-rnd-nonce-test
  (let [ctext (ms/secretbox-nmr st/ptext st/secret-key)]
