            clojure.lang.IFn
            clojure.lang.Keyword))
 
-(def ^{:doc "Available digests."
-       :dynamic true}
-  *available-digests*
+(def ^{:doc false}
+  +digest-engines+
   {:sha256   #(SHA256Digest.)
    :sha384   #(SHA384Digest.)
    :sha512   #(SHA512Digest.)

  [engine]
  (-end engine))

(defn resolve-digest
  "Helper function for make Digest instances
  from algorithm parameter."
  [alg]
  (cond
   (instance? Keyword alg) (let [factory (*available-digests* alg)]
                             (factory))
   (instance? Digest alg) alg
   (instance? IFn alg) (alg)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation details for different data types.

(defn digest
  "Generic function for create cryptographic hash."
  [input alg-or-engine]
  (let [engine (resolve-digest-engine alg-or-engine)]
    (-digest input engine)))

(defn blake2b
