monotone

monotone Mtn Source Tree

Root/botan/s2k.h

1/*************************************************
2* S2K Header File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_S2K_H__
7#define BOTAN_S2K_H__
8
9#include <botan/base.h>
10
11namespace Botan {
12
13/*************************************************
14* S2K Interface *
15*************************************************/
16class S2K
17 {
18 public:
19 virtual S2K* clone() const = 0;
20 virtual std::string name() const = 0;
21 virtual void clear() {}
22
23 OctetString derive_key(u32bit, const std::string&) const;
24
25 void set_iterations(u32bit);
26 void change_salt(const byte[], u32bit);
27 void change_salt(const MemoryRegion<byte>&);
28 void new_random_salt(u32bit);
29
30 u32bit iterations() const { return iter; }
31 SecureVector<byte> current_salt() const { return salt; }
32
33 S2K() { iter = 0; }
34 virtual ~S2K() {}
35 private:
36 virtual OctetString derive(u32bit, const std::string&,
37 const byte[], u32bit, u32bit) const = 0;
38 SecureVector<byte> salt;
39 u32bit iter;
40 };
41
42}
43
44#endif

Archive Download this file

Branches

Tags

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