X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cfde4904a7b61e2a3c75322a08a6fac3c062d65d..4b65cc13c74231e14a313ea05a2376cbc5155c5f:/apt-pkg/contrib/sha256.cc diff --git a/apt-pkg/contrib/sha256.cc b/apt-pkg/contrib/sha256.cc index a4d258d26..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,7 +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] = ntohl( ((u32*)(input))[I] ); + 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)