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 
17 #ifdef __cplusplus
18 namespace P6R {
19 extern "C" {
20 #endif
21 
34 static const P6DIGESTFLAGS P6DIGEST_NOFLAGS = 0x00000000;
35 static const P6DIGESTFLAGS P6DIGEST_TRACEON = 0x00000001;
36 static const P6DIGESTFLAGS P6DIGEST_NONULLTERM = 0x00000002;
37 
43 typedef enum {
54 } P6DIGESTS;
55 
56 static P6SIZE const P6DIGEST_MD2SZ = 16; //< Size of raw MD2 digest
57 static P6SIZE const P6DIGEST_MD4SZ = 16; //< Size of raw MD4 digest
58 static P6SIZE const P6DIGEST_MD5SZ = 16; //< Size of raw MD5 digest
59 static P6SIZE const P6DIGEST_SHA1SZ = 20; //< Size of raw SHA1 digest
60 static P6SIZE const P6DIGEST_SHA224SZ = 28; //< Size of raw SHA224 digest
61 static P6SIZE const P6DIGEST_SHA256SZ = 32; //< Size of raw SHA256 digest
62 static P6SIZE const P6DIGEST_SHA384SZ = 48; //< Size of raw SHA385 digest
63 static P6SIZE const P6DIGEST_SHA512SZ = 64; //< Size of raw SHA512 digest
64 static P6SIZE const P6DIGEST_RIPEMD160SZ = 20; //< Size of raw RIPEMD160
65 static P6SIZE const P6DIGEST_MAX = 64; //< MAX size of any supported raw digest
66 
67 
68 static P6SIZE const P6DIGEST_MD2STRSZ = 33; //< Size of MD2 digest represented as a hex narrow string with room for the null terminator
69 static P6SIZE const P6DIGEST_MD4STRSZ = 33; //< Size of MD4 digest represented as a hex narrow string with room for the null terminator
70 static P6SIZE const P6DIGEST_MD5STRSZ = 33; //< Size of MD5 digest represented as a hex narrow string with room for the null terminator
71 static P6SIZE const P6DIGEST_SHA1STRSZ = 41; //< Size of SHA1 digest represented as a hex narrow string with room for the null terminator
72 static P6SIZE const P6DIGEST_SHA224STRSZ = 57; //< Size of SHA224 digest represented as a hex narrow string with room for the null terminator
73 static P6SIZE const P6DIGEST_SHA256STRSZ = 65; //< Size of SHA256 digest represented as a hex narrow string with room for the null terminator
74 static P6SIZE const P6DIGEST_SHA384STRSZ = 97; //< Size of SHA385 digest represented as a hex narrow string with room for the null terminator
75 static P6SIZE const P6DIGEST_SHA512STRSZ = 129; //< Size of SHA512 digest represented as a hex narrow string with room for the null terminator
76 static P6SIZE const P6DIGEST_RIPEMD160STRSZ = 41; //< Size of RIPEMD160 digest represented as a hex narrow string with room for the null terminator
77 static P6SIZE const P6DIGEST_STRMAX = 129; //< MAX size of any supported digest
78 
79 
80 
87 #undef INTERFACE
88 #define INTERFACE p6IDigest
90 {
103  P6DECLCOMMETHOD(initialize)(P6THIS_ P6DIGESTFLAGS flags ) P6PURE;
104 
131  P6DECLCOMMETHOD(calculateMD2)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
132 
160  P6DECLCOMMETHOD(calculateMD4)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
161 
189  P6DECLCOMMETHOD(calculateMD5)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
190 
214  P6DECLCOMMETHOD(calculateSHA1)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
215 
239  P6DECLCOMMETHOD(calculateSHA224)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
240 
263  P6DECLCOMMETHOD(calculateSHA256)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
264 
288  P6DECLCOMMETHOD(calculateSHA384)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
289 
312  P6DECLCOMMETHOD(calculateSHA512)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
313 
334  P6DECLCOMMETHOD(calculateRIPEMD160)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
335 };
336 
337 // {28F63442-24BD-4741-8EC6-EA911570ED45}
338 #define IF_p6IDigest {0x28f63442,0x24bd,0x4741,{0x8e,0xc6,0xea,0x91,0x15,0x70,0xed,0x45}}
339 
340 // {930E6287-BC9F-4064-9185-029F5BF76B42}
341 #define COMP_p6Digest {0x930e6287,0xbc9f,0x4064,{0x91,0x85,0x2,0x9f,0x5b,0xf7,0x6b,0x42}}
342 
343 
351 #undef INTERFACE
352 #define INTERFACE p6IDigest2
354 {
367  P6DECLCOMMETHOD(initialize)(P6THIS_ P6DIGESTFLAGS flags ) P6PURE;
368 
395  P6DECLCOMMETHOD(calculateMD2)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
396 
424  P6DECLCOMMETHOD(calculateMD4)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
425 
453  P6DECLCOMMETHOD(calculateMD5)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
454 
478  P6DECLCOMMETHOD(calculateSHA1)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
479 
503  P6DECLCOMMETHOD(calculateSHA224)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
504 
527  P6DECLCOMMETHOD(calculateSHA256)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
528 
552  P6DECLCOMMETHOD(calculateSHA384)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
553 
576  P6DECLCOMMETHOD(calculateSHA512)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
577 
598  P6DECLCOMMETHOD(calculateRIPEMD160)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
599 
618  P6DECLCOMMETHOD(digestStart)(P6THIS_ P6DIGESTS algorithm, P6BOOL base64Encode ) P6PURE;
619 
639  P6DECLCOMMETHOD(digestContinue)(P6THIS_ const P6UCHAR* pInData, P6UINT32 inSize ) P6PURE;
640 
664  P6DECLCOMMETHOD(digestEnd)(P6THIS_ P6UCHAR* pDigest, P6UINT32* pDigestSize ) P6PURE;
665 };
666 
667 // {2708AA22-EA65-4aa6-98AE-AC0EFEA20D8E}
668 #define IF_p6IDigest2 {0x2708aa22,0xea65,0x4aa6,{0x98,0xae,0xac,0xe,0xfe,0xa2,0xd,0x8e}}
669 
670 
671 #ifdef __cplusplus
672 } /* exrern "C" */
673 } // namespace
674 #endif
675 
676 
677 
678 #endif
679 
680 
681 
682 
683 
684 
685 
size_t P6SIZE
Definition: p6types.h:90
This interface provides message digest generation.
Definition: p6digest.h:89
unsigned char P6UCHAR
Definition: p6types.h:108
Cryptography component definitions.
uint32_t P6UINT32
Definition: p6types.h:77
This interface provides message digest generation.
Definition: p6digest.h:353
#define P6DECLAREICOM
Definition: p6defs.h:191
#define P6PURE
Definition: p6defs.h:192
unsigned char P6BOOL
Boolean type.
Definition: p6types.h:133
Where to get the data to process, either a file or generic buffer.
Definition: p6crypto.h:36
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:97
P6UINT32 P6DIGESTFLAGS
P6DIGESTFLAGS.
Definition: p6digest.h:33
Where to put the data processed, either a file or generic buffer.
Definition: p6crypto.h:54
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
#define P6THIS_
Definition: p6defs.h:193
P6DIGESTS
P6DIGESTS.
Definition: p6digest.h:43
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188