Print this page
3887 Enlarge data buffer in digest/mac to boost performance
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>

@@ -49,11 +49,15 @@
 #include <security/cryptoki.h>
 #include <limits.h>
 #include <cryptoutil.h>
 #include <kmfapi.h>
 
-#define BUFFERSIZE      (4096)          /* Buffer size for reading file */
+/*
+ * Buffer size for reading file. This is given a rather high value
+ * to get better performance when a hardware provider is present.
+ */
+#define BUFFERSIZE      (1024 * 64)
 
 /*
  * RESULTLEN - large enough size in bytes to hold result for
  * digest and mac results for all mechanisms
  */