Print this page
6189743 Need an ARCFOUR implementation optimized for AMD64

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/crypto/common.h
          +++ new/usr/src/uts/common/sys/crypto/common.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 2007 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_CRYPTO_COMMON_H
  27   27  #define _SYS_CRYPTO_COMMON_H
  28   28  
  29      -#pragma ident   "@(#)common.h   1.24    07/12/10 SMI"
       29 +#pragma ident   "@(#)common.h   1.25    08/01/02 SMI"
  30   30  
  31   31  /*
  32   32   * Header file for the common data structures of the cryptographic framework
  33   33   */
  34   34  
  35   35  #ifdef __cplusplus
  36   36  extern "C" {
  37   37  #endif
  38   38  
  39   39  #include <sys/types.h>
↓ open down ↓ 138 lines elided ↑ open up ↑
 178  178  #define SUN_CKM_SHA1_RSA_PKCS           "CKM_SHA1_RSA_PKCS"
 179  179  #define SUN_CKM_SHA256_RSA_PKCS         "CKM_SHA256_RSA_PKCS"
 180  180  #define SUN_CKM_SHA384_RSA_PKCS         "CKM_SHA384_RSA_PKCS"
 181  181  #define SUN_CKM_SHA512_RSA_PKCS         "CKM_SHA512_RSA_PKCS"
 182  182  #define SUN_CKM_EC_KEY_PAIR_GEN         "CKM_EC_KEY_PAIR_GEN"
 183  183  #define SUN_CKM_ECDH1_DERIVE            "CKM_ECDH1_DERIVE"
 184  184  #define SUN_CKM_ECDSA_SHA1              "CKM_ECDSA_SHA1"
 185  185  #define SUN_CKM_ECDSA                   "CKM_ECDSA"
 186  186  
 187  187  /* Shared operation context format for CKM_RC4 */
      188 +#if defined(__amd64)
      189 +typedef uint64_t arcfour_key_int_t;
      190 +#else
      191 +typedef uchar_t arcfour_key_int_t;
      192 +#endif /* __amd64 */
      193 +
 188  194  typedef struct {
 189      -        uchar_t arr[256];
 190      -        uchar_t i, j;
      195 +        arcfour_key_int_t arr[256];
      196 +        arcfour_key_int_t i, j;
 191  197          uint64_t pad;           /* For 64-bit alignment */
 192  198  } arcfour_state_t;
 193  199  
 194      -
 195  200  /* Data arguments of cryptographic operations */
 196  201  
 197  202  typedef enum crypto_data_format {
 198  203          CRYPTO_DATA_RAW = 1,
 199  204          CRYPTO_DATA_UIO,
 200  205          CRYPTO_DATA_MBLK
 201  206  } crypto_data_format_t;
 202  207  
 203  208  typedef struct crypto_data {
 204  209          crypto_data_format_t    cd_format;      /* Format identifier    */
↓ open down ↓ 318 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX