(uint8_t *)priv->rxp,
(int)priv->rx_size,
(uint8_t)0, /* priority */
- (uint8_t *)michael_mic.Result);
+ (uint8_t *)michael_mic.result);
}
- if (memcmp(michael_mic.Result, recv_mic, 8) != 0) {
+ if (memcmp(michael_mic.result, recv_mic, 8) != 0) {
now = jiffies;
mic_failure = &priv->wpa.mic_failure;
/* MIC FAILURE */
(uint8_t *)&pp->data[0],
(int)skb_len,
(uint8_t)0, /* priority */
- (uint8_t *)michael_mic.Result);
- memcpy(p, michael_mic.Result, 8);
+ (uint8_t *)michael_mic.result);
+ memcpy(p, michael_mic.result, 8);
length += 8;
skb_len += 8;
p += 8;
// Reset the state to the empty message.
#define MichaelClear(A) \
do { \
- A->L = A->K0; \
- A->R = A->K1; \
- A->nBytesInM = 0; \
+ A->l = A->k0; \
+ A->r = A->k1; \
+ A->m_bytes = 0; \
} while (0)
static
void MichaelInitializeFunction(struct michael_mic_t *Mic, uint8_t *key)
{
// Set the key
- Mic->K0 = getUInt32(key, 0);
- Mic->K1 = getUInt32(key, 4);
+ Mic->k0 = getUInt32(key, 0);
+ Mic->k1 = getUInt32(key, 4);
//clear();
MichaelClear(Mic);
{
int addlen;
- if (Mic->nBytesInM) {
- addlen = 4 - Mic->nBytesInM;
+ if (Mic->m_bytes) {
+ addlen = 4 - Mic->m_bytes;
if (addlen > nBytes)
addlen = nBytes;
- memcpy(&Mic->M[Mic->nBytesInM], src, addlen);
- Mic->nBytesInM += addlen;
+ memcpy(&Mic->m[Mic->m_bytes], src, addlen);
+ Mic->m_bytes += addlen;
src += addlen;
nBytes -= addlen;
- if (Mic->nBytesInM < 4)
+ if (Mic->m_bytes < 4)
return;
- Mic->L ^= getUInt32(Mic->M, 0);
- MichaelBlockFunction(Mic->L, Mic->R);
- Mic->nBytesInM = 0;
+ Mic->l ^= getUInt32(Mic->m, 0);
+ MichaelBlockFunction(Mic->l, Mic->r);
+ Mic->m_bytes = 0;
}
while (nBytes >= 4) {
- Mic->L ^= getUInt32(src, 0);
- MichaelBlockFunction(Mic->L, Mic->R);
+ Mic->l ^= getUInt32(src, 0);
+ MichaelBlockFunction(Mic->l, Mic->r);
src += 4;
nBytes -= 4;
}
if (nBytes > 0) {
- Mic->nBytesInM = nBytes;
- memcpy(Mic->M, src, nBytes);
+ Mic->m_bytes = nBytes;
+ memcpy(Mic->m, src, nBytes);
}
}
static
void MichaelGetMIC(struct michael_mic_t *Mic, uint8_t *dst)
{
- u8 *data = Mic->M;
+ u8 *data = Mic->m;
- switch (Mic->nBytesInM) {
+ switch (Mic->m_bytes) {
case 0:
- Mic->L ^= 0x5a;
+ Mic->l ^= 0x5a;
break;
case 1:
- Mic->L ^= data[0] | 0x5a00;
+ Mic->l ^= data[0] | 0x5a00;
break;
case 2:
- Mic->L ^= data[0] | (data[1] << 8) | 0x5a0000;
+ Mic->l ^= data[0] | (data[1] << 8) | 0x5a0000;
break;
case 3:
- Mic->L ^= data[0] | (data[1] << 8) | (data[2] << 16) |
+ Mic->l ^= data[0] | (data[1] << 8) | (data[2] << 16) |
0x5a000000;
break;
}
- MichaelBlockFunction(Mic->L, Mic->R);
- MichaelBlockFunction(Mic->L, Mic->R);
+ MichaelBlockFunction(Mic->l, Mic->r);
+ MichaelBlockFunction(Mic->l, Mic->r);
// The appendByte function has already computed the result.
- putUInt32(dst, 0, Mic->L);
- putUInt32(dst, 4, Mic->R);
+ putUInt32(dst, 0, Mic->l);
+ putUInt32(dst, 4, Mic->r);
// Reset to the empty message.
MichaelClear(Mic);