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