monotone

monotone Mtn Source Tree

Root/botan/s2k.h

1/*************************************************
2* S2K Header File *
3* (C) 1999-2005 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 : public Algorithm
17 {
18 public:
19 virtual S2K* clone() const = 0;
20
21 OctetString derive_key(u32bit, const std::string&) const;
22
23 void set_iterations(u32bit);
24 void change_salt(const byte[], u32bit);
25 void change_salt(const MemoryRegion<byte>&);
26 void new_random_salt(u32bit);
27
28 u32bit iterations() const { return iter; }
29 SecureVector<byte> current_salt() const { return salt; }
30
31 S2K() { iter = 0; }
32 virtual ~S2K() {}
33 private:
34 virtual OctetString derive(u32bit, const std::string&,
35 const byte[], u32bit, u32bit) const = 0;
36 SecureVector<byte> salt;
37 u32bit iter;
38 };
39
40}
41
42#endif

Archive Download this file

Branches

Tags

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