X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4f5bd4471049f89c4ce52864e62f54aadf1804d4..4c58917103875358bb30622daf76d58918336968:/apt-pkg/contrib/sha256.cc?ds=sidebyside diff --git a/apt-pkg/contrib/sha256.cc b/apt-pkg/contrib/sha256.cc index ad2ddb2d3..ecda3d8e8 100644 --- a/apt-pkg/contrib/sha256.cc +++ b/apt-pkg/contrib/sha256.cc @@ -18,6 +18,12 @@ * any later version. * */ + +#ifdef __GNUG__ +#pragma implementation "apt-pkg/sha256.h" +#endif + + #define SHA256_DIGEST_SIZE 32 #define SHA256_HMAC_BLOCK_SIZE 64 @@ -61,10 +67,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)