Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6digest.h
Go to the documentation of this file.
1 
11 #ifndef P6DIGEST_H__
12 #define P6DIGEST_H__ 1
13 
14 #include "p6crypto.h"
15 
16 namespace P6R {
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
32 const P6DIGESTFLAGS P6DIGEST_NOFLAGS = 0x00000000;
33 const P6DIGESTFLAGS P6DIGEST_TRACEON = 0x00000001;
34 
35 
42 interface p6IDigest : public p6ICom
43 {
55  P6COMMETHOD initialize( P6DIGESTFLAGS flags ) = 0;
56 
83  P6COMMETHOD calculateMD2( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
84 
112  P6COMMETHOD calculateMD4( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
113 
141  P6COMMETHOD calculateMD5( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
142 
166  P6COMMETHOD calculateSHA1( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
167 
191  P6COMMETHOD calculateSHA224( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
192 
215  P6COMMETHOD calculateSHA256( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
216 
240  P6COMMETHOD calculateSHA384( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
241 
264  P6COMMETHOD calculateSHA512( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
265 
286  P6COMMETHOD calculateRIPEMD160( P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) = 0;
287 };
288 
289 // {28F63442-24BD-4741-8EC6-EA911570ED45}
290 #define IF_p6IDigest {0x28f63442,0x24bd,0x4741,{0x8e,0xc6,0xea,0x91,0x15,0x70,0xed,0x45}}
291 
292 // {930E6287-BC9F-4064-9185-029F5BF76B42}
293 #define COMP_p6Digest {0x930e6287,0xbc9f,0x4064,{0x91,0x85,0x2,0x9f,0x5b,0xf7,0x6b,0x42}}
294 
295 typedef enum {
306 } P6DIGESTS;
307 
308 static P6SIZE const P6DIGEST_MD2SZ = 16; //< Size of raw MD2 digest
309 static P6SIZE const P6DIGEST_MD4SZ = 16; //< Size of raw MD4 digest
310 static P6SIZE const P6DIGEST_MD5SZ = 16; //< Size of raw MD5 digest
311 static P6SIZE const P6DIGEST_SHA1SZ = 20; //< Size of raw SHA1 digest
312 static P6SIZE const P6DIGEST_SHA224SZ = 28; //< Size of raw SHA224 digest
313 static P6SIZE const P6DIGEST_SHA256SZ = 32; //< Size of raw SHA256 digest
314 static P6SIZE const P6DIGEST_SHA384SZ = 48; //< Size of raw SHA385 digest
315 static P6SIZE const P6DIGEST_SHA512SZ = 64; //< Size of raw SHA512 digest
316 static P6SIZE const P6DIGEST_RIPEMD160SZ = 20; //< Size of raw RIPEMD160
317 static P6SIZE const P6DIGEST_MAX = 64; //< MAX size of any supported raw digest
318 
319 
320 static P6SIZE const P6DIGEST_MD2STRSZ = 33; //< Size of MD2 digest represented as a hex narrow string with room for the null terminator
321 static P6SIZE const P6DIGEST_MD4STRSZ = 33; //< Size of MD4 digest represented as a hex narrow string with room for the null terminator
322 static P6SIZE const P6DIGEST_MD5STRSZ = 33; //< Size of MD5 digest represented as a hex narrow string with room for the null terminator
323 static P6SIZE const P6DIGEST_SHA1STRSZ = 41; //< Size of SHA1 digest represented as a hex narrow string with room for the null terminator
324 static P6SIZE const P6DIGEST_SHA224STRSZ = 57; //< Size of SHA224 digest represented as a hex narrow string with room for the null terminator
325 static P6SIZE const P6DIGEST_SHA256STRSZ = 65; //< Size of SHA256 digest represented as a hex narrow string with room for the null terminator
326 static P6SIZE const P6DIGEST_SHA384STRSZ = 97; //< Size of SHA385 digest represented as a hex narrow string with room for the null terminator
327 static P6SIZE const P6DIGEST_SHA512STRSZ = 129; //< Size of SHA512 digest represented as a hex narrow string with room for the null terminator
328 static P6SIZE const P6DIGEST_RIPEMD160STRSZ = 41; //< Size of RIPEMD160 digest represented as a hex narrow string with room for the null terminator
329 static P6SIZE const P6DIGEST_STRMAX = 129; //< MAX size of any supported digest
330 
331 #ifdef __cplusplus
332 }
333 #endif
334 
335 } // namespace
336 
337 
338 #endif
339 
340 
341 
342 
343 
344 
345 
size_t P6SIZE
Definition: p6types.h:62
This interface provides message digest generation.
Definition: p6digest.h:42
Cryptography component definitions.
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR calculateMD5(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
MD5 (Message Digest Algorithm 5) is a cryptographic hash function that was designed by Ron Rivest in ...
bool P6BOOL
Boolean type.
Definition: p6types.h:101
virtual P6R::P6ERR calculateSHA512(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
SHA512 cryptographic hash (in the SHA-2 family) function has a 512 bit digest size.
virtual P6R::P6ERR calculateSHA224(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
SHA224 cryptographic hash (in the SHA-2 family) function is simply a truncated version of SHA256 and ...
virtual P6R::P6ERR calculateSHA256(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
SHA256 cryptographic hash (in the SHA-2 family) function has a 256 bit digest size.
Where to get the data to process, either a file or generic buffer.
Definition: p6crypto.h:37
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
const P6DIGESTFLAGS P6DIGEST_TRACEON
Definition: p6digest.h:33
const P6DIGESTFLAGS P6DIGEST_NOFLAGS
Definition: p6digest.h:32
P6UINT32 P6DIGESTFLAGS
P6DIGESTFLAGS.
Definition: p6digest.h:31
virtual P6R::P6ERR calculateMD2(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
MD2 (Message Digest Algorithm 2) is a cryptographic hash function that was developed by Ronald Rivest...
virtual P6R::P6ERR calculateRIPEMD160(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
RIPEMD-160 cryptographic hash function (160 bit digest size) The RIPEMD-160 of either a file (both bi...
virtual P6R::P6ERR calculateSHA384(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
SHA384 cryptographic hash (in the SHA-2 family) function is simply a truncated version of SHA512 and ...
Where to put the data processed, either a file or generic buffer.
Definition: p6crypto.h:55
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR calculateMD4(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
MD4 (Message Digest Algorithm 4) is a cryptographic hash function that was designed by Professor Rona...
virtual P6R::P6ERR calculateSHA1(P6CRYPTODATASOURCE *pInData, P6BOOL base64Encode, P6CRYPTODATASINK *pOutData)=0
SHA1 cryptographic hash function (160 bit digest size) The SHA1 of either a file (both binary and tex...
P6DIGESTS
Definition: p6digest.h:295
virtual P6R::P6ERR initialize(P6DIGESTFLAGS flags)=0
This method inializes the component for use and must be called successfully before any other method...