1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /*
18  * Generated mock file from original source file
19  *   Functions generated:8
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 extern std::map<std::string, int> mock_function_count_map;
30 
31 // Mock include file to share data between tests and mock
32 #include "test/mock/mock_stack_crypto_toolbox.h"
33 
34 // Mocked compile conditionals, if any
35 #ifndef UNUSED_ATTR
36 #define UNUSED_ATTR
37 #endif
38 
39 // Mocked internal structures, if any
40 
41 namespace test {
42 namespace mock {
43 namespace stack_crypto_toolbox {
44 
45 // Function state capture and return values, if needed
46 struct h6 h6;
47 struct h7 h7;
48 struct f4 f4;
49 struct f5 f5;
50 struct f6 f6;
51 struct g2 g2;
52 struct ltk_to_link_key ltk_to_link_key;
53 struct link_key_to_ltk link_key_to_ltk;
54 
55 }  // namespace stack_crypto_toolbox
56 }  // namespace mock
57 }  // namespace test
58 
59 // Mocked functions, if any
h6(const Octet16 & w,std::array<uint8_t,4> keyid)60 Octet16 h6(const Octet16& w, std::array<uint8_t, 4> keyid) {
61   mock_function_count_map[__func__]++;
62   return test::mock::stack_crypto_toolbox::h6(w, keyid);
63 }
h7(const Octet16 & salt,const Octet16 & w)64 Octet16 h7(const Octet16& salt, const Octet16& w) {
65   mock_function_count_map[__func__]++;
66   return test::mock::stack_crypto_toolbox::h7(salt, w);
67 }
f4(const uint8_t * u,const uint8_t * v,const Octet16 & x,uint8_t z)68 Octet16 f4(const uint8_t* u, const uint8_t* v, const Octet16& x, uint8_t z) {
69   mock_function_count_map[__func__]++;
70   return test::mock::stack_crypto_toolbox::f4(u, v, x, z);
71 }
f5(const uint8_t * w,const Octet16 & n1,const Octet16 & n2,uint8_t * a1,uint8_t * a2,Octet16 * mac_key,Octet16 * ltk)72 void f5(const uint8_t* w, const Octet16& n1, const Octet16& n2, uint8_t* a1,
73         uint8_t* a2, Octet16* mac_key, Octet16* ltk) {
74   mock_function_count_map[__func__]++;
75   test::mock::stack_crypto_toolbox::f5(w, n1, n2, a1, a2, mac_key, ltk);
76 }
f6(const Octet16 & w,const Octet16 & n1,const Octet16 & n2,const Octet16 & r,uint8_t * iocap,uint8_t * a1,uint8_t * a2)77 Octet16 f6(const Octet16& w, const Octet16& n1, const Octet16& n2,
78            const Octet16& r, uint8_t* iocap, uint8_t* a1, uint8_t* a2) {
79   mock_function_count_map[__func__]++;
80   return test::mock::stack_crypto_toolbox::f6(w, n1, n2, r, iocap, a1, a2);
81 }
g2(const uint8_t * u,const uint8_t * v,const Octet16 & x,const Octet16 & y)82 uint32_t g2(const uint8_t* u, const uint8_t* v, const Octet16& x,
83             const Octet16& y) {
84   mock_function_count_map[__func__]++;
85   return test::mock::stack_crypto_toolbox::g2(u, v, x, y);
86 }
ltk_to_link_key(const Octet16 & ltk,bool use_h7)87 Octet16 ltk_to_link_key(const Octet16& ltk, bool use_h7) {
88   mock_function_count_map[__func__]++;
89   return test::mock::stack_crypto_toolbox::ltk_to_link_key(ltk, use_h7);
90 }
link_key_to_ltk(const Octet16 & link_key,bool use_h7)91 Octet16 link_key_to_ltk(const Octet16& link_key, bool use_h7) {
92   mock_function_count_map[__func__]++;
93   return test::mock::stack_crypto_toolbox::link_key_to_ltk(link_key, use_h7);
94 }
95 
96 // END mockcify generation
97