Vernon Mauery | 9b307be | 2017-11-22 09:28:16 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <array> |
Andrew Geissler | 9d9b763 | 2020-05-17 09:18:05 -0500 | [diff] [blame] | 4 | #include <cstddef> |
Vernon Mauery | 9b307be | 2017-11-22 09:28:16 -0800 | [diff] [blame] | 5 | #include <cstdint> |
| 6 | |
| 7 | namespace rmcp |
| 8 | { |
| 9 | |
| 10 | /* |
| 11 | * RSP needs more keying material than can be provided by session |
| 12 | * integrity key alone. As a result all keying material for the RSP |
| 13 | * confidentiality algorithms will be generated by processing a |
| 14 | * pre-defined set of constants using HMAC per [RFC2104], keyed by SIK. |
| 15 | * These constants are constructed using a hexadecimal octet value |
| 16 | * repeated up to the HMAC block size in length starting with the |
| 17 | * constant 01h. This mechanism can be used to derive up to 255 |
| 18 | * HMAC-block-length pieces of keying material from a single SIK.For the |
| 19 | * mandatory confidentiality algorithm AES-CBC-128, processing the |
| 20 | * following constant will generate the required amount of keying |
| 21 | * material. |
| 22 | */ |
| 23 | constexpr size_t CONST_N_SIZE = 20; |
| 24 | using Const_n = std::array<uint8_t, CONST_N_SIZE>; |
| 25 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 26 | static constexpr Const_n const_1 = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
| 27 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, |
| 28 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; |
Vernon Mauery | 9b307be | 2017-11-22 09:28:16 -0800 | [diff] [blame] | 29 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 30 | static constexpr Const_n const_2 = {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, |
| 31 | 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, |
| 32 | 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}; |
Vernon Mauery | 9b307be | 2017-11-22 09:28:16 -0800 | [diff] [blame] | 33 | |
| 34 | } // namespace rmcp |