-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrmcp.hpp
34 lines (28 loc) · 1.32 KB
/
rmcp.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <array>
#include <cstddef>
#include <cstdint>
namespace rmcp
{
/*
* RSP needs more keying material than can be provided by session
* integrity key alone. As a result all keying material for the RSP
* confidentiality algorithms will be generated by processing a
* pre-defined set of constants using HMAC per [RFC2104], keyed by SIK.
* These constants are constructed using a hexadecimal octet value
* repeated up to the HMAC block size in length starting with the
* constant 01h. This mechanism can be used to derive up to 255
* HMAC-block-length pieces of keying material from a single SIK.For the
* mandatory confidentiality algorithm AES-CBC-128, processing the
* following constant will generate the required amount of keying
* material.
*/
constexpr size_t CONST_N_SIZE = 20;
using Const_n = std::array<uint8_t, CONST_N_SIZE>;
static constexpr Const_n const_1 = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
static constexpr Const_n const_2 = {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
} // namespace rmcp