summaryrefslogtreecommitdiff
path: root/crypt/sha256.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-19 16:53:43 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-19 16:53:43 -0400
commit7dc6bd90c569c49807462b0740b18e32fab4d8b7 (patch)
tree1b6b4a3df6408992625f329206dbe98619589a17 /crypt/sha256.h
parente0e722848005e335132015a64a09cad7f7a12073 (diff)
downloadglibc-7dc6bd90c569c49807462b0740b18e32fab4d8b7.tar.gz
Use union to avoid casts in code to store results of hashsum computations
Diffstat (limited to 'crypt/sha256.h')
-rw-r--r--crypt/sha256.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypt/sha256.h b/crypt/sha256.h
index 0457bfae40..05f2db57e7 100644
--- a/crypt/sha256.h
+++ b/crypt/sha256.h
@@ -40,7 +40,12 @@ struct sha256_ctx
uint32_t total[2];
};
uint32_t buflen;
- char buffer[128] __attribute__ ((__aligned__ (__alignof__ (uint32_t))));
+ union
+ {
+ char buffer[128];
+ uint32_t buffer32[32];
+ uint64_t buffer64[16];
+ };
};
/* Initialize structure containing state of computation.