u8 *p;
u32 crc;
- if (bcrc32initialized == 0) crc32_init();
+ if (bcrc32initialized == 0)
+ crc32_init();
crc = 0xffffffff; /* preload shift register, per CRC-32 spec */
u16 PPK[6]; /* temporary key for mixing */
/* Note: all adds in the PPK[] equations below are mod 2**16 */
- for (i = 0; i < 5; i++) PPK[i] = p1k[i]; /* first, copy P1K to PPK */
- PPK[5] = p1k[4] + iv16; /* next, add in IV16 */
+ for (i = 0; i < 5; i++)
+ PPK[i] = p1k[i]; /* first, copy P1K to PPK */
+
+ PPK[5] = p1k[4] + iv16; /* next, add in IV16 */
/* Bijective non-linear mixing of the 96 bits of PPK[0..5] */
PPK[0] += _S_(PPK[5] ^ TK16(0)); /* Mix key in each "round" */
u8 intermediateb[16];
u8 round_key[16];
- for (i = 0; i < 16; i++) round_key[i] = key[i];
+ for (i = 0; i < 16; i++)
+ round_key[i] = key[i];
for (round = 0; round < 11; round++) {
if (round == 0) {
{
int i;
- for (i = 0; i < 16; i++) mic_header2[i] = 0x00;
+ for (i = 0; i < 16; i++)
+ mic_header2[i] = 0x00;
mic_header2[0] = mpdu[16]; /* A3 */
mic_header2[1] = mpdu[17];
mic_header2[7] = 0x00; /* mpdu[23]; */
if (!qc_exists && a4_exists) {
- for (i = 0; i < 6; i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */
+ for (i = 0; i < 6; i++)
+ mic_header2[8+i] = mpdu[24+i]; /* A4 */
}
if (qc_exists && !a4_exists) {
}
if (qc_exists && a4_exists) {
- for (i = 0; i < 6; i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */
+ for (i = 0; i < 6; i++)
+ mic_header2[8+i] = mpdu[24+i]; /* A4 */
mic_header2[14] = mpdu[30] & 0x0f;
mic_header2[15] = mpdu[31] & 0x00;
{
int i = 0;
- for (i = 0; i < 16; i++) ctr_preload[i] = 0x00;
+ for (i = 0; i < 16; i++)
+ ctr_preload[i] = 0x00;
+
i = 0;
ctr_preload[0] = 0x01; /* flag */