add crc32

This commit is contained in:
Steffen Jaeckel
2015-08-23 22:02:42 +02:00
parent 9585faca2b
commit ee03c97cde
6 changed files with 228 additions and 0 deletions
+2
View File
@@ -432,6 +432,8 @@
#define LTC_ADLER32
#define LTC_CRC32
#endif /* LTC_NO_MISC */
/* cleanup */
+12
View File
@@ -81,6 +81,18 @@ void adler32_finish(adler32_state *ctx, void *hash, unsigned long size);
int adler32_test(void);
#endif
#ifdef LTC_CRC32
typedef struct crc32_state_s
{
ulong32 crc;
} crc32_state;
void crc32_init(crc32_state *ctx);
void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length);
void crc32_finish(crc32_state *ctx, void *hash, unsigned long size);
int crc32_test(void);
#endif
/* yeah it's not exactly in misc in the library, but in testprof/x86_prof.c */
#if defined(LTC_TEST) && defined(LTC_TEST_DBG)
void print_hex(const char* what, const unsigned char* p, const unsigned long l);