monotone

monotone Mtn Source Tree

Root/botan/pk_util.h

1/*************************************************
2* PK Utility Classes Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_PUBKEY_UTIL_H__
7#define BOTAN_PUBKEY_UTIL_H__
8
9#include <botan/base.h>
10
11namespace Botan {
12
13/*************************************************
14* Encoding Method for Encryption *
15*************************************************/
16class EME
17 {
18 public:
19 virtual u32bit maximum_input_size(u32bit) const = 0;
20 SecureVector<byte> encode(const byte[], u32bit, u32bit) const;
21 SecureVector<byte> encode(const MemoryRegion<byte>&, u32bit) const;
22 SecureVector<byte> decode(const byte[], u32bit, u32bit) const;
23 SecureVector<byte> decode(const MemoryRegion<byte>&, u32bit) const;
24
25 virtual ~EME() {}
26 private:
27 virtual SecureVector<byte> pad(const byte[], u32bit, u32bit) const = 0;
28 virtual SecureVector<byte> unpad(const byte[], u32bit, u32bit) const = 0;
29 };
30
31/*************************************************
32* Encoding Method for Signatures, Appendix *
33*************************************************/
34class EMSA
35 {
36 public:
37 virtual void update(const byte[], u32bit) = 0;
38 virtual SecureVector<byte> raw_data() = 0;
39 virtual SecureVector<byte> encoding_of(const MemoryRegion<byte>&,
40 u32bit) = 0;
41 virtual bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
42 u32bit) throw();
43 virtual ~EMSA() {}
44 };
45
46/*************************************************
47* Key Derivation Function *
48*************************************************/
49class KDF
50 {
51 public:
52 SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&,
53 const std::string& = "") const;
54 SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&,
55 const MemoryRegion<byte>&) const;
56 SecureVector<byte> derive_key(u32bit, const MemoryRegion<byte>&,
57 const byte[], u32bit) const;
58
59 SecureVector<byte> derive_key(u32bit, const byte[], u32bit,
60 const std::string& = "") const;
61 SecureVector<byte> derive_key(u32bit, const byte[], u32bit,
62 const byte[], u32bit) const;
63
64 virtual ~KDF() {}
65 private:
66 virtual SecureVector<byte> derive(u32bit, const byte[], u32bit,
67 const byte[], u32bit) const = 0;
68 };
69
70/*************************************************
71* Mask Generation Function *
72*************************************************/
73class MGF
74 {
75 public:
76 virtual void mask(const byte[], u32bit, byte[], u32bit) const = 0;
77 virtual ~MGF() {}
78 };
79
80}
81
82#endif

Archive Download this file

Branches

Tags

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