From 04beb6dc3ca878aab48f283c1dc6699ca6a8a27b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 27 Jan 2014 16:50:00 +0100 Subject: Add an aligned uint8_t type data_t and use it to ensure the alignment of various buffers on the stack --- src/methods/generic_poly1305/generic_poly1305.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/methods/generic_poly1305') diff --git a/src/methods/generic_poly1305/generic_poly1305.c b/src/methods/generic_poly1305/generic_poly1305.c index 82c5bf1..b65f35b 100644 --- a/src/methods/generic_poly1305/generic_poly1305.c +++ b/src/methods/generic_poly1305/generic_poly1305.c @@ -126,14 +126,14 @@ static bool method_encrypt(fastd_context_t *ctx, fastd_peer_t *peer UNUSED, fast if (tail_len) memset(in.data+in.len, 0, tail_len); - uint8_t nonce[session->method->cipher_info->iv_length]; + data_t nonce[session->method->cipher_info->iv_length]; fastd_method_expand_nonce(nonce, session->common.send_nonce, sizeof(nonce)); int n_blocks = block_count(in.len, sizeof(fastd_block128_t)); fastd_block128_t *inblocks = in.data; fastd_block128_t *outblocks = out->data; - uint8_t tag[TAGBYTES]; + data_t tag[TAGBYTES]; bool ok = session->cipher->crypt(session->cipher_state, outblocks, inblocks, n_blocks*sizeof(fastd_block128_t), nonce); @@ -171,10 +171,10 @@ static bool method_decrypt(fastd_context_t *ctx, fastd_peer_t *peer, fastd_metho if (flags) return false; - uint8_t nonce[session->method->cipher_info->iv_length]; + data_t nonce[session->method->cipher_info->iv_length]; fastd_method_expand_nonce(nonce, in_nonce, sizeof(nonce)); - uint8_t tag[TAGBYTES]; + data_t tag[TAGBYTES]; fastd_buffer_push_head_to(ctx, &in, tag, TAGBYTES); fastd_buffer_pull_head_zero(ctx, &in, KEYBYTES); -- cgit v1.2.3