1 // Copyright (C) 2014-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
2 // This Source Code Form is subject to the terms of the Mozilla Public
3 // License, v. 2.0. If a copy of the MPL was not distributed with this
4 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 
6 #ifndef VSOMEIP_V3_E2E_CRC_HPP
7 #define VSOMEIP_V3_E2E_CRC_HPP
8 
9 #include <cstdint>
10 #include "../buffer/buffer.hpp"
11 
12 namespace vsomeip_v3 {
13 
14 class e2e_crc {
15   public:
16     static uint8_t calculate_profile_01(buffer_view _buffer_view,
17             const uint8_t _start_value = 0x00U);
18     static uint32_t calculate_profile_04(buffer_view _buffer_view,
19             const uint32_t _start_value = 0x00000000U);
20 
21     static uint32_t calculate_profile_custom(buffer_view _buffer_view);
22 
23   private:
24     static const uint8_t  lookup_table_profile_01_[256];
25     static const uint32_t lookup_table_profile_04_[256];
26     static const uint32_t lookup_table_profile_custom_[256];
27 
28 };
29 
30 } // namespace vsomeip_v3
31 
32 #endif // VSOMEIP_V3_E2E_CRC_HPP
33