X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib%2Fcrc32.c;h=97592124867abb815d576899f8789545c3aef1aa;hb=3b95902d47f89f95242ac143cd2a9ed1fd196157;hp=27335a3ed9095b19d533c33a742fd752935d4640;hpb=78acc472d9719316f22e002a009a998d9ceec29d;p=oweals%2Fu-boot.git diff --git a/lib/crc32.c b/lib/crc32.c index 27335a3ed9..9759212486 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -8,7 +8,9 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -#ifndef USE_HOSTCC +#ifdef USE_HOSTCC +#include +#else #include #endif #include @@ -249,3 +251,13 @@ uint32_t ZEXPORT crc32_wd (uint32_t crc, return crc; } + +void crc32_wd_buf(const unsigned char *input, unsigned int ilen, + unsigned char *output, unsigned int chunk_sz) +{ + uint32_t crc; + + crc = crc32_wd(0, input, ilen, chunk_sz); + crc = htonl(crc); + memcpy(output, &crc, sizeof(crc)); +}