00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _WIZARDS_TOOLKIT_CIPHER_H
00019 #define _WIZARDS_TOOLKIT_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 CTRMode
00034 } CipherMode;
00035
00036 typedef enum
00037 {
00038 UndefinedCipher,
00039 NoCipher,
00040 AESCipher,
00041 SerpentCipher,
00042 TwofishCipher
00043 } CipherType;
00044
00045 typedef struct _CipherInfo
00046 CipherInfo;
00047
00048 extern WizardExport CipherInfo
00049 *AcquireCipherInfo(const CipherType,const CipherMode),
00050 *DestroyCipherInfo(CipherInfo *);
00051
00052 extern WizardExport const StringInfo
00053 *GetCipherNonce(CipherInfo *);
00054
00055 extern WizardExport StringInfo
00056 *DecryptCipher(CipherInfo *,StringInfo *),
00057 *EncryptCipher(CipherInfo *,StringInfo *),
00058 *GenerateCipherNonce(CipherInfo *);
00059
00060 extern WizardExport unsigned long
00061 GetCipherBlocksize(const CipherInfo *);
00062
00063 extern WizardExport void
00064 ResetCipherNonce(CipherInfo *),
00065 SetCipherNonce(CipherInfo *,const StringInfo *),
00066 SetCipherKey(CipherInfo *,const StringInfo *);
00067
00068 #if defined(__cplusplus) || defined(c_plusplus)
00069 }
00070 #endif
00071
00072 #endif