Print this page
3882 remove xmod & friends

Split Close
Expand all
Collapse all
          --- old/usr/src/common/crypto/arcfour/arcfour_crypt.c
          +++ new/usr/src/common/crypto/arcfour/arcfour_crypt.c
↓ open down ↓ 50 lines elided ↑ open up ↑
  51   51   *
  52   52   * Input:
  53   53   * keyval       User-provided key
  54   54   * keyvallen    Length, in bytes, of keyval
  55   55   * Output:
  56   56   * key          Initialized ARCFOUR key schedule, based on keyval
  57   57   */
  58   58  void
  59   59  arcfour_key_init(ARCFour_key *key, uchar_t *keyval, int keyvallen)
  60   60  {
  61      -/* EXPORT DELETE START */
  62      -
  63   61          uchar_t ext_keyval[256];
  64   62          uchar_t tmp;
  65   63          int i, j;
  66   64  
  67   65          /* Normalize key length to 256 */
  68   66          for (i = j = 0; i < 256; i++, j++) {
  69   67                  if (j == keyvallen)
  70   68                          j = 0;
  71   69                  ext_keyval[i] = keyval[j];
  72   70          }
↓ open down ↓ 3 lines elided ↑ open up ↑
  76   74  
  77   75          j = 0;
  78   76          for (i = 0; i < 256; i++) {
  79   77                  j = (j + key->arr[i] + ext_keyval[i]) & 0xff;
  80   78                  tmp = key->arr[i];
  81   79                  key->arr[i] = key->arr[j];
  82   80                  key->arr[j] = tmp;
  83   81          }
  84   82          key->i = 0;
  85   83          key->j = 0;
  86      -
  87      -/* EXPORT DELETE END */
  88   84  }
  89   85  #endif  /* !__amd64 */
  90   86  
  91   87  
  92   88  /*
  93   89   * Encipher 'in' using 'key'.
  94   90   *
  95   91   * Input:
  96   92   * key          ARCFOUR key, initialized by arcfour_key_init()
  97   93   * in           Input text
↓ open down ↓ 1 lines elided ↑ open up ↑
  99   95   * len          Length, in bytes, of the in and out buffers
 100   96   *
 101   97   * Output:
 102   98   * out          Buffer containing output text
 103   99   *
 104  100   * Note: in and out can point to the same location
 105  101   */
 106  102  void
 107  103  arcfour_crypt(ARCFour_key *key, uchar_t *in, uchar_t *out, size_t len)
 108  104  {
 109      -/* EXPORT DELETE START */
 110  105  #ifdef  __amd64
 111  106          if (key->flag == ARCFOUR_ON_AMD64) {
 112  107                  arcfour_crypt_asm(key, in, out, len);
 113  108          } else { /* Intel EM64T */
 114  109  #endif  /* amd64 */
 115  110  
 116  111          size_t          ii;
 117  112          uchar_t         i, j, ti, tj;
 118  113  #ifdef ARCFOUR_LOOP_OPTIMIZED
 119  114          uchar_t         arr_ij;
↓ open down ↓ 100 lines elided ↑ open up ↑
 220  215          key->j = j;
 221  216  
 222  217  #ifdef  sun4u
 223  218          } else {
 224  219                  arcfour_crypt_aligned(key, len, in, out);
 225  220          }
 226  221  #endif  /* sun4u */
 227  222  #ifdef  __amd64
 228  223          }
 229  224  #endif  /* amd64 */
 230      -
 231      -/* EXPORT DELETE END */
 232  225  }
 233  226  
 234  227  
 235  228  #ifdef  __amd64
 236  229  /*
 237  230   * Return 1 if executing on Intel, otherwise 0 (e.g., AMD64).
 238  231   * Cache the result, as the CPU can't change.
 239  232   *
 240  233   * Note: the userland version uses getisax() and checks for an AMD-64-only
 241  234   * feature.  The kernel version uses cpuid_getvendor().
↓ open down ↓ 20 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX