         kdfimpl (KDFDoublePipelineIterationBytesGenerator. mac)]
     (.init kdfimpl params)
     (reify
-      KDFType
-      (generate-bytes! [_ length]
-        (generate-byte-array kdfimpl length)))))
+      IKDF
+      (generate-byte-array! [_ length]
+        (generate-byte-array kdfimpl length))
+
+      (generate-byte-buffer! [_ length]
+        (generate-byte-buffer kdfimpl length)))))

           org.bouncycastle.crypto.params.KDFDoublePipelineIterationParameters
           org.bouncycastle.crypto.macs.HMac
           org.bouncycastle.crypto.Mac
           clojure.lang.Keyword))

(defprotocol IKDF

        kdfimpl (KDF2BytesGenerator. digest)]
    (.init kdfimpl params)
    (reify
      IKDF
      (generate-byte-array! [_ length]
        (generate-byte-array kdfimpl length))

      (generate-byte-buffer! [_ length]
        (generate-byte-buffer kdfimpl length)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Counter mode KDF
