Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6symmetric.h
Go to the documentation of this file.
1 
11 #ifndef P6SYMMETRIC_H__
12 #define P6SYMMETRIC_H__ 1
13 
14 #include "p6crypto.h"
15 #include "p6cryptokey.h"
16 
17 #ifdef __cplusplus
18 namespace P6R {
19 extern "C" {
20 #endif
21 
22 #define P6CRYPTOIVLEN 16
23 
36 static const P6SYMETRICFLAGS P6SYM_NOFLAGS = 0x00000000;
37 static const P6SYMETRICFLAGS P6SYM_NOPADDING = 0x00000001;
38 static const P6SYMETRICFLAGS P6SYM_TRACEON = 0x00000002;
39 
51 typedef P6VOID (*P6AESCOUNTERINC)( P6UCHAR* pCounter, P6UINT32 counterLength );
52 
53 
60 #undef INTERFACE
61 #define INTERFACE p6ISymmetricCrypto
63 {
78  P6DECLCOMMETHOD(initialize)(P6THIS_ P6SYMETRICFLAGS flags, P6CRYPTOCIPHER mode ) P6PURE;
79 
103  P6DECLCOMMETHOD(setKey)(P6THIS_ p6ICryptoKey* pKey ) P6PURE;
104 
123  P6DECLCOMMETHOD(getAESCounter)(P6THIS_ P6UCHAR* pBuffer, P6UINT32 cBuffer, P6UINT32* pWritten ) P6PURE;
124 
145  P6DECLCOMMETHOD(setAESCounter)(P6THIS_ const P6UCHAR* pBuffer, P6UINT32* pcBuffer, P6AESCOUNTERINC pfn ) P6PURE;
146 
172  P6DECLCOMMETHOD(encrypt)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6CRYPTODATASINK* pOutData, const P6UCHAR *pIV, P6INT32 cIV ) P6PURE;
173 
199  P6DECLCOMMETHOD(decrypt)(P6THIS_ P6CRYPTODATASOURCE* pInData, P6CRYPTODATASINK* pOutData, const P6UCHAR *pIV, P6INT32 cIV ) P6PURE;
200 
221  P6DECLCOMMETHOD(decryptStart)(P6THIS_ const P6UCHAR *pIV, P6INT32 cIV ) P6PURE;
222 
245  P6DECLCOMMETHOD(decryptContinue)(P6THIS_ const P6CHAR* pInData, P6UINT32 inSize, P6CHAR* pOutData, P6UINT32* pOutSize ) P6PURE;
246 
270  P6DECLCOMMETHOD(decryptEnd)(P6THIS_ P6CHAR* pOutData, P6UINT32* pOutSize ) P6PURE;
271 
292  P6DECLCOMMETHOD(encryptStart)(P6THIS_ const P6UCHAR *pIV, P6INT32 cIV ) P6PURE;
293 
316  P6DECLCOMMETHOD(encryptContinue)(P6THIS_ const P6CHAR* pInData, P6UINT32 inSize, P6CHAR* pOutData, P6UINT32* pOutSize ) P6PURE;
317 
341  P6DECLCOMMETHOD(encryptEnd)(P6THIS_ P6CHAR* pOutData, P6UINT32* pOutSize ) P6PURE;
342 };
343 
344 // {D504336D-FA03-4B15-B747-E1E233F59A0A}
345 #define IF_p6ISymmetricCrypto {0xD504336D,0xFA03,0x4B15,{0xB7,0x47,0xE1,0xE2,0x33,0xF5,0x9A,0x0A}}
346 
347 // {AD6FDDF7-DB55-470E-A057-E0449D342C92}
348 #define COMP_p6SymmetricCrypto {0xAD6FDDF7,0xDB55,0x470E,{0xA0,0x57,0xE0,0x44,0x9D,0x34,0x2C,0x92}}
349 
350 #ifdef __cplusplus
351 } /* extern "C" */
352 } // namespace
353 #endif
354 
355 
356 #endif
P6UINT32 P6SYMETRICFLAGS
P6SYMETRICFLAGS.
Definition: p6symmetric.h:35
unsigned char P6UCHAR
Definition: p6types.h:108
Cryptography component definitions.
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:1198
uint32_t P6UINT32
Definition: p6types.h:77
#define P6DECLAREICOM
Definition: p6defs.h:191
#define P6PURE
Definition: p6defs.h:192
P6CRYPTOCIPHER
Cipher Type.
Definition: p6crypto.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
Where to put the data processed, either a file or generic buffer.
Definition: p6crypto.h:54
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
This interface provides symmetric key encryption/decryption using AES, Blowfish, CAST5 DES and varian...
Definition: p6symmetric.h:62
#define P6THIS_
Definition: p6defs.h:193
void P6VOID
Definition: p6types.h:109
int32_t P6INT32
Definition: p6types.h:76
P6VOID(* P6AESCOUNTERINC)(P6UCHAR *pCounter, P6UINT32 counterLength)
P6AESCOUNTERINC.
Definition: p6symmetric.h:51
char P6CHAR
Narrow character type.
Definition: p6types.h:105
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188
P6R Cryptographic key interface definitions.