   [{: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))
+        iterations (or iterations (get +iterations+ alg))
         digest (hash/resolve-digest-engine digest)
         dsize (* 8 (.getDigestSize digest))
         pgen (doto (PKCS5S2ParametersGenerator. digest)

(defmethod derive-password :pbkdf2+sha3_256
  [{: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))
        pgen (doto (PKCS5S2ParametersGenerator. (SHA3Digest. 256))
               (.init password salt iterations))
        password (.getKey (.generateDerivedParameters pgen 256))]

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

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