anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

encryption.h (834B)

      1 /*
      2  *
      3  * (C) 2003-2022 Anope Team
      4  * Contact us at team@anope.org
      5  *
      6  * Please read COPYING and README for further details.
      7  *
      8  * Based on the original code of Epona by Lara.
      9  * Based on the original code of Services by Andy Church.
     10  */
     11 
     12 namespace Encryption
     13 {
     14 	typedef std::pair<const unsigned char *, size_t> Hash;
     15 	typedef std::pair<const uint32_t *, size_t> IV;
     16 
     17 	class Context
     18 	{
     19 	 public:
     20 		virtual ~Context() { }
     21 		virtual void Update(const unsigned char *data, size_t len) = 0;
     22 		virtual void Finalize() = 0;
     23 		virtual Hash GetFinalizedHash() = 0;
     24 	};
     25 
     26 	class Provider : public Service
     27 	{
     28 	 public:
     29 		Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
     30 		virtual ~Provider() { }
     31 
     32 		virtual Context *CreateContext(IV * = NULL) = 0;
     33 		virtual IV GetDefaultIV() = 0;
     34 	};
     35 }