diff --git a/ChangeLog b/ChangeLog
index 20cb60e04f3d4b15a1c7e8b4081e64127e6fd502..7273ecc0e5aa7ab715cd68dbf0c93f533930e1d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-02-06  Niels Möller  <nisse@lysator.liu.se>
+
+	* gosthash94.h (struct gosthash94_ctx): Move block buffer last in
+	struct.
+	* md2.h (struct md2_ctx): Likewise.
+	* md4.h (struct md4_ctx): Likewise.
+	* md5.h (struct md5_ctx): Likewise.
+	* ripemd160.h (struct ripemd160_ctx): Likewise.
+	* sha1.h (struct sha1_ctx): Likewise.
+	* sha2.h (struct sha256_ctx, struct sha512_ctx): Likewise.
+
 2019-01-19  Niels Möller  <nisse@lysator.liu.se>
 
 	* examples/Makefile.in (TARGETS): Delete eratosthenes, left over
diff --git a/gosthash94.h b/gosthash94.h
index 8e9d49fefb1bdf65ccae726555b499ab4a8927d7..60b2bef2837fe6de83b149a14f24855e356621f3 100644
--- a/gosthash94.h
+++ b/gosthash94.h
@@ -81,8 +81,8 @@ struct gosthash94_ctx
 {
   uint32_t hash[8]; /* algorithm 256-bit state */
   uint32_t sum[8];  /* sum of processed message blocks */
-  uint8_t message[GOSTHASH94_BLOCK_SIZE]; /* 256-bit buffer for leftovers */
   uint64_t length;  /* number of processed bytes */
+  uint8_t message[GOSTHASH94_BLOCK_SIZE]; /* 256-bit buffer for leftovers */
 };
 
 void gosthash94_init(struct gosthash94_ctx *ctx);
diff --git a/md2.h b/md2.h
index 560b2cbc6728e2fd8137d9941aad663982c3d150..0fb9611bd0d995ae6b73cbb98ec66341325f3fe7 100644
--- a/md2.h
+++ b/md2.h
@@ -54,8 +54,8 @@ struct md2_ctx
 {
   uint8_t C[MD2_BLOCK_SIZE];
   uint8_t X[3 * MD2_BLOCK_SIZE];
-  uint8_t block[MD2_BLOCK_SIZE]; /* Block buffer */
   unsigned index;               /* Into buffer */
+  uint8_t block[MD2_BLOCK_SIZE]; /* Block buffer */
 };
 
 void
diff --git a/md4.h b/md4.h
index f199a80e63befc423acc7574847396a6c20cfe1e..fa30b237f01973ec5059299e8871202602e0a63c 100644
--- a/md4.h
+++ b/md4.h
@@ -58,8 +58,8 @@ struct md4_ctx
 {
   uint32_t state[_MD4_DIGEST_LENGTH];
   uint64_t count;			/* Block count */
-  uint8_t block[MD4_BLOCK_SIZE];	/* Block buffer */
   unsigned index;			/* Into buffer */
+  uint8_t block[MD4_BLOCK_SIZE];	/* Block buffer */
 };
 
 void
diff --git a/md5.h b/md5.h
index 6feb39cc380bbd7ab82d52ef7304864ddf53f96f..e5ae228e82178cbe7637dc55ac434248afdcdacc 100644
--- a/md5.h
+++ b/md5.h
@@ -57,8 +57,8 @@ struct md5_ctx
 {
   uint32_t state[_MD5_DIGEST_LENGTH];
   uint64_t count;               /* Block count */
-  uint8_t block[MD5_BLOCK_SIZE]; /* Block buffer */
   unsigned index;               /* Into buffer */
+  uint8_t block[MD5_BLOCK_SIZE]; /* Block buffer */
 };
 
 void
diff --git a/ripemd160.h b/ripemd160.h
index 4fee0c605ba57f444cddfbe59dda24683d341e93..238c5ee7a44c51c858e191718c9829e0410e1fdb 100644
--- a/ripemd160.h
+++ b/ripemd160.h
@@ -59,8 +59,8 @@ struct ripemd160_ctx
 {
   uint32_t state[_RIPEMD160_DIGEST_LENGTH];
   uint64_t count;         /* 64-bit block count */
-  uint8_t block[RIPEMD160_BLOCK_SIZE];
   unsigned int index;
+  uint8_t block[RIPEMD160_BLOCK_SIZE];
 };
 
 void
diff --git a/sha1.h b/sha1.h
index e84807d231d2c7683d663a5a0426a139102d6a29..0f4964f8f61c112ba8480df6bb7b1fe514763a61 100644
--- a/sha1.h
+++ b/sha1.h
@@ -59,8 +59,8 @@ struct sha1_ctx
 {
   uint32_t state[_SHA1_DIGEST_LENGTH];    /* State variables */
   uint64_t count;                         /* 64-bit block count */
-  uint8_t block[SHA1_BLOCK_SIZE];         /* SHA1 data buffer */
   unsigned int index;                     /* index into buffer */
+  uint8_t block[SHA1_BLOCK_SIZE];         /* SHA1 data buffer */
 };
 
 void
diff --git a/sha2.h b/sha2.h
index 7e02f1865d73d55e7809194b74beed8f25a71144..ca8222a7ece521cd0da2f5a79a538ca23be70643 100644
--- a/sha2.h
+++ b/sha2.h
@@ -74,8 +74,8 @@ struct sha256_ctx
 {
   uint32_t state[_SHA256_DIGEST_LENGTH];    /* State variables */
   uint64_t count;                           /* 64-bit block count */
-  uint8_t block[SHA256_BLOCK_SIZE];          /* SHA256 data buffer */
   unsigned int index;                       /* index into buffer */
+  uint8_t block[SHA256_BLOCK_SIZE];          /* SHA256 data buffer */
 };
 
 void
@@ -121,8 +121,8 @@ struct sha512_ctx
 {
   uint64_t state[_SHA512_DIGEST_LENGTH];    /* State variables */
   uint64_t count_low, count_high;           /* 128-bit block count */
-  uint8_t block[SHA512_BLOCK_SIZE];          /* SHA512 data buffer */
   unsigned int index;                       /* index into buffer */
+  uint8_t block[SHA512_BLOCK_SIZE];          /* SHA512 data buffer */
 };
 
 void