1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Generated mock file from original source file
* Functions generated:8
*
* mockcify.pl ver 0.2
*/
#include <cstdint>
#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
// include files may not be required. The include-what-you-use
// still applies, but crafting proper inclusion is out of scope
// for this effort. This compilation unit may compile as-is, or
// may need attention to prune the inclusion set.
#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <algorithm>
#include "stack/crypto_toolbox/aes.h"
#include "stack/crypto_toolbox/crypto_toolbox.h"
// Mocked compile conditionals, if any
#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif
namespace test {
namespace mock {
namespace stack_crypto_toolbox {
// Shared state between mocked functions and tests
// Name: h6
// Params: const Octet16& w, std::array<uint8_t, 4> keyid
// Returns: Octet16
struct h6 {
Octet16 octet16;
std::function<Octet16(const Octet16& w, std::array<uint8_t, 4> keyid)> body{
[this](const Octet16& w, std::array<uint8_t, 4> keyid) {
return octet16;
}};
Octet16 operator()(const Octet16& w, std::array<uint8_t, 4> keyid) {
return body(w, keyid);
};
};
extern struct h6 h6;
// Name: h7
// Params: const Octet16& salt, const Octet16& w
// Returns: Octet16
struct h7 {
Octet16 octet16;
std::function<Octet16(const Octet16& salt, const Octet16& w)> body{
[this](const Octet16& salt, const Octet16& w) { return octet16; }};
Octet16 operator()(const Octet16& salt, const Octet16& w) {
return body(salt, w);
};
};
extern struct h7 h7;
// Name: f4
// Params: const uint8_t* u, const uint8_t* v, const Octet16& x, uint8_t z
// Returns: Octet16
struct f4 {
Octet16 octet16;
std::function<Octet16(const uint8_t* u, const uint8_t* v, const Octet16& x,
uint8_t z)>
body{[this](const uint8_t* u, const uint8_t* v, const Octet16& x,
uint8_t z) { return octet16; }};
Octet16 operator()(const uint8_t* u, const uint8_t* v, const Octet16& x,
uint8_t z) {
return body(u, v, x, z);
};
};
extern struct f4 f4;
// Name: f5
// Params: const uint8_t* w, const Octet16& n1, const Octet16& n2, uint8_t* a1,
// uint8_t* a2, Octet16* mac_key, Octet16* ltk Returns: void
struct f5 {
std::function<void(const uint8_t* w, const Octet16& n1, const Octet16& n2,
uint8_t* a1, uint8_t* a2, Octet16* mac_key, Octet16* ltk)>
body{[](const uint8_t* w, const Octet16& n1, const Octet16& n2,
uint8_t* a1, uint8_t* a2, Octet16* mac_key, Octet16* ltk) {}};
void operator()(const uint8_t* w, const Octet16& n1, const Octet16& n2,
uint8_t* a1, uint8_t* a2, Octet16* mac_key, Octet16* ltk) {
body(w, n1, n2, a1, a2, mac_key, ltk);
};
};
extern struct f5 f5;
// Name: f6
// Params: const Octet16& w, const Octet16& n1, const Octet16& n2, const
// Octet16& r, uint8_t* iocap, uint8_t* a1, uint8_t* a2 Returns: Octet16
struct f6 {
Octet16 octet16;
std::function<Octet16(const Octet16& w, const Octet16& n1, const Octet16& n2,
const Octet16& r, uint8_t* iocap, uint8_t* a1,
uint8_t* a2)>
body{[this](const Octet16& w, const Octet16& n1, const Octet16& n2,
const Octet16& r, uint8_t* iocap, uint8_t* a1,
uint8_t* a2) { return octet16; }};
Octet16 operator()(const Octet16& w, const Octet16& n1, const Octet16& n2,
const Octet16& r, uint8_t* iocap, uint8_t* a1,
uint8_t* a2) {
return body(w, n1, n2, r, iocap, a1, a2);
};
};
extern struct f6 f6;
// Name: g2
// Params: const uint8_t* u, const uint8_t* v, const Octet16& x, const Octet16&
// y Returns: uint32_t
struct g2 {
std::function<uint32_t(const uint8_t* u, const uint8_t* v, const Octet16& x,
const Octet16& y)>
body{[](const uint8_t* u, const uint8_t* v, const Octet16& x,
const Octet16& y) { return 0; }};
uint32_t operator()(const uint8_t* u, const uint8_t* v, const Octet16& x,
const Octet16& y) {
return body(u, v, x, y);
};
};
extern struct g2 g2;
// Name: ltk_to_link_key
// Params: const Octet16& ltk, bool use_h7
// Returns: Octet16
struct ltk_to_link_key {
Octet16 octet16;
std::function<Octet16(const Octet16& ltk, bool use_h7)> body{
[this](const Octet16& ltk, bool use_h7) { return octet16; }};
Octet16 operator()(const Octet16& ltk, bool use_h7) {
return body(ltk, use_h7);
};
};
extern struct ltk_to_link_key ltk_to_link_key;
// Name: link_key_to_ltk
// Params: const Octet16& link_key, bool use_h7
// Returns: Octet16
struct link_key_to_ltk {
Octet16 octet16;
std::function<Octet16(const Octet16& link_key, bool use_h7)> body{
[this](const Octet16& link_key, bool use_h7) { return octet16; }};
Octet16 operator()(const Octet16& link_key, bool use_h7) {
return body(link_key, use_h7);
};
};
extern struct link_key_to_ltk link_key_to_ltk;
} // namespace stack_crypto_toolbox
} // namespace mock
} // namespace test
// END mockcify generation
|