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>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-crypto/digest/digest.c
          +++ new/usr/src/cmd/cmd-crypto/digest/digest.c
↓ open down ↓ 43 lines elided ↑ open up ↑
  44   44  #include <libgen.h>
  45   45  #include <locale.h>
  46   46  #include <errno.h>
  47   47  #include <sys/types.h>
  48   48  #include <sys/stat.h>
  49   49  #include <security/cryptoki.h>
  50   50  #include <limits.h>
  51   51  #include <cryptoutil.h>
  52   52  #include <kmfapi.h>
  53   53  
  54      -#define BUFFERSIZE      (4096)          /* Buffer size for reading file */
       54 +/*
       55 + * Buffer size for reading file. This is given a rather high value
       56 + * to get better performance when a hardware provider is present.
       57 + */
       58 +#define BUFFERSIZE      (1024 * 64)
  55   59  
  56   60  /*
  57   61   * RESULTLEN - large enough size in bytes to hold result for
  58   62   * digest and mac results for all mechanisms
  59   63   */
  60   64  #define RESULTLEN       (512)
  61   65  
  62   66  /*
  63   67   * Exit Status codes
  64   68   */
↓ open down ↓ 880 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX