[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 20/20] chacha: Use #pragma pack
[Thread Prev] | [Thread Next]
- Subject: [PATCH 20/20] chacha: Use #pragma pack
- From: Alberto Aguirre <albaguirre@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 28 Feb 2018 10:25:07 -0600
- To: libssh@xxxxxxxxxx
Use #pragma pack instead of gcc specific attributes. Using #pragma
pack directives works for both Visual Studio and gcc/clang compilers.
Signed-off-by: Alberto Aguirre <albaguirre@xxxxxxxxx>
---
src/chachapoly.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/chachapoly.c b/src/chachapoly.c
index 1d921f1e..73958ae4 100644
--- a/src/chachapoly.c
+++ b/src/chachapoly.c
@@ -35,10 +35,12 @@ struct chacha20_poly1305_keysched {
struct chacha_ctx k2;
};
+#pragma pack(push, 1)
struct ssh_packet_header {
uint32_t length;
uint8_t payload[];
-} __attribute__((packed));
+};
+#pragma pack(pop)
const uint8_t zero_block_counter[8] = {0, 0, 0, 0, 0, 0, 0, 0};
const uint8_t payload_block_counter[8] = {1, 0, 0, 0, 0, 0, 0, 0};
--
2.14.1
| [PATCH 00/20] Add chacha20-poly1305 support | Alberto Aguirre <albaguirre@xxxxxxxxx> |