diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-23 23:57:15 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-06-24 14:44:07 +0200 |
commit | 7ecbc99d617e32304a1ac5c720725415aecb5654 (patch) | |
tree | 2d4b7d761931077fa369f42ed951fa5ba435af45 | |
parent | 8470b7cf47bfc324a52a8245032642f667db8491 (diff) | |
download | mxs-utils-7ecbc99d617e32304a1ac5c720725415aecb5654.tar.gz mxs-utils-7ecbc99d617e32304a1ac5c720725415aecb5654.tar.xz |
add parentheses around arithmetic
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | common/rijndael.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/rijndael.cpp b/common/rijndael.cpp index fd39f76..b48c5fe 100644 --- a/common/rijndael.cpp +++ b/common/rijndael.cpp @@ -1112,7 +1112,7 @@ int Rijndael::blockEncrypt(const uint8_t *input,int inputLen,uint8_t *outBuffer) iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7); iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7); iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7); - iv[3][3] = (iv[3][3] << 1) | (outBuffer[k/8] >> (7-(k&7))) & 1; + iv[3][3] = (iv[3][3] << 1) | ((outBuffer[k/8] >> (7-(k&7))) & 1); } } break; @@ -1266,7 +1266,7 @@ int Rijndael::blockDecrypt(const uint8_t *input, int inputLen, uint8_t *outBuffe iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7); iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7); iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7); - iv[3][3] = (iv[3][3] << 1) | (input[k/8] >> (7-(k&7))) & 1; + iv[3][3] = (iv[3][3] << 1) | ((input[k/8] >> (7-(k&7))) & 1); outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7); } } |