monotone

monotone Mtn Source Tree

Root/hmac.hh

1#ifndef __HMAC_HH__
2#define __HMAC_HH__
3
4#include <string>
5
6#include "botan/botan.h"
7#include "vocab.hh"
8#include "constants.hh"
9#include "string_queue.hh"
10
11struct chained_hmac
12{
13public:
14 chained_hmac(netsync_session_key const & session_key, bool active);
15 void set_key(netsync_session_key const & session_key);
16 std::string process(std::string const & str, size_t pos = 0,
17 size_t n = std::string::npos);
18 std::string process(string_queue const & str, size_t pos = 0,
19 size_t n = std::string::npos);
20
21 size_t const hmac_length;
22 bool is_active() { return active; }
23
24private:
25 bool active;
26 Botan::SymmetricKey key;
27 std::string chain_val;
28};
29
30
31
32
33// Local Variables:
34// mode: C++
35// fill-column: 76
36// c-file-style: "gnu"
37// indent-tabs-mode: nil
38// End:
39// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
40
41#endif // __HMAC_HH__
42

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status