Data Structures | Enumerations | Functions

Checksum Functions

Data Structures

struct  HW_CUSTOMCRC16INFO
 Custom CRC-16 parameters. More...
struct  HW_CUSTOMCRC32INFO
 Custom CRC-32 parameters. More...

Enumerations

enum  HW_CHECKSUM_ALGORITHM {
  HWCSA_CHECKSUM8 = 0x00000001, HWCSA_CHECKSUM16 = 0x00000002, HWCSA_CRC16 = 0x00000004, HWCSA_CRC16CCITT = 0x00000008,
  HWCSA_CRC32 = 0x00000010, HWCSA_MD2 = 0x00000020, HWCSA_MD4 = 0x00000040, HWCSA_MD5 = 0x00000080,
  HWCSA_SHA1 = 0x00000100, HWCSA_CHECKSUM32 = 0x00000200, HWCSA_CHECKSUM64 = 0x00000400, HWCSA_CUSTOM_CRC16 = 0x00000800,
  HWCSA_SHA224 = 0x00001000, HWCSA_SHA256 = 0x00002000, HWCSA_SHA384 = 0x00004000, HWCSA_SHA512 = 0x00008000,
  HWCSA_RIPEMD128 = 0x00010000, HWCSA_RIPEMD160 = 0x00020000, HWCSA_RIPEMD256 = 0x00040000, HWCSA_RIPEMD320 = 0x00080000,
  HWCSA_TIGER = 0x00100000, HWCSA_WHIRLPOOL = 0x00200000, HWCSA_CUSTOM_CRC32 = 0x00400000
}
 

Hex Workshop Checksum Algorithm types.

More...

Functions

HWAPI HWAPI_RESULT hwChecksumLength (HWSESSION hSession, HW_CHECKSUM_ALGORITHM algorithm, size_t *pnLength)
 Query result buffer size required for a check algorithm.
HWAPI HWAPI_RESULT hwChecksumDocument (HWDOCUMENT hDocument, HW_CHECKSUM_ALGORITHM algorithm, const void *vpAlgInfo, QWORD qwOffset, QWORD qwLength, void *vpResults, size_t nResults)
 Calculate a checksum for a document.
HWAPI HWAPI_RESULT hwChecksumBuffer (HWSESSION hSession, HW_CHECKSUM_ALGORITHM algorithm, const void *vpAlgInfo, const void *vBuffer, QWORD nBuffer, void *vpResults, size_t nResults)
 Calculate a checksum for a buffer.

Enumeration Type Documentation

Note:
These algorithms are defined as bitmasks; however, plug-ins may only define a single algorithm at a time.
Enumerator:
HWCSA_CHECKSUM8 

1 byte: Simple count where all the bytes are added in an 8 bit accumulator. Initial value is 0.

HWCSA_CHECKSUM16 

2 bytes: Simple count where all the bytes are added in an 16 bit accumulator. Initial value is 0.

HWCSA_CRC16 

2 bytes: 16 bit Cyclic Redundancy Check (CRC) with a polynomial of 0x8005 and an initial value of 0x0000.

HWCSA_CRC16CCITT 

2 bytes: 16 bit Cyclic Redundancy Check (CRC) with a polynomial of 0x1021 and an initial value of 0xFFFF.

HWCSA_CRC32 

4 bytes: 32 bit Cyclic Redundancy Check (CRC) with a polynomial of 0x04C11DB7 and an initial value of 0xFFFFFFFF.

HWCSA_MD2 

16 bytes: MD2 Message-Digest Algorithm (RSA Data Security, Inc.)

HWCSA_MD4 

16 bytes: MD4 Message-Digest Algorithm (RSA Data Security, Inc.)

HWCSA_MD5 

16 bytes: MD5 Message-Digest Algorithm (RSA Data Security, Inc.)

HWCSA_SHA1 

20 bytes: 160 bit Secure Hash Algorithm (NIST)

HWCSA_CHECKSUM32 

4 bytes: Simple count where all the bytes are added in an 32 bit accumulator. Initial value is 0.

HWCSA_CHECKSUM64 

8 bytes: Simple count where all the bytes are added in an 64 bit accumulator. Initial value is 0.

HWCSA_CUSTOM_CRC16 

2 bytes: 16 bit Cyclic Redundancy Check (CRC) with a user supplied polynomial and initial value.

HWCSA_SHA224 

28 bytes: 224 bit Secure Hash Algorithm (NIST)

HWCSA_SHA256 

32 bytes: 256 bit Secure Hash Algorithm (NIST)

HWCSA_SHA384 

48 bytes: 384 bit Secure Hash Algorithm (NIST)

HWCSA_SHA512 

64 bytes: 512 bit Secure Hash Algorithm (NIST)

HWCSA_RIPEMD128 

16 bytes: 128 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD)

HWCSA_RIPEMD160 

20 bytes: 160 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD)

HWCSA_RIPEMD256 

32 bytes: 256 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD)

HWCSA_RIPEMD320 

40 bytes: 320 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD)

HWCSA_TIGER 

24 bytes: 192 bit Tiger Digest Algorithm

HWCSA_WHIRLPOOL 

64 bytes: 512 bit Whirlpool Hash Algorithm

HWCSA_CUSTOM_CRC32 

4 bytes: 32 bit Cyclic Redundancy Check (CRC) with a user supplied polynomial and initial value.

Definition at line 781 of file hwapi.h.


Function Documentation

HWAPI HWAPI_RESULT hwChecksumBuffer ( HWSESSION  hSession,
HW_CHECKSUM_ALGORITHM  algorithm,
const void *  vpAlgInfo,
const void *  vBuffer,
QWORD  nBuffer,
void *  vpResults,
size_t  nResults 
)
Parameters:
hSession[IN] Hex Workshop Plug-in session handle
algorithm[IN] Algorithm type as defined by HW_CHECKSUM_ALGORITHM
vpAlgInfo[IN] Optional pointer to a HW_CUSTOMCRC16INFO or HW_CUSTOMCRC32INFO structuer for HWCSA_CUSTOM_CRC16 and HWCSA_CUSTOM_CRC32 algorithms. If NULL, Hex Workshop will use the user defaults. Must be NULL for other algorithms.
vBuffer[IN] Buffer to calculate checksum on
nBuffer[IN] Size of buffer to calculate checksum on
vpResults[OUT] Buffer to place results
nResults[IN] Size of results buffer
See also:
HW_CHECKSUM_ALGORITHM, hwChecksumLength
HW_CUSTOMCRC16INFO, HW_CUSTOMCRC32INFO
Returns:
HWAPI_RESULT_SUCCESS on success, otherwise see hwapierr.h for error codes
HWAPI HWAPI_RESULT hwChecksumDocument ( HWDOCUMENT  hDocument,
HW_CHECKSUM_ALGORITHM  algorithm,
const void *  vpAlgInfo,
QWORD  qwOffset,
QWORD  qwLength,
void *  vpResults,
size_t  nResults 
)
Parameters:
hDocument[IN] Hex Workshop document handle
algorithm[IN] Algorithm type as defined by HW_CHECKSUM_ALGORITHM
vpAlgInfo[IN] Optional pointer to a HW_CUSTOMCRC16INFO or HW_CUSTOMCRC32INFO structuer for HWCSA_CUSTOM_CRC16 and HWCSA_CUSTOM_CRC32 algorithms. If NULL, Hex Workshop will use the user defaults. Must be NULL for other algorithms.
qwOffset[IN] Starting offset location
qwLength[IN] Length (in bytes) to checksum, starting from qwOffset
vpResults[OUT] Buffer to place results
nResults[IN] Size of results buffer
See also:
HW_CHECKSUM_ALGORITHM, hwChecksumLength
HW_CUSTOMCRC16INFO, HW_CUSTOMCRC32INFO
Returns:
HWAPI_RESULT_SUCCESS on success, otherwise see hwapierr.h for error codes
HWAPI HWAPI_RESULT hwChecksumLength ( HWSESSION  hSession,
HW_CHECKSUM_ALGORITHM  algorithm,
size_t *  pnLength 
)
Parameters:
hSession[IN] Hex Workshop Plug-in session handle
algorithm[IN] Algorithm type as defined by HW_CHECKSUM_ALGORITHM
pnLength[OUT] Checksum result size in bytes
See also:
HW_CHECKSUM_ALGORITHM, hwChecksumDocument, hwChecksumBuffer
Returns:
HWAPI_RESULT_SUCCESS on success, otherwise see hwapierr.h for error codes

Copyright © 2010 BreakPoint Software, Inc. All Right Reserved.
Generated on Sat Jan 1 2011 07:53:51 for Hex Workshop Plug-in API by doxygen 1.7.2