xref: /aosp_15_r20/external/tink/cc/aead/internal/mock_zero_copy_aead.h (revision e7b1675dde1b92d52ec075b0a92829627f2c52a5)
1 // Copyright 2021 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 ///////////////////////////////////////////////////////////////////////////////
16 #ifndef TINK_AEAD_INTERNAL_MOCK_ZERO_COPY_AEAD_H_
17 #define TINK_AEAD_INTERNAL_MOCK_ZERO_COPY_AEAD_H_
18 
19 #include "gmock/gmock.h"
20 #include "absl/strings/string_view.h"
21 #include "tink/aead/internal/zero_copy_aead.h"
22 #include "tink/util/statusor.h"
23 
24 namespace crypto {
25 namespace tink {
26 namespace internal {
27 
28 class MockZeroCopyAead : public ZeroCopyAead {
29  public:
30   ~MockZeroCopyAead() override = default;
31 
32   MOCK_METHOD(int64_t, MaxEncryptionSize, (int64_t plaintext_size),
33               (const, override));
34 
35   MOCK_METHOD(crypto::tink::util::StatusOr<int64_t>, Encrypt,
36               (absl::string_view plaintext, absl::string_view associated_data,
37                absl::Span<char> buffer),
38               (const, override));
39 
40   MOCK_METHOD(int64_t, MaxDecryptionSize, (int64_t ciphertext_size),
41               (const, override));
42 
43   MOCK_METHOD(crypto::tink::util::StatusOr<int64_t>, Decrypt,
44               (absl::string_view ciphertext, absl::string_view associated_data,
45                absl::Span<char> buffer),
46               (const, override));
47 };
48 
49 }  // namespace internal
50 }  // namespace tink
51 }  // namespace crypto
52 
53 #endif  // TINK_AEAD_INTERNAL_MOCK_ZERO_COPY_AEAD_H_
54