* apt-pkg/contrib/sha256.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 24 Jul 2006 20:49:39 +0000 (22:49 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 24 Jul 2006 20:49:39 +0000 (22:49 +0200)
  - fix the sha256 code (thanks to Jakob Bohm, closes: #378183)

apt-pkg/contrib/sha256.cc

index ad2ddb2..b75ce8a 100644 (file)
@@ -61,10 +61,10 @@ static inline u32 Maj(u32 x, u32 y, u32 z)
 
 static inline void LOAD_OP(int I, u32 *W, const u8 *input)
 {
-       W[I] = (  ((u32) input[I + 0] << 24)
-               | ((u32) input[I + 1] << 16)
-               | ((u32) input[I + 2] << 8)
-               | ((u32) input[I + 3]));
+       W[I] = (  ((u32) input[I * 4 + 0] << 24)
+               | ((u32) input[I * 4 + 1] << 16)
+               | ((u32) input[I * 4 + 2] << 8)
+               | ((u32) input[I * 4 + 3]));
 }
 
 static inline void BLEND_OP(int I, u32 *W)