     (reify
       KDFType
       (generate-bytes! [_ length]
-        (generate-bytes-impl kdfimpl length)))))
+        (generate-byte-array kdfimpl length)))))
 
 (defn kdf2
   "DF2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033"

  of kdf implemented in buddy."
  (generate-bytes! [_ length] "Generate bytes"))

(defn- generate-bytes-impl
  [impl length]
  (let [buffer (byte-array length)]
    (.generateBytes impl buffer 0 length)

    (reify
      KDFType
      (generate-bytes! [_ length]
        (generate-byte-array kdfimpl length)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; KDF1/2 interface
