summaryrefslogtreecommitdiffstats
path: root/src/method_aes128_gcm.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-09-15 19:57:18 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-09-15 19:57:18 +0200
commitf33d7756b8361ca38991bfe9d39ea5de13f86dfc (patch)
treef43a86dfebaff297ddc18778c2765a8f6c9f58d8 /src/method_aes128_gcm.c
parentb2d02587fcd86f0c3910441d58c94dd0c9fea5b5 (diff)
downloadfastd-f33d7756b8361ca38991bfe9d39ea5de13f86dfc.tar
fastd-f33d7756b8361ca38991bfe9d39ea5de13f86dfc.zip
Use inline function for alignment
Diffstat (limited to 'src/method_aes128_gcm.c')
-rw-r--r--src/method_aes128_gcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/method_aes128_gcm.c b/src/method_aes128_gcm.c
index ed8f026..05321fd 100644
--- a/src/method_aes128_gcm.c
+++ b/src/method_aes128_gcm.c
@@ -291,8 +291,8 @@ static bool method_encrypt(fastd_context *ctx, fastd_peer *peer, fastd_method_se
fastd_buffer_pull_head(&in, BLOCKBYTES);
memset(in.data, 0, BLOCKBYTES);
- size_t tail_len = ALIGN(in.len, BLOCKBYTES)-in.len;
- *out = fastd_buffer_alloc(in.len, ALIGN(NONCEBYTES, 8), BLOCKBYTES+tail_len);
+ size_t tail_len = alignto(in.len, BLOCKBYTES)-in.len;
+ *out = fastd_buffer_alloc(in.len, alignto(NONCEBYTES, 8), BLOCKBYTES+tail_len);
if (tail_len)
memset(in.data+in.len, 0, tail_len);
@@ -353,7 +353,7 @@ static bool method_decrypt(fastd_context *ctx, fastd_peer *peer, fastd_method_se
fastd_buffer_push_head(&in, NONCEBYTES);
- size_t tail_len = ALIGN(in.len, BLOCKBYTES)-in.len;
+ size_t tail_len = alignto(in.len, BLOCKBYTES)-in.len;
*out = fastd_buffer_alloc(in.len, 0, tail_len);
int n_blocks = (in.len+BLOCKBYTES-1)/BLOCKBYTES;