                          (conj acc eblock))))
                    [] blocks))))
 
-(defn- decrypt
+(defn- decrypt-cbc
   [cipher input key iv]
   (let [blocksize (crypto/get-block-size cipher)
         blocks (split-by-blocksize input blocksize false)]

        authkey (extract-authentication-key secret algorithm)]
    (when-not (verify-authtag authtag (assoc params :authkey authkey :algorithm :sha512))
      (throw+ {:type :validation :cause :authtag :message "Message seems corrupt or manipulated."}))
    (decrypt cipher ciphertext encryptionkey iv)))

(defn- generate-plaintext
  [claims zip exp nbf iat]

        authkey (extract-authentication-key secret algorithm)]
    (when-not (verify-authtag authtag (assoc params :authkey authkey :algorithm :sha384))
      (throw+ {:type :validation :cause :authtag :message "Message seems corrupt or manipulated."}))
    (decrypt-cbc cipher ciphertext encryptionkey iv)))

(defmethod aead-decrypt :a256cbc-hs512
  [{:keys [algorithm authtag ciphertext secret iv] :as params}]
