       (.init engine encrypt params')
       engine))
 
-  (process-bytes
+  (-process-bytes
     ([engine input]
      (let [len    (count input)
            buffer (byte-array len)]


(defprotocol IBlockCipher
  "Common protocol to block ciphers."
  (^:private get-block-size* [_] "Get block size in bytes."))

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

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

(defprotocol IAEADBlockCipher
  "Common protocol to Authenticated Cipher."
  (^:private calculate-authtag [_ output outoffset] "Calculate the authentication tag.")
  (^:private get-output-size* [_ data] "Get the output size."))

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


(extend-type AEADBlockCipher
  IAEADBlockCipher
  (-output-size [engine length]
    (.getOutputSize engine length))

  (-auth-tag [engine output outoffset]
    (.doFinal engine output outoffset))

  IBlockCipher
  (-block-size [engine]
    (-block-size (.getUnderlyingCipher engine)))

  ICipher
  (-init [engine params]
    (let [iv (:iv params)
          key (:key params)
          aad (:aad params)
