about summary refs log tree commit diff
path: root/crypt/sha256.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-02 12:30:03 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-02 12:30:03 -0400
commitfcfc776bc6242fdefde0efd7b0c315fbeca08555 (patch)
treec46c6b25047a2ed2f6baea7b76985f1d7bec3c4c /crypt/sha256.h
parent99231d9abe0fd74c7957d25b08c1d1ede4cae5a0 (diff)
downloadglibc-fcfc776bc6242fdefde0efd7b0c315fbeca08555.tar.gz
glibc-fcfc776bc6242fdefde0efd7b0c315fbeca08555.tar.xz
glibc-fcfc776bc6242fdefde0efd7b0c315fbeca08555.zip
Optimize long-word additions in SHA implementation
Diffstat (limited to 'crypt/sha256.h')
-rw-r--r--crypt/sha256.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypt/sha256.h b/crypt/sha256.h
index be8b0772cb..fcf61485de 100644
--- a/crypt/sha256.h
+++ b/crypt/sha256.h
@@ -1,6 +1,6 @@
 /* Declaration of functions and data types used for SHA256 sum computing
    library functions.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,11 @@ struct sha256_ctx
 {
   uint32_t H[8];
 
-  uint32_t total[2];
+  union
+  {
+    uint64_t total64;
+    uint32_t total[2];
+  };
   uint32_t buflen;
   char buffer[128] __attribute__ ((__aligned__ (__alignof__ (uint32_t))));
 };