Software APIs
mock_ownership_key.h
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_OWNERSHIP_MOCK_OWNERSHIP_KEY_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_OWNERSHIP_MOCK_OWNERSHIP_KEY_H_
7 
8 #include "sw/device/lib/base/global_mock.h"
9 #include "sw/device/silicon_creator/lib/ownership/ownership_key.h"
10 #include "sw/device/silicon_creator/testing/rom_test.h"
11 
12 namespace rom_test {
13 namespace internal {
14 
15 /**
16  * Mock class for ownership_key.c.
17  */
18 class MockOwnershipKey : public global_mock::GlobalMock<MockOwnershipKey> {
19  public:
20  MOCK_METHOD(hardened_bool_t, validate,
21  (size_t, ownership_key_t, const owner_signature_t *, const void *,
22  size_t));
23  MOCK_METHOD(rom_error_t, seal_init, ());
24  MOCK_METHOD(rom_error_t, seal_page, (size_t));
25  MOCK_METHOD(rom_error_t, seal_check, (size_t));
26  MOCK_METHOD(rom_error_t, secret_new, ());
27 };
28 
29 } // namespace internal
30 
31 using MockOwnershipKey = testing::StrictMock<internal::MockOwnershipKey>;
32 
33 } // namespace rom_test
34 
35 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_OWNERSHIP_MOCK_OWNERSHIP_KEY_H_