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