xref: /openbmc/phosphor-net-ipmid/rmcp.hpp (revision 9e801a2b)
19b307be6SVernon Mauery #pragma once
29b307be6SVernon Mauery 
39b307be6SVernon Mauery #include <array>
49b307be6SVernon Mauery #include <cstdint>
59b307be6SVernon Mauery 
69b307be6SVernon Mauery namespace rmcp
79b307be6SVernon Mauery {
89b307be6SVernon Mauery 
99b307be6SVernon Mauery /*
109b307be6SVernon Mauery  * RSP needs more keying material than can be provided by session
119b307be6SVernon Mauery  * integrity key alone. As a result all keying material for the RSP
129b307be6SVernon Mauery  * confidentiality algorithms will be generated by processing a
139b307be6SVernon Mauery  * pre-defined set of constants using HMAC per [RFC2104], keyed by SIK.
149b307be6SVernon Mauery  * These constants are constructed using a hexadecimal octet value
159b307be6SVernon Mauery  * repeated up to the HMAC block size in length starting with the
169b307be6SVernon Mauery  * constant 01h. This mechanism can be used to derive up to 255
179b307be6SVernon Mauery  * HMAC-block-length pieces of keying material from a single SIK.For the
189b307be6SVernon Mauery  * mandatory confidentiality algorithm AES-CBC-128, processing the
199b307be6SVernon Mauery  * following constant will generate the required amount of keying
209b307be6SVernon Mauery  * material.
219b307be6SVernon Mauery  */
229b307be6SVernon Mauery constexpr size_t CONST_N_SIZE = 20;
239b307be6SVernon Mauery using Const_n = std::array<uint8_t, CONST_N_SIZE>;
249b307be6SVernon Mauery 
25*9e801a2bSVernon Mauery static constexpr Const_n const_1 = {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
26*9e801a2bSVernon Mauery                                     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
27*9e801a2bSVernon Mauery                                     0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
289b307be6SVernon Mauery 
29*9e801a2bSVernon Mauery static constexpr Const_n const_2 = {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
30*9e801a2bSVernon Mauery                                     0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
31*9e801a2bSVernon Mauery                                     0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
329b307be6SVernon Mauery 
339b307be6SVernon Mauery } // namespace rmcp
34