X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/4e95741287ce4385f16eaf9d621cedd4dccbcfe3..d4c4fa8efc14b0b5e9bbca41af0e24e652a28d11:/stglibs/crypto.lib/include/stg/bfstream.h diff --git a/stglibs/crypto.lib/include/stg/bfstream.h b/stglibs/crypto.lib/include/stg/bfstream.h new file mode 100644 index 00000000..41b44330 --- /dev/null +++ b/stglibs/crypto.lib/include/stg/bfstream.h @@ -0,0 +1,42 @@ +#ifndef __STG_STGLIBS_BF_STREAM_H__ +#define __STG_STGLIBS_BF_STREAM_H__ + +#include +#include // size_t + +namespace STG +{ + +class ENCRYPT_STREAM +{ + public: + typedef void (* CALLBACK)(const void * block, size_t size, void * data); + + ENCRYPT_STREAM(const std::string & key, CALLBACK callback, void * data); + ~ENCRYPT_STREAM(); + void Put(const void * data, size_t size, bool last = false); + + private: + class IMPL; + + IMPL * m_impl; +}; + +class DECRYPT_STREAM +{ + public: + typedef void (* CALLBACK)(const void * block, size_t size, void * data); + + DECRYPT_STREAM(const std::string & key, CALLBACK callback, void * data); + ~DECRYPT_STREAM(); + void Put(const void * data, size_t size, bool last = false); + + private: + class IMPL; + + IMPL * m_impl; +}; + +} // namespace STG + +#endif