This library implements some hash and cryptographic algorithms.
Dependents: ES_CW2_Starter_JIN EMBEDDED_CW2 EMBEDDED_CW2_Final Spinnybois ... more
Fork of Crypto by
Diff: AES.cpp
- Revision:
- 2:473bac39ae7c
- Parent:
- 0:7a1237bd2d13
--- a/AES.cpp Mon Sep 09 12:15:26 2013 +0000 +++ b/AES.cpp Mon Sep 09 16:16:24 2013 +0000 @@ -148,9 +148,9 @@ --i; } state[r] = temp >> 24; - state[r+4] = (temp & 0x00FF0000) >> 16; - state[r+8] = (temp & 0x0000FF00) >> 8; - state[r+12] = temp & 0xFF; + state[r+4] = temp >> 16; + state[r+8] = temp >> 8; + state[r+12] = temp; } } @@ -166,9 +166,9 @@ --i; } state[r] = temp >> 24; - state[r+4] = (temp & 0x00FF0000) >> 16; - state[r+8] = (temp & 0x0000FF00) >> 8; - state[r+12] = temp & 0xFF; + state[r+4] = temp >> 16; + state[r+8] = temp >> 8; + state[r+12] = temp; } } @@ -229,10 +229,10 @@ { uint32_t temp = (state[4*c] << 24) + (state[4*c+1] << 16) + (state[4*c+2] << 8) + state[4*c+3]; temp ^= w[round*4+c]; - state[4*c] = (temp >> 24); - state[4*c+1] = ((temp & 0x00FF0000) >> 16); - state[4*c+2] = ((temp & 0x0000FF00) >> 8); - state[4*c+3] = temp & 0xFF; + state[4*c] = temp >> 24; + state[4*c+1] = temp >> 16; + state[4*c+2] = temp >> 8; + state[4*c+3] = temp; } }