             [naclj.hash-protocol :as hp]
             [naclj.hash-blake2b])
 	(:import 
-	  (java.util.Random)
+	  (java.security.SecureRandom)
             ))
 
 ;;


(defrecord TRandomGeneratorJava [random-generator])

(defmethod make-random-generator :java.util.Random [provider] 
  (map->TRandomGeneratorJava {:random-generator (java.util.Random.)}))

(extend-type TRandomGeneratorJava
  IRandomGenerator


(defmethod make-key :default
  [provider function & {:keys [size] :as xs}]
  (map->TGenericKey :key-bs (random-bytes (make-random-generator :java.security.SecureRandom) size)
                    :provider :sodium))

;;;
