cipher.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _WIZARDSTOOLKIT_CIPHER_H
00019 #define _WIZARDSTOOLKIT_CIPHER_H
00020
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024
00025 #include "wizard/random_.h"
00026
00027 #define MaxCipherBlocksize 128
00028
00029 typedef enum
00030 {
00031 UndefinedMode,
00032 CBCMode,
00033 CFBMode,
00034 CTRMode,
00035 ECBMode,
00036 OFBMode
00037 } CipherMode;
00038
00039 typedef enum
00040 {
00041 UndefinedCipher,
00042 NoCipher,
00043 AESCipher,
00044 SerpentCipher,
00045 TwofishCipher
00046 } CipherType;
00047
00048 typedef struct _CipherInfo
00049 CipherInfo;
00050
00051 extern WizardExport CipherInfo
00052 *AcquireCipherInfo(const CipherType,const CipherMode),
00053 *DestroyCipherInfo(CipherInfo *);
00054
00055 extern WizardExport const StringInfo
00056 *GetCipherNonce(CipherInfo *);
00057
00058 extern WizardExport StringInfo
00059 *DecipherCipher(CipherInfo *,StringInfo *),
00060 *EncipherCipher(CipherInfo *,StringInfo *),
00061 *GenerateCipherNonce(CipherInfo *);
00062
00063 extern WizardExport size_t
00064 GetCipherBlocksize(const CipherInfo *);
00065
00066 extern WizardExport void
00067 ResetCipherNonce(CipherInfo *),
00068 SetCipherNonce(CipherInfo *,const StringInfo *),
00069 SetCipherKey(CipherInfo *,const StringInfo *);
00070
00071
00072
00073
00074 extern WizardExport StringInfo
00075 *DecryptCipher(CipherInfo *,StringInfo *),
00076 *EncryptCipher(CipherInfo *,StringInfo *);
00077
00078 #if defined(__cplusplus) || defined(c_plusplus)
00079 }
00080 #endif
00081
00082 #endif