Botan 1.10.17

emsa3.h
Go to the documentation of this file.
1 /*
2 * EMSA3 and EMSA3_Raw
3 * (C) 1999-2008 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_EMSA3_H__
9 #define BOTAN_EMSA3_H__
10
11 #include <botan/emsa.h>
12 #include <botan/hash.h>
13
14 namespace Botan {
15
16 /**
17 * EMSA3 from IEEE 1363
18 * aka PKCS #1 v1.5 signature padding
19 * aka PKCS #1 block type 1
20 */
21 class BOTAN_DLL EMSA3 : public EMSA
22 {
23 public:
24 /**
25 * @param hash the hash object to use
26 */
27 EMSA3(HashFunction* hash);
28 ~EMSA3();
29
30 void update(const byte[], size_t);
31
32 SecureVector<byte> raw_data();
33
34 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, size_t,
35 RandomNumberGenerator& rng);
36
37 bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
38 size_t);
39 private:
40 HashFunction* hash;
41 SecureVector<byte> hash_id;
42 };
43
44 /**
45 * EMSA3_Raw which is EMSA3 without a hash or digest id (which
46 * according to QCA docs is "identical to PKCS#11's CKM_RSA_PKCS
47 * mechanism", something I have not confirmed)
48 */
49 class BOTAN_DLL EMSA3_Raw : public EMSA
50 {
51 public:
52 void update(const byte[], size_t);
53
54 SecureVector<byte> raw_data();
55
56 SecureVector<byte> encoding_of(const MemoryRegion<byte>&, size_t,
57 RandomNumberGenerator& rng);
58
59 bool verify(const MemoryRegion<byte>&, const MemoryRegion<byte>&,
60 size_t);
61
62 private:
63 SecureVector<byte> message;
64 };
65
66 }
67
68 #endif
Botan::RandomNumberGenerator
Definition: rng.h:20
Botan::EMSA3
Definition: emsa3.h:21
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::EMSA3_Raw
Definition: emsa3.h:49
Botan::EMSA
Definition: emsa.h:19
Botan::MemoryRegion< byte >
Botan
Definition: algo_base.h:14
Botan::HashFunction
Definition: hash.h:20
Botan::SecureVector< byte >