crc64.h revision 154e1d5579ca6c8bee571a8d1ced5d76a0234030
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/** @file
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * innotek Portable Runtime - CRC64.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/*
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Copyright (C) 2006-2007 innotek GmbH
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby *
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * This file is part of VirtualBox Open Source Edition (OSE), as
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * available from http://www.virtualbox.org. This file is free software;
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * you can redistribute it and/or modify it under the terms of the GNU
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * General Public License as published by the Free Software Foundation,
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * distribution. VirtualBox OSE is distributed in the hope that it will
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * be useful, but WITHOUT ANY WARRANTY of any kind.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby *
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * If you received this file as part of a commercial VirtualBox
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * distribution, then only the terms of your commercial VirtualBox
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * license agreement apply instead of the previous paragraph.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby#ifndef ___iprt_crc64_h
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby#define ___iprt_crc64_h
2db6d663182655cb393dc2c15668bc9293364594Joshua M. Clulow
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby#include <iprt/cdefs.h>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby#include <iprt/types.h>
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby__BEGIN_DECLS
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/** @defgroup grp_rt_crc64 RTCrc64 - CRC64 Calculation
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @ingroup grp_rt
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @{
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/**
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Calculate CRC64 for a memory block.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby *
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @returns CRC64 for the memory block.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @param pv Pointer to the memory block.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @param cb Size of the memory block in bytes.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyRTDECL(uint64_t) RTCrc64(const void *pv, size_t cb);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/**
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Start a multiblock CRC64 calculation.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby *
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @returns Start CRC64.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyRTDECL(uint64_t) RTCrc64Start(void);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/**
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Processes a multiblock of a CRC64 calculation.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby *
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @returns Intermediate CRC64 value.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @param uCRC64 Current CRC64 intermediate value.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @param pv The data block to process.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @param cb The size of the data block in bytes.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyRTDECL(uint64_t) RTCrc64Process(uint64_t uCRC64, const void *pv, size_t cb);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/**
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * Complete a multiblock CRC64 calculation.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby *
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @returns CRC64 value.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby * @param uCRC64 Current CRC64 intermediate value.
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin MaltbyRTDECL(uint64_t) RTCrc64Finish(uint64_t uCRC64);
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby/** @} */
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby__END_DECLS
f6e214c7418f43af38bd8c3a557e3d0a1d311cfaGavin Maltby
2db6d663182655cb393dc2c15668bc9293364594Joshua M. Clulow#endif
2db6d663182655cb393dc2c15668bc9293364594Joshua M. Clulow
2db6d663182655cb393dc2c15668bc9293364594Joshua M. Clulow
2db6d663182655cb393dc2c15668bc9293364594Joshua M. Clulow