 (defmulti decrypt* :algorithm)
 
 (defmethod encrypt* :aes128-cbc-hmac-sha256
-  [{:keys [algorithm input key iv ] :as params}]
+  [{:keys [algorithm input key iv aad] :as params}]
   {:pre [(keylength? key 32) (ivlength? iv 16)]}
   (let [cipher (block-cipher :aes :cbc)
         encryptionkey (extract-encryption-key key algorithm)

(defmethod generate-iv :aes192-gcm [_] (nonce/random-bytes 12))
(defmethod generate-iv :aes256-gcm [_] (nonce/random-bytes 12))

(defn- extract-encryption-key
  [key algorithm]
  {:pre [(bytes/bytes? key)]}

        tag (generate-authtag {:algorithm :sha256
                               :input ciphertext
                               :authkey authkey
                               :aad aad
                               :iv iv})]
    (bytes/concat ciphertext tag)))

