Botan: src/pk_pad/emsa1/emsa1.h Source File

Botan 1.10.16

emsa1.h
Go to the documentation of this file.
1 /*
2 * EMSA1
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_EMSA1_H__
9 #define BOTAN_EMSA1_H__
10
11 #include <botan/emsa.h>
12 #include <botan/hash.h>
13
14 namespace Botan {
15
16 /**
17 * EMSA1 from IEEE 1363
18 * Essentially, sign the hash directly
19 */
20 class BOTAN_DLL EMSA1 : public EMSA
21 {
22 public:
23 /**
24 * @param h the hash object to use
25 */
26 EMSA1(HashFunction* h) : hash(h) {}
27 ~EMSA1() { delete hash; }
28 protected:
29 /**
30 * @return const pointer to the underlying hash
31 */
32 const HashFunction* hash_ptr() const { return hash; }
33 private:
34 void update(const byte[], size_t);
35 SecureVector<byte> raw_data();
36
37 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, size_t,
38 RandomNumberGenerator& rng);
39
40 bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
41 size_t);
42
43 HashFunction* hash;
44 };
45
46 }
47
48 #endif
Botan::RandomNumberGenerator
Definition: rng.h:20
Botan::EMSA1::~EMSA1
~EMSA1()
Definition: emsa1.h:27
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::EMSA1::EMSA1
EMSA1(HashFunction *h)
Definition: emsa1.h:26
Botan::EMSA
Definition: emsa.h:19
Botan::MemoryRegion< byte >
Botan
Definition: algo_base.h:14
Botan::EMSA1::hash_ptr
const HashFunction * hash_ptr() const
Definition: emsa1.h:32
Botan::HashFunction
Definition: hash.h:20
Botan::EMSA1
Definition: emsa1.h:20
Botan::SecureVector< byte >