Print this page
6665607 Need a SHA256/SHA384/SHA512 implementation optimized for 64-bit x86

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/sha2.h
          +++ new/usr/src/uts/common/sys/sha2.h
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22      - * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
       22 + * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  #ifndef _SYS_SHA2_H
  27   27  #define _SYS_SHA2_H
  28   28  
  29      -#pragma ident   "@(#)sha2.h     1.4     06/03/28 SMI"
       29 +#pragma ident   "@(#)sha2.h     1.5     08/03/20 SMI"
  30   30  
  31   31  #include <sys/types.h>          /* for uint_* */
  32   32  
  33   33  #ifdef  __cplusplus
  34   34  extern "C" {
  35   35  #endif
  36   36  
  37   37  #define SHA2_HMAC_MIN_KEY_LEN   8       /* SHA2-HMAC min key length in bits */
  38   38  #define SHA2_HMAC_MAX_KEY_LEN   INT_MAX /* SHA2-HMAC max key length in bits */
  39   39  
↓ open down ↓ 12 lines elided ↑ open up ↑
  52   52  #define SHA384_HMAC_GEN         5
  53   53  #define SHA512                  6
  54   54  #define SHA512_HMAC             7
  55   55  #define SHA512_HMAC_GEN         8
  56   56  
  57   57  /*
  58   58   * SHA2 context.
  59   59   * The contents of this structure are a private interface between the
  60   60   * Init/Update/Final calls of the functions defined below.
  61   61   * Callers must never attempt to read or write any of the fields
  62      - * in this strucutre directly.
       62 + * in this structure directly.
  63   63   */
  64   64  typedef struct  {
  65   65          uint32_t algotype;              /* Algorithm Type */
  66   66  
  67   67          /* state (ABCDEFGH) */
  68   68          union {
  69   69                  uint32_t s32[8];        /* for SHA256 */
  70   70                  uint64_t s64[8];        /* for SHA384/512 */
  71   71          } state;
  72   72          /* number of bits */
↓ open down ↓ 72 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX