             [buddy.core.nonce :as nonce]
             [buddy.core.codecs :as codecs])
   (:import org.bouncycastle.crypto.engines.TwofishEngine
+           org.bouncycastle.crypto.engines.SerpentEngine
            org.bouncycastle.crypto.engines.BlowfishEngine
-           org.bouncycastle.crypto.engines.AESEngine
+           org.bouncycastle.crypto.engines.AESFastEngine
            org.bouncycastle.crypto.engines.ChaChaEngine
            org.bouncycastle.crypto.modes.CBCBlockCipher
            org.bouncycastle.crypto.modes.SICBlockCipher

      (.init engine encrypt params')
      engine))

  (process-bytes
    ([engine input]
     (let [len    (count input)
           buffer (byte-array len)]


(defprotocol IBlockCipher
  "Common protocol to block ciphers."
  (-block-size [_] "Get block size in bytes."))

(defprotocol IStreamCipher
  "Common protocol to stream ciphers.")

(defprotocol ICipher
  "Common protocol to both, stream and block ciphers."
  (-init [_ params] "Initialize cipher")
  (-process-bytes [_ input] [_ input inoffset output outoffset]
    "Encrypt/Decrypt a block of bytes."))

(defprotocol IAEADBlockCipher
  "Common protocol to Authenticated Cipher."
  (-auth-tag [_ output outoffset] "Calculate the authentication tag.")
  (-output-size [_ data] "Get the output size."))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation details.
