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 
18 namespace P6R {
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #define P6CRYPTOIVLEN 16
25 
38 const P6SYMETRICFLAGS P6SYM_NOFLAGS = 0x00000000;
39 const P6SYMETRICFLAGS P6SYM_NOPADDING = 0x00000001;
40 const P6SYMETRICFLAGS P6SYM_TRACEON = 0x00000002;
41 
53 typedef P6VOID (*P6AESCOUNTERINC)( P6UCHAR* pCounter, P6UINT32 counterLength );
54 
55 
62 interface p6ISymmetricCrypto : public p6ICom
63 {
77  P6COMMETHOD initialize( P6SYMETRICFLAGS flags, P6CRYPTOCIPHER mode ) = 0;
78 
102  P6COMMETHOD setKey( p6ICryptoKey* pKey ) = 0;
103 
122  P6COMMETHOD getAESCounter( P6UCHAR* pBuffer, P6UINT32 cBuffer, P6UINT32* pWritten ) = 0;
123 
144  P6COMMETHOD setAESCounter( const P6UCHAR* pBuffer, P6UINT32* pcBuffer, P6AESCOUNTERINC pfn ) = 0;
145 
171  P6COMMETHOD encrypt( P6CRYPTODATASOURCE* pInData, P6CRYPTODATASINK* pOutData, const P6UCHAR *pIV, P6INT32 cIV ) = 0;
172 
198  P6COMMETHOD decrypt( P6CRYPTODATASOURCE* pInData, P6CRYPTODATASINK* pOutData, const P6UCHAR *pIV, P6INT32 cIV ) = 0;
199 
220  P6COMMETHOD decryptStart( const P6UCHAR *pIV, P6INT32 cIV ) = 0;
221 
244  P6COMMETHOD decryptContinue( const P6CHAR* pInData, P6UINT32 inSize, P6CHAR* pOutData, P6UINT32* pOutSize ) = 0;
245 
269  P6COMMETHOD decryptEnd( P6CHAR* pOutData, P6UINT32* pOutSize ) = 0;
270 
291  P6COMMETHOD encryptStart( const P6UCHAR *pIV, P6INT32 cIV ) = 0;
292 
315  P6COMMETHOD encryptContinue( const P6CHAR* pInData, P6UINT32 inSize, P6CHAR* pOutData, P6UINT32* pOutSize ) = 0;
316 
340  P6COMMETHOD encryptEnd( P6CHAR* pOutData, P6UINT32* pOutSize ) = 0;
341 };
342 
343 // {D504336D-FA03-4B15-B747-E1E233F59A0A}
344 #define IF_p6ISymmetricCrypto {0xD504336D,0xFA03,0x4B15,{0xB7,0x47,0xE1,0xE2,0x33,0xF5,0x9A,0x0A}}
345 
346 // {AD6FDDF7-DB55-470E-A057-E0449D342C92}
347 #define COMP_p6SymmetricCrypto {0xAD6FDDF7,0xDB55,0x470E,{0xA0,0x57,0xE0,0x44,0x9D,0x34,0x2C,0x92}}
348 
349 #ifdef __cplusplus
350 }
351 #endif
352 
353 } // namespace
354 
355 #endif
virtual P6R::P6ERR decryptStart(const P6UCHAR *pIV, P6INT32 cIV)=0
The decryptStart(), decryptContinue(), and decryptEnd() methods comprise a streaming decryption inter...
P6UINT32 P6SYMETRICFLAGS
P6SYMETRICFLAGS.
Definition: p6symmetric.h:37
unsigned char P6UCHAR
Definition: p6types.h:74
Cryptography component definitions.
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:787
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR getAESCounter(P6UCHAR *pBuffer, P6UINT32 cBuffer, P6UINT32 *pWritten)=0
Retrieves the current AES counter value.
virtual P6R::P6ERR encryptEnd(P6CHAR *pOutData, P6UINT32 *pOutSize)=0
The encryptStart(), encryptContinue(), and encryptEnd() methods comprise a streaming encryption inter...
virtual P6R::P6ERR encryptContinue(const P6CHAR *pInData, P6UINT32 inSize, P6CHAR *pOutData, P6UINT32 *pOutSize)=0
The encryptStart(), encryptContinue(), and encryptEnd() methods comprise a streaming encryption inter...
virtual P6R::P6ERR decryptContinue(const P6CHAR *pInData, P6UINT32 inSize, P6CHAR *pOutData, P6UINT32 *pOutSize)=0
The decryptStart(), decryptContinue(), and decryptEnd() methods comprise a streaming decryption inter...
const P6SYMETRICFLAGS P6SYM_NOPADDING
Definition: p6symmetric.h:39
virtual P6R::P6ERR setKey(p6ICryptoKey *pKey)=0
This method is used to specify which key to use for encryption and/or decryption. ...
virtual P6R::P6ERR initialize(P6SYMETRICFLAGS flags, P6CRYPTOCIPHER mode)=0
This method initlizes the component for use and must be called prior to calling any other method...
P6CRYPTOCIPHER
Cipher Type.
Definition: p6crypto.h:99
int P6INT32
Definition: p6types.h:41
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
virtual P6R::P6ERR setAESCounter(const P6UCHAR *pBuffer, P6UINT32 *pcBuffer, P6AESCOUNTERINC pfn)=0
Sets a new AES counter value.
Where to put the data processed, either a file or generic buffer.
Definition: p6crypto.h:55
virtual P6R::P6ERR encrypt(P6CRYPTODATASOURCE *pInData, P6CRYPTODATASINK *pOutData, const P6UCHAR *pIV, P6INT32 cIV)=0
This method is used to encrypt data using the cipher the component was initialized with...
virtual P6R::P6ERR encryptStart(const P6UCHAR *pIV, P6INT32 cIV)=0
The encryptStart(), encryptContinue(), and encryptEnd() methods comprise a streaming encryption inter...
#define P6COMMETHOD
Definition: p6types.h:872
This interface provides symmetric key encryption/decryption using AES, Blowfish, CAST5 DES and varian...
Definition: p6symmetric.h:62
virtual P6R::P6ERR decrypt(P6CRYPTODATASOURCE *pInData, P6CRYPTODATASINK *pOutData, const P6UCHAR *pIV, P6INT32 cIV)=0
This method is used to decrypt data using the cipher the component was initialized with...
void P6VOID
Definition: p6types.h:75
const P6SYMETRICFLAGS P6SYM_TRACEON
Definition: p6symmetric.h:40
virtual P6R::P6ERR decryptEnd(P6CHAR *pOutData, P6UINT32 *pOutSize)=0
The decryptStart(), decryptContinue(), and decryptEnd() methods comprise a streaming decryption inter...
P6VOID(* P6AESCOUNTERINC)(P6UCHAR *pCounter, P6UINT32 counterLength)
P6AESCOUNTERINC.
Definition: p6symmetric.h:53
const P6SYMETRICFLAGS P6SYM_NOFLAGS
Definition: p6symmetric.h:38
char P6CHAR
Narrow character type.
Definition: p6types.h:71
P6R Cryptographic key interface definitions.