monotone

monotone Mtn Source Tree

Root/hmac.hh

1#ifndef __HMAC_HH__
2#define __HMAC_HH__
3
4
5#include "botan/botan.h"
6#include "vocab.hh"
7#include "constants.hh"
8#include "string_queue.hh"
9
10struct chained_hmac
11{
12public:
13 chained_hmac(netsync_session_key const & session_key, bool active);
14 void set_key(netsync_session_key const & session_key);
15 std::string process(std::string const & str, size_t pos = 0,
16 size_t n = std::string::npos);
17 std::string process(string_queue const & str, size_t pos = 0,
18 size_t n = std::string::npos);
19
20 size_t const hmac_length;
21 bool is_active() { return active; }
22
23private:
24 bool active;
25 Botan::SymmetricKey key;
26 Botan::Pipe engine;
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