Print this page
first pass

Split Close
Expand all
Collapse all
          --- old/usr/src/common/net/wanboot/crypt/aes.c
          +++ new/usr/src/common/net/wanboot/crypt/aes.c
↓ open down ↓ 43 lines elided ↑ open up ↑
  44   44  #define BSWAP_L(l) (((l & 0xff) << 24) | ((l & 0xff00) <<8) \
  45   45          | ((l & 0xff0000) >> 8) | ((l & 0xff000000) >>24))
  46   46  #else
  47   47  #define BSWAP_L(l) (l)
  48   48  #endif
  49   49  
  50   50  #define GETU32(p) BSWAP_L(*(uint32_t *)(p))
  51   51  #define PUTU32(ct, st)  *((uint32_t *)(ct)) = BSWAP_L(st)
  52   52  
  53   53  
  54      -/* EXPORT DELETE START */
  55   54  /*
  56   55   * Te0[x] = S [x].[02, 01, 01, 03];
  57   56   * Te1[x] = S [x].[03, 02, 01, 01];
  58   57   * Te2[x] = S [x].[01, 03, 02, 01];
  59   58   * Te3[x] = S [x].[01, 01, 03, 02];
  60   59   * Te4[x] = S [x].[01, 01, 01, 01];
  61   60   *
  62   61   * Td0[x] = Si[x].[0e, 09, 0d, 0b];
  63   62   * Td1[x] = Si[x].[0b, 0e, 09, 0d];
  64   63   * Td2[x] = Si[x].[0d, 0b, 0e, 09];
↓ open down ↓ 667 lines elided ↑ open up ↑
 732  731          0x01000000, 0x02000000, 0x04000000, 0x08000000,
 733  732          0x10000000, 0x20000000, 0x40000000, 0x80000000,
 734  733          0x1B000000, 0x36000000,
 735  734          /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
 736  735  };
 737  736  typedef struct keysched_s {
 738  737          uint32_t Nr;
 739  738          uint32_t rk_e[60]; /* max round key size */
 740  739          uint32_t rk_d[60]; /* max round key size */
 741  740  } keysched_t;
 742      -/* EXPORT DELETE END */
 743  741  
 744      -/* EXPORT DELETE START */
 745      -
 746  742  int
 747  743  aes_init(void **cookie)
 748  744  {
 749  745          if ((*cookie = malloc(sizeof (keysched_t))) == NULL) {
 750  746                  return (-1);
 751  747          }
 752  748          return (0);
 753  749  }
 754  750  
 755  751  void
↓ open down ↓ 641 lines elided ↑ open up ↑
1397 1393                          Td1[Te4[(rk_d[2] >> 16) & 0xff] & 0xff] ^
1398 1394                          Td2[Te4[(rk_d[2] >> 8) & 0xff] & 0xff] ^
1399 1395                          Td3[Te4[(rk_d[2]) & 0xff] & 0xff];
1400 1396                  rk_d[3] =
1401 1397                          Td0[Te4[(rk_d[3] >> 24)] & 0xff] ^
1402 1398                          Td1[Te4[(rk_d[3] >> 16) & 0xff] & 0xff] ^
1403 1399                          Td2[Te4[(rk_d[3] >> 8) & 0xff] & 0xff] ^
1404 1400                          Td3[Te4[(rk_d[3]) & 0xff] & 0xff];
1405 1401          }
1406 1402  }
1407      -
1408      -/* EXPORT DELETE END */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX