 (defmethod derive-password :pbkdf2+sha256b
   [{:keys [alg password salt iterations] :as pwdparams}]
   (let [salt (codecs/->byte-array (or salt (nonce/random-bytes 12)))
-        iterations (or iterations (get *default-iterations* alg))
+        iterations (or iterations (get +iterations+ alg))
         pgen (doto (PKCS5S2ParametersGenerator. (SHA256Digest.))
                (.init password salt iterations))
         password (.getKey (.generateDerivedParameters pgen 160))]

  [{:keys [alg password salt iterations digest] :as pwdparams}]
  (let [salt (codecs/->byte-array (or salt (nonce/random-bytes 12)))
        alg (keyword (str "pbkdf2+" (name digest)))
        iterations (or iterations (get *default-iterations* alg))
        digest (hash/resolve-digest-engine digest)
        dsize (* 8 (.getDigestSize digest))
        pgen (doto (PKCS5S2ParametersGenerator. digest)

;; Constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(def ^:no-doc ^:static
  +iterations+
  {:pbkdf2+sha1 100000
   :pbkdf2+sha256 100000
   :pbkdf2+blake2b-512 50000
