         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)))
+    (is (bb/bytes= (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))))
+    (is (bb/bytes= (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 (not (bb/bytes= a b)))
     (is (= s/noncebytes (bb/buflen a) (bb/buflen b)))))
 
 (defn is-valid-magicnonce-ctext?


  (let [c1 (ms/secretbox-rnd st/ptext st/secret-key)
        c2 (ms/secretbox-rnd st/ptext st/secret-key)]
    (is (not (u/array-eq c1 c2)))
    (is (not= (take s/noncebytes c1) (take s/noncebytes c2))))

  (with-redefs [ms/random-nonce! constant-nonce]
    (let [c1 (ms/secretbox-rnd st/ptext st/secret-key)
          c2 (ms/secretbox-rnd st/ptext st/secret-key)]
      (is (u/array-eq c1 c2))
      (is (= (range s/noncebytes) (take s/noncebytes c1) (take s/noncebytes c2))))))

(deftest synthetic-nonce-test

       out
       (bb/->indirect-byte-buf ctext)
       (bb/->indirect-byte-buf st/secret-key))
      (is (bb/bytes= st/ptext out)))

    (let [out (bb/alloc ptextlen)
          forgery (bb/->indirect-byte-buf (r/randombytes (bb/buflen out)))]
