Anope IRC Services  Version 2.0
encryption.h
Go to the documentation of this file.
1 /*
2  *
3  * (C) 2003-2014 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 
13 namespace Encryption
14 {
15  typedef std::pair<const unsigned char *, size_t> Hash;
16  typedef std::pair<const uint32_t *, size_t> IV;
17 
18  class Context
19  {
20  public:
21  virtual ~Context() { }
22  virtual void Update(const unsigned char *data, size_t len) = 0;
23  virtual void Finalize() = 0;
24  virtual Hash GetFinalizedHash() = 0;
25  };
26 
27  class Provider : public Service
28  {
29  public:
30  Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
31  virtual ~Provider() { }
32 
33  virtual Context *CreateContext(IV * = NULL) = 0;
34  virtual IV GetDefaultIV() = 0;
35  };
36 }
37 
virtual Hash GetFinalizedHash()=0
virtual void Finalize()=0
virtual ~Context()
Definition: encryption.h:21
virtual IV GetDefaultIV()=0
std::pair< const unsigned char *, size_t > Hash
Definition: encryption.h:15
std::pair< const uint32_t *, size_t > IV
Definition: encryption.h:16
virtual void Update(const unsigned char *data, size_t len)=0
virtual ~Provider()
Definition: encryption.h:31
Provider(Module *creator, const Anope::string &sname)
Definition: encryption.h:30
virtual Context * CreateContext(IV *=NULL)=0