crc.h revision 5ae5011f5a5bce195e3f675803b667ec383d57ee
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * IPRT - CRCs and Checksums.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Copyright (C) 2006-2009 Sun Microsystems, Inc.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * available from http://www.virtualbox.org. This file is free software;
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * you can redistribute it and/or modify it under the terms of the GNU
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * General Public License (GPL) as published by the Free Software
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * The contents of this file may alternatively be used under the terms
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * of the Common Development and Distribution License Version 1.0
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * VirtualBox OSE distribution, in which case the provisions of the
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * CDDL are applicable instead of those of the GPL.
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * You may elect to license modified versions of this file under the
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * terms and conditions of either the GPL or the CDDL or both.
a55af63ead2dcca370bfc0dfe49771d9dcc61b93vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
e0778e583cb4a0bdc9bcc48f5957e00a01108388vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * additional information or have any questions.
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync/** @defgroup grp_rt_crc RTCrc - Checksums and CRCs.
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsync * @ingroup grp_rt
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync/** @defgroup grp_rt_crc32 CRC-32
b0ad0bbadf3a5b5258acda1bfe16f0ad8bee5ff0vboxsync * Calculate CRC-32 for a memory block.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns CRC-32 for the memory block.
229a63857c5fd2e441a62206eacce4156d0b2a26vboxsync * @param pv Pointer to the memory block.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @param cb Size of the memory block in bytes.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsyncRTDECL(uint32_t) RTCrc32(const void *pv, size_t cb);
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Start a multiblock CRC-32 calculation.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns Start CRC-32.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Processes a multiblock of a CRC-32 calculation.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns Intermediate CRC-32 value.
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync * @param uCRC32 Current CRC-32 intermediate value.
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync * @param pv The data block to process.
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync * @param cb The size of the data block in bytes.
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsyncRTDECL(uint32_t) RTCrc32Process(uint32_t uCRC32, const void *pv, size_t cb);
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Complete a multiblock CRC-32 calculation.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns CRC-32 value.
a2d9f81753c129b5e3bbe3769627dcd25a3724bdvboxsync * @param uCRC32 Current CRC-32 intermediate value.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync/** @defgroup grp_rt_crc64 CRC-64 Calculation
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Calculate CRC-64 for a memory block.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns CRC-64 for the memory block.
a0644dbbd30adb9bd2937110d6f016e56c4cc52bvboxsync * @param pv Pointer to the memory block.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @param cb Size of the memory block in bytes.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsyncRTDECL(uint64_t) RTCrc64(const void *pv, size_t cb);
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsync * Start a multiblock CRC-64 calculation.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * @returns Start CRC-64.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * Processes a multiblock of a CRC-64 calculation.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns Intermediate CRC-64 value.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @param uCRC64 Current CRC-64 intermediate value.
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsync * @param pv The data block to process.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * @param cb The size of the data block in bytes.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsyncRTDECL(uint64_t) RTCrc64Process(uint64_t uCRC64, const void *pv, size_t cb);
7c1f498692cd2393f8ba68cb62be482495106f93vboxsync * Complete a multiblock CRC-64 calculation.
4c8907a420ed66a42f729eb08cddf9c1e57f25eavboxsync * @returns CRC-64 value.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * @param uCRC64 Current CRC-64 intermediate value.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync/** @defgroup grp_rt_crc_adler32 Adler-32
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Calculate Adler-32 for a memory block.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * @returns Adler-32 for the memory block.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * @param pv Pointer to the memory block.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @param cb Size of the memory block in bytes.
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsyncRTDECL(uint32_t) RTCrcAdler32(void const *pv, size_t cb);
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * Start a multiblock Adler-32 calculation.
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsync * @returns Start Adler-32.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * Processes a multiblock of a Adler-32 calculation.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @returns Intermediate Adler-32 value.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @param uCrc Current Adler-32 intermediate value.
2711c80499bbd95e3da4a6cd2dffd9f81a5dce98vboxsync * @param pv The data block to process.
824ae3158a8b8f8233fec3f5a12c81f139933698vboxsync * @param cb The size of the data block in bytes.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsyncRTDECL(uint32_t) RTCrcAdler32Process(uint32_t uCrc, void const *pv, size_t cb);
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * Complete a multiblock Adler-32 calculation.
3a8aa22ef125135ef67bfc396771bcee15ef02dfvboxsync * @returns Adler-32 value.
a1b4fb3917412d2632d358ff8989f1ec971f2d5bvboxsync * @param uCrc Current Adler-32 intermediate value.