Coverage Report

Created: 2022-06-23 06:44

/src/botan/build/include/botan/internal/keypair.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
* Keypair Checks
3
* (C) 1999-2010 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_KEYPAIR_CHECKS_H_
9
#define BOTAN_KEYPAIR_CHECKS_H_
10
11
#include <botan/pk_keys.h>
12
13
namespace Botan {
14
15
namespace KeyPair {
16
17
/**
18
* Tests whether the key is consistent for encryption; whether
19
* encrypting and then decrypting gives to the original plaintext.
20
* @param rng the rng to use
21
* @param private_key the key to test
22
* @param public_key the key to test
23
* @param padding the encryption padding method to use
24
* @return true if consistent otherwise false
25
*/
26
bool
27
encryption_consistency_check(RandomNumberGenerator& rng,
28
                             const Private_Key& private_key,
29
                             const Public_Key& public_key,
30
                             const std::string& padding);
31
32
/**
33
* Tests whether the key is consistent for signatures; whether a
34
* signature can be created and then verified
35
* @param rng the rng to use
36
* @param private_key the key to test
37
* @param public_key the key to test
38
* @param padding the signature padding method to use
39
* @return true if consistent otherwise false
40
*/
41
bool
42
signature_consistency_check(RandomNumberGenerator& rng,
43
                            const Private_Key& private_key,
44
                            const Public_Key& public_key,
45
                            const std::string& padding);
46
47
/**
48
* Tests whether the key is consistent for encryption; whether
49
* encrypting and then decrypting gives to the original plaintext.
50
* @param rng the rng to use
51
* @param key the key to test
52
* @param padding the encryption padding method to use
53
* @return true if consistent otherwise false
54
*/
55
inline bool
56
encryption_consistency_check(RandomNumberGenerator& rng,
57
                             const Private_Key& key,
58
                             const std::string& padding)
59
0
   {
60
0
   return encryption_consistency_check(rng, key, key, padding);
61
0
   }
62
63
/**
64
* Tests whether the key is consistent for signatures; whether a
65
* signature can be created and then verified
66
* @param rng the rng to use
67
* @param key the key to test
68
* @param padding the signature padding method to use
69
* @return true if consistent otherwise false
70
*/
71
inline bool
72
signature_consistency_check(RandomNumberGenerator& rng,
73
                            const Private_Key& key,
74
                            const std::string& padding)
75
0
   {
76
0
   return signature_consistency_check(rng, key, key, padding);
77
0
   }
78
79
}
80
81
}
82
83
#endif