 (defmethod derive-password :bcrypt+sha384
   [{:keys [alg password salt iterations] :as pwdparams}]
   (let [salt (codecs/->byte-array (or salt (nonce/random-bytes 16)))
-        iterations (or iterations (get *default-iterations* alg))
+        iterations (or iterations (get +iterations+ alg))
         password (-> (hash/sha384 password)
                      (BCrypt/generate salt iterations))]
     {:alg alg

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

(def ^:dynamic *default-iterations*
  {:pbkdf2+sha1 100000
   :pbkdf2+sha256 100000
   :pbkdf2+blake2b-512 50000


(defmethod must-update? :default
  [{:keys [alg iterations]}]
  (let [desired-iterations (get +iterations+ alg)]
    (and desired-iterations (> desired-iterations iterations))))

(defmethod must-update? :bcrypt+sha512
