00001 00032 #ifndef LLCIPHER_H 00033 #define LLCIPHER_H 00034 00035 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00036 // Class LLCipher 00037 // 00038 // Abstract base class for a cipher object. 00039 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00040 00041 class LLCipher 00042 { 00043 public: 00044 virtual ~LLCipher() {} 00045 00046 // encrypt src and place result into dst. returns TRUE if 00047 // Returns number of bytes written into dst, or 0 on error. 00048 virtual U32 encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) = 0; 00049 00050 // decrypt src and place result into dst. 00051 // Returns number of bytes written into dst, or 0 on error. 00052 virtual U32 decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) = 0; 00053 00054 // returns the minimum amount of space required to encrypt for a 00055 // unencrypted source buffer of length len. 00056 // *NOTE: This is estimated space and you should check the return value 00057 // of the encrypt function. 00058 virtual U32 requiredEncryptionSpace(U32 src_len) const = 0 ; 00059 }; 00060 00061 #endif