Selaa lähdekoodia

fixed an alignment bug
Author: tausq
Date: 2001-04-25 07:30:13 GMT
fixed an alignment bug

Arch Librarian 22 vuotta sitten
vanhempi
commit
70949daf17
1 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 5 4
      apt-pkg/contrib/sha1.h

+ 5 - 4
apt-pkg/contrib/sha1.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: sha1.h,v 1.1 2001/03/06 05:03:49 jgg Exp $
+// $Id: sha1.h,v 1.2 2001/04/25 07:30:13 tausq Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    SHA1SumValue - Storage for a SHA-1 hash.
    SHA1SumValue - Storage for a SHA-1 hash.
@@ -45,9 +45,10 @@ class SHA1SumValue
 
 
 class SHA1Summation
 class SHA1Summation
 {
 {
-   unsigned char Buffer[64];
-   unsigned char State[5*4];
-   unsigned char Count[2*4];
+   /* assumes 64-bit alignment just in case */
+   unsigned char Buffer[64] __attribute__((aligned(8)));
+   unsigned char State[5*4] __attribute__((aligned(8)));
+   unsigned char Count[2*4] __attribute__((aligned(8)));
    bool Done;
    bool Done;
    
    
    public:
    public: