10.07.2015 Views

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>CheckSum32 -- Update a running 32 bit checksumDescription:Prototype:Inputs:Returns:Notes:Computes and returns an updated unsigned long checksum derived from an unsigned byte valueand an unsigned long running checksum. The running checksum is typically zero for the firstcall, and the latest returned value for subsequent calls. The algorithm uses simple additionprimitives and has deterministic timing as shown below.ulong CheckSum32(uchar value, ulong runningSum);value is the next byte to checksumrunningSum is the running checksum from a previous call, usually initialized to zero for thefirst callthe updated checksum, either the final value, or the next value to pass as the running sumCalled automatically at BIOS startupCheckSum32Block -- Compute a 32 bit checksum for a block of dataDescription:Prototype:Inputs:Returns:Notes:Computes and returns an unsigned short checksum on a block of memory. Pass it a pointer tothe start of the block, the number of bytes to compute, and a starting checksum value (typicallyzero). The algorithm uses simple addition primitives and has deterministic timing.ushort CheckSum16Block(const void *data, ulong len, ushort runningSum);data points to the start of the data block to CRClen is the count in bytes to CRCrunningSum is the running checksum from a previous call, usually initialized to zero for thefirst callthe computed checksumCalled automatically at BIOS startupCRC16 -- Update a running 16 bit CCITT CRCDescription:Prototype:Inputs:Returns:Notes:Computes and returns an updated unsigned short cyclic redundancy check derived from anunsigned byte value and an unsigned short running CRC. The running CRC is typically zero forthe first call, and the latest returned value for subsequent calls. The algorithm is table drivenand has deterministic timing.ushort CRC16(uchar value, ushort runningCRC);value is the next byte to CRCrunningCRC is the running CRC from a previous call, usually initialized to zero for the first callthe updated CRC, either the final value, or the next value to pass as the running CRCCalled automatically at BIOS startupPERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.9 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!