1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Prototypes for different check functions
6 // This code has been put into the public domain.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 ///////////////////////////////////////////////////////////////////////////////
24 /// Temporary 8-byte aligned buffer to hold incomplete chunk.
25 /// After lzma_check_finish(), the first 32 bytes will contain
26 /// the final digest in big endian byte order.
29 /// Size of the message excluding padding
35 /// \note This is not in the public API because this structure will
45 extern uint32_t lzma_crc32_table[8][256];
46 extern uint64_t lzma_crc64_table[4][256];
48 extern const uint32_t lzma_crc32_table[8][256];
49 extern const uint64_t lzma_crc64_table[4][256];
54 /// \brief Initializes *check depending on type
56 /// \return LZMA_OK on success. LZMA_UNSUPPORTED_CHECK if the type is not
57 /// supported by the current version or build of liblzma.
58 /// LZMA_PROG_ERROR if type > LZMA_CHECK_ID_MAX.
60 extern lzma_ret lzma_check_init(lzma_check *check, lzma_check_type type);
62 /// \brief Updates *check
64 extern void lzma_check_update(lzma_check *check, lzma_check_type type,
65 const uint8_t *buf, size_t size);
67 /// \brief Finishes *check
69 extern void lzma_check_finish(lzma_check *check, lzma_check_type type);
73 /// \brief Compare two checks
75 /// \return false if the checks are identical; true if they differ.
77 extern bool lzma_check_compare(
78 lzma_check *check1, lzma_check *check2, lzma_check_type type);
84 extern void lzma_crc32_init(void);
89 extern void lzma_crc64_init(void);
94 extern void lzma_sha256_init(lzma_sha256 *sha256);
96 extern void lzma_sha256_update(
97 const uint8_t *buf, size_t size, lzma_sha256 *sha256);
99 extern void lzma_sha256_finish(lzma_sha256 *sha256);