summaryrefslogtreecommitdiff
path: root/src/common/aes.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-12-14 20:40:40 +0000
committerNick Mathewson <nickm@torproject.org>2005-12-14 20:40:40 +0000
commit1af630d32c6f48d825f95cc258b95f18492192c0 (patch)
tree20cf316c42280d7944174ca1d4904b1ca7073c9c /src/common/aes.c
parent7e632a75645c22efe7b1f122816e63839b119f8d (diff)
downloadtor-1af630d32c6f48d825f95cc258b95f18492192c0.tar.gz
tor-1af630d32c6f48d825f95cc258b95f18492192c0.zip
Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
Diffstat (limited to 'src/common/aes.c')
-rw-r--r--src/common/aes.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/common/aes.c b/src/common/aes.c
index 748e0df29f..300fea2672 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -51,11 +51,14 @@ typedef uint8_t u8;
#define MAXKB (256/8)
#define MAXNR 14
-static int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
+static int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/],
+ const u8 cipherKey[], int keyBits);
#ifdef USE_RIJNDAEL_COUNTER_OPTIMIZATION
-static void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, u32 ctr1, u32 ctr0, u8 ct[16]);
+static void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr,
+ u32 ctr1, u32 ctr0, u8 ct[16]);
#else
-static void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]);
+static void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr,
+ const u8 pt[16], u8 ct[16]);
#endif
#endif
@@ -90,8 +93,10 @@ _aes_fill_buf(aes_cnt_cipher_t *cipher)
* 3) changing the counter position was not trivial, last time I looked.
* None of these issues are insurmountable in principle.
*/
-#if !defined(USE_OPENSSL_EVP) && !defined(USE_OPENSSL_AES) && defined(USE_RIJNDAEL_COUNTER_OPTIMIZATION)
- rijndaelEncrypt(cipher->rk, cipher->nr, cipher->counter1, cipher->counter0, cipher->buf);
+#if (!defined(USE_OPENSSL_EVP) && !defined(USE_OPENSSL_AES) && \
+ defined(USE_RIJNDAEL_COUNTER_OPTIMIZATION))
+ rijndaelEncrypt(cipher->rk, cipher->nr,
+ cipher->counter1, cipher->counter0, cipher->buf);
#else
u32 counter0 = cipher->counter0;
u32 counter1 = cipher->counter1;
@@ -176,7 +181,8 @@ aes_free_cipher(aes_cnt_cipher_t *cipher)
* by <b>len</b> bytes as it encrypts.
*/
void
-aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len, char *output)
+aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len,
+ char *output)
{
int c = cipher->pos;
if (!len) return;