Commit 79955850 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: avoid camel cases in MichaelAppend function

This commit avoid camel cases in MichaelAppend function and params
renaming it to michael_append.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 808a05c0
...@@ -57,38 +57,37 @@ do { \ ...@@ -57,38 +57,37 @@ do { \
L += R; \ L += R; \
} while (0) } while (0)
static static void michael_append(struct michael_mic_t *mic, uint8_t *src, int bytes)
void MichaelAppend(struct michael_mic_t *Mic, uint8_t *src, int nBytes)
{ {
int addlen; int addlen;
if (Mic->m_bytes) { if (mic->m_bytes) {
addlen = 4 - Mic->m_bytes; addlen = 4 - mic->m_bytes;
if (addlen > nBytes) if (addlen > bytes)
addlen = nBytes; addlen = bytes;
memcpy(&Mic->m[Mic->m_bytes], src, addlen); memcpy(&mic->m[mic->m_bytes], src, addlen);
Mic->m_bytes += addlen; mic->m_bytes += addlen;
src += addlen; src += addlen;
nBytes -= addlen; bytes -= addlen;
if (Mic->m_bytes < 4) if (mic->m_bytes < 4)
return; return;
Mic->l ^= getUInt32(Mic->m, 0); mic->l ^= getUInt32(mic->m, 0);
MichaelBlockFunction(Mic->l, Mic->r); MichaelBlockFunction(mic->l, mic->r);
Mic->m_bytes = 0; mic->m_bytes = 0;
} }
while (nBytes >= 4) { while (bytes >= 4) {
Mic->l ^= getUInt32(src, 0); mic->l ^= getUInt32(src, 0);
MichaelBlockFunction(Mic->l, Mic->r); MichaelBlockFunction(mic->l, mic->r);
src += 4; src += 4;
nBytes -= 4; bytes -= 4;
} }
if (nBytes > 0) { if (bytes > 0) {
Mic->m_bytes = nBytes; mic->m_bytes = bytes;
memcpy(Mic->m, src, nBytes); memcpy(mic->m, src, bytes);
} }
} }
...@@ -137,8 +136,8 @@ void michael_mic_function(struct michael_mic_t *mic, u8 *key, ...@@ -137,8 +136,8 @@ void michael_mic_function(struct michael_mic_t *mic, u8 *key,
* +--+--+--------+--+----+--+--+--+--+--+--+--+--+ * +--+--+--------+--+----+--+--+--+--+--+--+--+--+
*/ */
michael_init(mic, key); michael_init(mic, key);
MichaelAppend(mic, (uint8_t *)data, 12); /* |DA|SA| */ michael_append(mic, (uint8_t *)data, 12); /* |DA|SA| */
MichaelAppend(mic, pad_data, 4); /* |Priority|0|0|0| */ michael_append(mic, pad_data, 4); /* |Priority|0|0|0| */
MichaelAppend(mic, (uint8_t *)(data + 12), len - 12); /* |Data| */ michael_append(mic, (uint8_t *)(data + 12), len - 12); /* |Data| */
MichaelGetMIC(mic, result); MichaelGetMIC(mic, result);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment