summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-05-06 19:41:33 +0000
committerNick Mathewson <nickm@torproject.org>2004-05-06 19:41:33 +0000
commitebe8fa0d62073e97745cba6fb5d461b704bd9bd2 (patch)
tree1bf746056d86cf443b06caa9ea4207044c0fb89b
parent9bf9ca4d094926acfc0b0a50f6fd12fcbb310d0d (diff)
downloadtor-ebe8fa0d62073e97745cba6fb5d461b704bd9bd2.tar.gz
tor-ebe8fa0d62073e97745cba6fb5d461b704bd9bd2.zip
Use correct aes-ctr implementation in mainline, too.
svn:r1800
-rw-r--r--src/common/aes.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/aes.c b/src/common/aes.c
index 58efbf72a5..f00822bca8 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -47,14 +47,14 @@ _aes_fill_buf(aes_cnt_cipher_t *cipher)
u32 counter1 = cipher->counter1;
u8 buf[16];
memset(buf, 0, 8);
- buf[15] = (counter0 >> 0) && 0xff;
- buf[14] = (counter0 >> 8) && 0xff;
- buf[13] = (counter0 >> 16) && 0xff;
- buf[12] = (counter0 >> 24) && 0xff;
- buf[11] = (counter1 >> 0) && 0xff;
- buf[10] = (counter1 >> 8) && 0xff;
- buf[ 9] = (counter1 >> 16) && 0xff;
- buf[ 8] = (counter1 >> 24) && 0xff;
+ buf[15] = (counter0 >> 0) & 0xff;
+ buf[14] = (counter0 >> 8) & 0xff;
+ buf[13] = (counter0 >> 16) & 0xff;
+ buf[12] = (counter0 >> 24) & 0xff;
+ buf[11] = (counter1 >> 0) & 0xff;
+ buf[10] = (counter1 >> 8) & 0xff;
+ buf[ 9] = (counter1 >> 16) & 0xff;
+ buf[ 8] = (counter1 >> 24) & 0xff;
rijndaelEncrypt(cipher->rk, cipher->nr, buf, cipher->buf);
cipher->pos = 0;