Botan  1.10.9
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,
39 
40  bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
41  size_t);
42 
43  HashFunction* hash;
44  };
45 
46 }
47 
48 #endif
~EMSA1()
Definition: emsa1.h:27
const HashFunction * hash_ptr() const
Definition: emsa1.h:32
unsigned char byte
Definition: types.h:22
RandomNumberGenerator * rng
Definition: global_rng.cpp:165
EMSA1(HashFunction *h)
Definition: emsa1.h:26