mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Implement CRC64.
This commit is contained in:
@@ -56,6 +56,9 @@
|
||||
/** This mask is to check for position in CompactDisc suffix/prefix deduplicated block */
|
||||
#define CD_DFIX_MASK 0x00FFFFFF
|
||||
|
||||
#define CRC64_ECMA_POLY 0xC96C5795D7870F42
|
||||
#define CRC64_ECMA_SEED 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
#endif //LIBDICFORMAT_CONSTS_H
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
@@ -46,5 +46,16 @@ int close(void *context);
|
||||
|
||||
uint8_t *read_media_tag(void *context, int tag);
|
||||
|
||||
void *crc64_init(uint64_t polynomial, uint64_t seed);
|
||||
|
||||
void *crc64_init_ecma(void);
|
||||
|
||||
void crc64_update(void *context, const char *data, size_t len);
|
||||
|
||||
uint64_t crc64_final(void *context);
|
||||
|
||||
uint64_t crc64_data(const char *data, size_t len, uint64_t polynomial, uint64_t seed);
|
||||
|
||||
uint64_t crc64_data_ecma(const char *data, size_t len);
|
||||
|
||||
#endif //LIBDICFORMAT_DECLS_H
|
||||
|
||||
@@ -302,6 +302,12 @@ typedef struct ChecksumEntry
|
||||
uint32_t length;
|
||||
} ChecksumEntry;
|
||||
|
||||
typedef struct Crc64Context
|
||||
{
|
||||
uint64_t finalSeed;
|
||||
uint64_t table[256];
|
||||
uint64_t hashInt;
|
||||
} Crc64Context;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user