monotone

monotone Mtn Source Tree

Root/botan/emsa.h

1/*************************************************
2* EMSA Header File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_EMSA_H__
7#define BOTAN_EMSA_H__
8
9#include <botan/pk_util.h>
10
11namespace Botan {
12
13/*************************************************
14* EMSA1 *
15*************************************************/
16class EMSA1 : public EMSA
17 {
18 public:
19 EMSA1(const std::string&);
20 ~EMSA1() { delete hash; }
21 private:
22 void update(const byte[], u32bit);
23 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, u32bit);
24 SecureVector<byte> raw_data();
25 bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
26 u32bit) throw();
27 HashFunction* hash;
28 };
29
30/*************************************************
31* EMSA2 *
32*************************************************/
33class EMSA2 : public EMSA
34 {
35 public:
36 EMSA2(const std::string&);
37 ~EMSA2() { delete hash; }
38 private:
39 void update(const byte[], u32bit);
40 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, u32bit);
41 SecureVector<byte> raw_data();
42 SecureVector<byte> empty_hash;
43 HashFunction* hash;
44 byte hash_id;
45 };
46
47/*************************************************
48* EMSA3 *
49*************************************************/
50class EMSA3 : public EMSA
51 {
52 public:
53 EMSA3(const std::string&);
54 ~EMSA3() { delete hash; }
55 private:
56 void update(const byte[], u32bit);
57 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, u32bit);
58 SecureVector<byte> raw_data();
59 HashFunction* hash;
60 SecureVector<byte> hash_id;
61 };
62
63/*************************************************
64* EMSA4 *
65*************************************************/
66class EMSA4 : public EMSA
67 {
68 public:
69 EMSA4(const std::string&, const std::string&);
70 EMSA4(const std::string&, const std::string&, u32bit);
71 ~EMSA4() { delete hash; delete mgf; }
72 private:
73 void update(const byte[], u32bit);
74 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, u32bit);
75 SecureVector<byte> raw_data();
76 bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
77 u32bit) throw();
78 const u32bit SALT_SIZE;
79 HashFunction* hash;
80 const MGF* mgf;
81 };
82
83/*************************************************
84* EMSA-Raw *
85*************************************************/
86class EMSA_Raw : public EMSA
87 {
88 private:
89 void update(const byte[], u32bit);
90 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, u32bit);
91 SecureVector<byte> raw_data();
92 SecureVector<byte> message;
93 };
94
95}
96
97#endif

Archive Download this file

Branches

Tags

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