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 
32 const P6DIGESTFLAGS P6DIGEST_NOFLAGS = 0x00000000;
33 const P6DIGESTFLAGS P6DIGEST_TRACEON = 0x00000001;
34 
35 
42 #undef INTERFACE
43 #define INTERFACE p6IDigest
45 {
58  P6DECLCOMMETHOD(initialize)(P6THIS_ P6DIGESTFLAGS flags ) P6PURE;
59 
86  P6DECLCOMMETHOD(calculateMD2)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
87 
115  P6DECLCOMMETHOD(calculateMD4)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
116 
144  P6DECLCOMMETHOD(calculateMD5)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
145 
169  P6DECLCOMMETHOD(calculateSHA1)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
170 
194  P6DECLCOMMETHOD(calculateSHA224)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
195 
218  P6DECLCOMMETHOD(calculateSHA256)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
219 
243  P6DECLCOMMETHOD(calculateSHA384)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
244 
267  P6DECLCOMMETHOD(calculateSHA512)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
268 
289  P6DECLCOMMETHOD(calculateRIPEMD160)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6BOOL base64Encode, P6CRYPTODATASINK* pOutData ) P6PURE;
290 };
291 
292 // {28F63442-24BD-4741-8EC6-EA911570ED45}
293 #define IF_p6IDigest {0x28f63442,0x24bd,0x4741,{0x8e,0xc6,0xea,0x91,0x15,0x70,0xed,0x45}}
294 
295 // {930E6287-BC9F-4064-9185-029F5BF76B42}
296 #define COMP_p6Digest {0x930e6287,0xbc9f,0x4064,{0x91,0x85,0x2,0x9f,0x5b,0xf7,0x6b,0x42}}
297 
298 typedef enum {
309 } P6DIGESTS;
310 
311 static P6SIZE const P6DIGEST_MD2SZ = 16; //< Size of raw MD2 digest
312 static P6SIZE const P6DIGEST_MD4SZ = 16; //< Size of raw MD4 digest
313 static P6SIZE const P6DIGEST_MD5SZ = 16; //< Size of raw MD5 digest
314 static P6SIZE const P6DIGEST_SHA1SZ = 20; //< Size of raw SHA1 digest
315 static P6SIZE const P6DIGEST_SHA224SZ = 28; //< Size of raw SHA224 digest
316 static P6SIZE const P6DIGEST_SHA256SZ = 32; //< Size of raw SHA256 digest
317 static P6SIZE const P6DIGEST_SHA384SZ = 48; //< Size of raw SHA385 digest
318 static P6SIZE const P6DIGEST_SHA512SZ = 64; //< Size of raw SHA512 digest
319 static P6SIZE const P6DIGEST_RIPEMD160SZ = 20; //< Size of raw RIPEMD160
320 static P6SIZE const P6DIGEST_MAX = 64; //< MAX size of any supported raw digest
321 
322 
323 static P6SIZE const P6DIGEST_MD2STRSZ = 33; //< Size of MD2 digest represented as a hex narrow string with room for the null terminator
324 static P6SIZE const P6DIGEST_MD4STRSZ = 33; //< Size of MD4 digest represented as a hex narrow string with room for the null terminator
325 static P6SIZE const P6DIGEST_MD5STRSZ = 33; //< Size of MD5 digest represented as a hex narrow string with room for the null terminator
326 static P6SIZE const P6DIGEST_SHA1STRSZ = 41; //< Size of SHA1 digest represented as a hex narrow string with room for the null terminator
327 static P6SIZE const P6DIGEST_SHA224STRSZ = 57; //< Size of SHA224 digest represented as a hex narrow string with room for the null terminator
328 static P6SIZE const P6DIGEST_SHA256STRSZ = 65; //< Size of SHA256 digest represented as a hex narrow string with room for the null terminator
329 static P6SIZE const P6DIGEST_SHA384STRSZ = 97; //< Size of SHA385 digest represented as a hex narrow string with room for the null terminator
330 static P6SIZE const P6DIGEST_SHA512STRSZ = 129; //< Size of SHA512 digest represented as a hex narrow string with room for the null terminator
331 static P6SIZE const P6DIGEST_RIPEMD160STRSZ = 41; //< Size of RIPEMD160 digest represented as a hex narrow string with room for the null terminator
332 static P6SIZE const P6DIGEST_STRMAX = 129; //< MAX size of any supported digest
333 
334 #ifdef __cplusplus
335 } /* exrern "C" */
336 } // namespace
337 #endif
338 
339 
340 
341 #endif
342 
343 
344 
345 
346 
347 
348 
size_t P6SIZE
Definition: p6types.h:72
This interface provides message digest generation.
Definition: p6digest.h:44
Cryptography component definitions.
unsigned int P6UINT32
Definition: p6types.h:46
#define P6DECLAREICOM
Definition: p6defs.h:175
#define P6PURE
Definition: p6defs.h:176
unsigned char P6BOOL
Boolean type.
Definition: p6types.h:112
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
const P6DIGESTFLAGS P6DIGEST_TRACEON
Definition: p6digest.h:33
const P6DIGESTFLAGS P6DIGEST_NOFLAGS
Definition: p6digest.h:32
P6UINT32 P6DIGESTFLAGS
P6DIGESTFLAGS.
Definition: p6digest.h:31
Where to put the data processed, either a file or generic buffer.
Definition: p6crypto.h:54
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:173
#define P6THIS_
Definition: p6defs.h:177
P6DIGESTS
Definition: p6digest.h:298
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:172