Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / crypto / tests / SPAKE2P_RFC_test_vectors.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17
18 /**
19  * @file - This file contains Spake2+ RFC test vectors.
20  */
21
22 #ifndef _SPAKE2P_POINT_RFC_TEST_VECTORS_H_
23 #define _SPAKE2P_POINT_RFC_TEST_VECTORS_H_
24
25 namespace chip {
26 namespace Crypto {
27
28 struct spake2p_rfc_tv
29 {
30     const uint8_t * context;
31     size_t context_len;
32     const uint8_t * prover_identity;
33     size_t prover_identity_len;
34     const uint8_t * verifier_identity;
35     size_t verifier_identity_len;
36     const uint8_t * w0;
37     size_t w0_len;
38     const uint8_t * w1;
39     size_t w1_len;
40     const uint8_t * L;
41     size_t L_len;
42     const uint8_t * x;
43     size_t x_len;
44     const uint8_t * X;
45     size_t X_len;
46     const uint8_t * y;
47     size_t y_len;
48     const uint8_t * Y;
49     size_t Y_len;
50     const uint8_t * Z;
51     size_t Z_len;
52     const uint8_t * V;
53     size_t V_len;
54     const uint8_t * Ka;
55     size_t Ka_len;
56     const uint8_t * Ke;
57     size_t Ke_len;
58     const uint8_t * KcA;
59     size_t KcA_len;
60     const uint8_t * KcB;
61     size_t KcB_len;
62     const uint8_t * MAC_KcA;
63     size_t MAC_KcA_len;
64     const uint8_t * MAC_KcB;
65     size_t MAC_KcB_len;
66 };
67
68 static const uint8_t chiptest_e4836c3b50dd_w0_1[]  = { 0xe6, 0x88, 0x7c, 0xf9, 0xbd, 0xfb, 0x75, 0x79, 0xc6, 0x9b, 0xf4,
69                                                       0x79, 0x28, 0xa8, 0x45, 0x14, 0xb5, 0xe3, 0x55, 0xac, 0x03, 0x48,
70                                                       0x63, 0xf7, 0xff, 0xaf, 0x43, 0x90, 0xe6, 0x7d, 0x79, 0x8c };
71 static const uint8_t chiptest_e4836c3b50dd_w1_2[]  = { 0x24, 0xb5, 0xae, 0x4a, 0xbd, 0xa8, 0x68, 0xec, 0x93, 0x36, 0xff,
72                                                       0xc3, 0xb7, 0x8e, 0xe3, 0x1c, 0x57, 0x55, 0xbe, 0xf1, 0x75, 0x92,
73                                                       0x27, 0xef, 0x53, 0x72, 0xca, 0x13, 0x9b, 0x94, 0xe5, 0x12 };
74 static const uint8_t chiptest_e4836c3b50dd_L_3[]   = { 0x04, 0x95, 0x64, 0x5c, 0xfb, 0x74, 0xdf, 0x6e, 0x58, 0xf9, 0x74, 0x8b, 0xb8,
75                                                      0x3a, 0x86, 0x62, 0x0b, 0xab, 0x7c, 0x82, 0xe1, 0x07, 0xf5, 0x7d, 0x68, 0x70,
76                                                      0xda, 0x8c, 0xbc, 0xb2, 0xff, 0x9f, 0x70, 0x63, 0xa1, 0x4b, 0x64, 0x02, 0xc6,
77                                                      0x2f, 0x99, 0xaf, 0xcb, 0x97, 0x06, 0xa4, 0xd1, 0xa1, 0x43, 0x27, 0x32, 0x59,
78                                                      0xfe, 0x76, 0xf1, 0xc6, 0x05, 0xa3, 0x63, 0x97, 0x45, 0xa9, 0x21, 0x54, 0xb9 };
79 static const uint8_t chiptest_e4836c3b50dd_x_4[]   = { 0x8b, 0x0f, 0x3f, 0x38, 0x39, 0x05, 0xcf, 0x3a, 0x3b, 0xb9, 0x55,
80                                                      0xef, 0x8f, 0xb6, 0x2e, 0x24, 0x84, 0x9d, 0xd3, 0x49, 0xa0, 0x5c,
81                                                      0xa7, 0x9a, 0xaf, 0xb1, 0x80, 0x41, 0xd3, 0x0c, 0xbd, 0xb6 };
82 static const uint8_t chiptest_e4836c3b50dd_X_5[]   = { 0x04, 0xaf, 0x09, 0x98, 0x7a, 0x59, 0x3d, 0x3b, 0xac, 0x86, 0x94, 0xb1, 0x23,
83                                                      0x83, 0x94, 0x22, 0xc3, 0xcc, 0x87, 0xe3, 0x7d, 0x6b, 0x41, 0xc1, 0xd6, 0x30,
84                                                      0xf0, 0x00, 0xdd, 0x64, 0x98, 0x0e, 0x53, 0x7a, 0xe7, 0x04, 0xbc, 0xed, 0xe0,
85                                                      0x4e, 0xa3, 0xbe, 0xc9, 0xb7, 0x47, 0x5b, 0x32, 0xfa, 0x2c, 0xa3, 0xb6, 0x84,
86                                                      0xbe, 0x14, 0xd1, 0x16, 0x45, 0xe3, 0x8e, 0xa6, 0x60, 0x9e, 0xb3, 0x9e, 0x7e };
87 static const uint8_t chiptest_e4836c3b50dd_y_6[]   = { 0x2e, 0x08, 0x95, 0xb0, 0xe7, 0x63, 0xd6, 0xd5, 0xa9, 0x56, 0x44,
88                                                      0x33, 0xe6, 0x4a, 0xc3, 0xca, 0xc7, 0x4f, 0xf8, 0x97, 0xf6, 0xc3,
89                                                      0x44, 0x52, 0x47, 0xba, 0x1b, 0xab, 0x40, 0x08, 0x2a, 0x91 };
90 static const uint8_t chiptest_e4836c3b50dd_Y_7[]   = { 0x04, 0x41, 0x75, 0x92, 0x62, 0x0a, 0xeb, 0xf9, 0xfd, 0x20, 0x36, 0x16, 0xbb,
91                                                      0xb9, 0xf1, 0x21, 0xb7, 0x30, 0xc2, 0x58, 0xb2, 0x86, 0xf8, 0x90, 0xc5, 0xf1,
92                                                      0x9f, 0xea, 0x83, 0x3a, 0x9c, 0x90, 0x0c, 0xbe, 0x90, 0x57, 0xbc, 0x54, 0x9a,
93                                                      0x3e, 0x19, 0x97, 0x5b, 0xe9, 0x92, 0x7f, 0x0e, 0x76, 0x14, 0xf0, 0x8d, 0x1f,
94                                                      0x0a, 0x10, 0x8e, 0xed, 0xe5, 0xfd, 0x7e, 0xb5, 0x62, 0x45, 0x84, 0xa4, 0xf4 };
95 static const uint8_t chiptest_e4836c3b50dd_Z_8[]   = { 0x04, 0x71, 0xa3, 0x52, 0x82, 0xd2, 0x02, 0x6f, 0x36, 0xbf, 0x3c, 0xeb, 0x38,
96                                                      0xfc, 0xf8, 0x7e, 0x31, 0x12, 0xa4, 0x45, 0x2f, 0x46, 0xe9, 0xf7, 0xb4, 0x7f,
97                                                      0xd7, 0x69, 0xcf, 0xb5, 0x70, 0x14, 0x5b, 0x62, 0x58, 0x9c, 0x76, 0xb7, 0xaa,
98                                                      0x1e, 0xb6, 0x08, 0x0a, 0x83, 0x2e, 0x53, 0x32, 0xc3, 0x68, 0x98, 0x42, 0x69,
99                                                      0x12, 0xe2, 0x9c, 0x40, 0xef, 0x9e, 0x9c, 0x74, 0x2e, 0xee, 0x82, 0xbf, 0x30 };
100 static const uint8_t chiptest_e4836c3b50dd_V_9[]   = { 0x04, 0x67, 0x18, 0x98, 0x1b, 0xf1, 0x5b, 0xc4, 0xdb, 0x53, 0x8f, 0xc1, 0xf1,
101                                                      0xc1, 0xd0, 0x58, 0xcb, 0x0e, 0xec, 0xec, 0xf1, 0xdb, 0xe1, 0xb1, 0xea, 0x08,
102                                                      0xa4, 0xe2, 0x52, 0x75, 0xd3, 0x82, 0xe8, 0x2b, 0x34, 0x8c, 0x81, 0x31, 0xd8,
103                                                      0xed, 0x66, 0x9d, 0x16, 0x9c, 0x2e, 0x03, 0xa8, 0x58, 0xdb, 0x7c, 0xf6, 0xca,
104                                                      0x28, 0x53, 0xa4, 0x07, 0x12, 0x51, 0xa3, 0x9f, 0xbe, 0x8c, 0xfc, 0x39, 0xbc };
105 static const uint8_t chiptest_e4836c3b50dd_Ka_10[] = { 0xf9, 0xca, 0xb9, 0xad, 0xcc, 0x0e, 0xd8, 0xe5,
106                                                        0xa4, 0xdb, 0x11, 0xa8, 0x50, 0x59, 0x14, 0xb2 };
107 static const uint8_t chiptest_e4836c3b50dd_Ke_11[] = { 0x80, 0x1d, 0xb2, 0x97, 0x65, 0x48, 0x16, 0xeb,
108                                                        0x4f, 0x02, 0x86, 0x81, 0x29, 0xb9, 0xdc, 0x89 };
109 static const uint8_t chiptest_e4836c3b50dd_KcA_12[]     = { 0x0d, 0x24, 0x8d, 0x7d, 0x19, 0x23, 0x4f, 0x14,
110                                                         0x86, 0xb2, 0xef, 0xba, 0x51, 0x79, 0xc5, 0x2d };
111 static const uint8_t chiptest_e4836c3b50dd_KcB_13[]     = { 0x55, 0x62, 0x91, 0xdf, 0x26, 0xd7, 0x05, 0xa2,
112                                                         0xca, 0xed, 0xd6, 0x47, 0x4d, 0xd0, 0x07, 0x9b };
113 static const uint8_t chiptest_e4836c3b50dd_MAC_KcA_14[] = { 0xd4, 0x37, 0x6f, 0x2d, 0xa9, 0xc7, 0x22, 0x26, 0xdd, 0x15, 0x1b,
114                                                             0x77, 0xc2, 0x91, 0x90, 0x71, 0x15, 0x5f, 0xc2, 0x2a, 0x20, 0x68,
115                                                             0xd9, 0x0b, 0x5f, 0xaa, 0x6c, 0x78, 0xc1, 0x1e, 0x77, 0xdd };
116 static const uint8_t chiptest_e4836c3b50dd_MAC_KcB_15[] = { 0x06, 0x60, 0xa6, 0x80, 0x66, 0x3e, 0x8c, 0x56, 0x95, 0x95, 0x6f,
117                                                             0xb2, 0x2d, 0xff, 0x29, 0x8b, 0x1d, 0x07, 0xa5, 0x26, 0xcf, 0x3c,
118                                                             0xc5, 0x91, 0xad, 0xfe, 0xcd, 0x1f, 0x6e, 0xf6, 0xe0, 0x2e };
119 static const struct spake2p_rfc_tv chiptest_e4836c3b50dd_test_vector_16 = {
120     .context               = reinterpret_cast<const uint8_t *>("SPAKE2+-P256-SHA256-HKDF draft-01"),
121     .context_len           = 33,
122     .prover_identity       = reinterpret_cast<const uint8_t *>("client"),
123     .prover_identity_len   = 6,
124     .verifier_identity     = reinterpret_cast<const uint8_t *>("server"),
125     .verifier_identity_len = 6,
126     .w0                    = chiptest_e4836c3b50dd_w0_1,
127     .w0_len                = 32,
128     .w1                    = chiptest_e4836c3b50dd_w1_2,
129     .w1_len                = 32,
130     .L                     = chiptest_e4836c3b50dd_L_3,
131     .L_len                 = 65,
132     .x                     = chiptest_e4836c3b50dd_x_4,
133     .x_len                 = 32,
134     .X                     = chiptest_e4836c3b50dd_X_5,
135     .X_len                 = 65,
136     .y                     = chiptest_e4836c3b50dd_y_6,
137     .y_len                 = 32,
138     .Y                     = chiptest_e4836c3b50dd_Y_7,
139     .Y_len                 = 65,
140     .Z                     = chiptest_e4836c3b50dd_Z_8,
141     .Z_len                 = 65,
142     .V                     = chiptest_e4836c3b50dd_V_9,
143     .V_len                 = 65,
144     .Ka                    = chiptest_e4836c3b50dd_Ka_10,
145     .Ka_len                = 16,
146     .Ke                    = chiptest_e4836c3b50dd_Ke_11,
147     .Ke_len                = 16,
148     .KcA                   = chiptest_e4836c3b50dd_KcA_12,
149     .KcA_len               = 16,
150     .KcB                   = chiptest_e4836c3b50dd_KcB_13,
151     .KcB_len               = 16,
152     .MAC_KcA               = chiptest_e4836c3b50dd_MAC_KcA_14,
153     .MAC_KcA_len           = 32,
154     .MAC_KcB               = chiptest_e4836c3b50dd_MAC_KcB_15,
155     .MAC_KcB_len           = 32
156 };
157 static const uint8_t chiptest_e4836c3b50dd_w0_17[] = { 0xe6, 0x88, 0x7c, 0xf9, 0xbd, 0xfb, 0x75, 0x79, 0xc6, 0x9b, 0xf4,
158                                                        0x79, 0x28, 0xa8, 0x45, 0x14, 0xb5, 0xe3, 0x55, 0xac, 0x03, 0x48,
159                                                        0x63, 0xf7, 0xff, 0xaf, 0x43, 0x90, 0xe6, 0x7d, 0x79, 0x8c };
160 static const uint8_t chiptest_e4836c3b50dd_w1_18[] = { 0x24, 0xb5, 0xae, 0x4a, 0xbd, 0xa8, 0x68, 0xec, 0x93, 0x36, 0xff,
161                                                        0xc3, 0xb7, 0x8e, 0xe3, 0x1c, 0x57, 0x55, 0xbe, 0xf1, 0x75, 0x92,
162                                                        0x27, 0xef, 0x53, 0x72, 0xca, 0x13, 0x9b, 0x94, 0xe5, 0x12 };
163 static const uint8_t chiptest_e4836c3b50dd_L_19[]  = {
164     0x04, 0x95, 0x64, 0x5c, 0xfb, 0x74, 0xdf, 0x6e, 0x58, 0xf9, 0x74, 0x8b, 0xb8, 0x3a, 0x86, 0x62, 0x0b,
165     0xab, 0x7c, 0x82, 0xe1, 0x07, 0xf5, 0x7d, 0x68, 0x70, 0xda, 0x8c, 0xbc, 0xb2, 0xff, 0x9f, 0x70, 0x63,
166     0xa1, 0x4b, 0x64, 0x02, 0xc6, 0x2f, 0x99, 0xaf, 0xcb, 0x97, 0x06, 0xa4, 0xd1, 0xa1, 0x43, 0x27, 0x32,
167     0x59, 0xfe, 0x76, 0xf1, 0xc6, 0x05, 0xa3, 0x63, 0x97, 0x45, 0xa9, 0x21, 0x54, 0xb9
168 };
169 static const uint8_t chiptest_e4836c3b50dd_x_20[] = { 0xec, 0x82, 0xd9, 0x25, 0x83, 0x37, 0xf6, 0x12, 0x39, 0xc9, 0xcd,
170                                                       0x68, 0xe8, 0xe5, 0x32, 0xa3, 0xa6, 0xb8, 0x3d, 0x12, 0xd2, 0xb1,
171                                                       0xca, 0x5d, 0x54, 0x3f, 0x44, 0xde, 0xf1, 0x7d, 0xfb, 0x8d };
172 static const uint8_t chiptest_e4836c3b50dd_X_21[] = {
173     0x04, 0x23, 0x07, 0x79, 0x96, 0x08, 0x24, 0x07, 0x6d, 0x36, 0x66, 0xa7, 0x41, 0x8e, 0x4d, 0x43, 0x3e,
174     0x2f, 0xa1, 0x5b, 0x06, 0x17, 0x6e, 0xab, 0xdd, 0x57, 0x2f, 0x43, 0xa3, 0x2e, 0xcc, 0x79, 0xa1, 0x92,
175     0xb2, 0x43, 0xd2, 0x62, 0x43, 0x10, 0xa7, 0x35, 0x62, 0x73, 0xb8, 0x6e, 0x5f, 0xd9, 0xbd, 0x62, 0x7d,
176     0x3a, 0xde, 0x76, 0x2b, 0xae, 0xff, 0x1a, 0x32, 0x0d, 0x4a, 0xd7, 0xa4, 0xe4, 0x7f
177 };
178 static const uint8_t chiptest_e4836c3b50dd_y_22[] = { 0xea, 0xc3, 0xf7, 0xde, 0x4b, 0x19, 0x8d, 0x5f, 0xe2, 0x5c, 0x44,
179                                                       0x3c, 0x0c, 0xd4, 0x96, 0x38, 0x07, 0xad, 0xd7, 0x67, 0x81, 0x5d,
180                                                       0xd0, 0x2a, 0x6f, 0x01, 0x33, 0xb4, 0xbc, 0x2c, 0x9e, 0xb0 };
181 static const uint8_t chiptest_e4836c3b50dd_Y_23[] = {
182     0x04, 0x45, 0x58, 0x64, 0x2e, 0x71, 0xb6, 0x16, 0xb2, 0x48, 0xc9, 0x58, 0x3b, 0xd6, 0xd7, 0xaa, 0x1b,
183     0x39, 0x52, 0xc6, 0xdf, 0x6a, 0x9f, 0x74, 0x92, 0xa0, 0x60, 0x35, 0xca, 0x5d, 0x92, 0x52, 0x2d, 0x84,
184     0x44, 0x3d, 0xe7, 0xaa, 0x20, 0xa5, 0x93, 0x80, 0xfa, 0x4d, 0xe6, 0xb7, 0x43, 0x8d, 0x92, 0x5d, 0xbf,
185     0xb7, 0xf1, 0xcf, 0xe6, 0x0d, 0x79, 0xac, 0xf9, 0x61, 0xee, 0x33, 0x98, 0x8c, 0x7d
186 };
187 static const uint8_t chiptest_e4836c3b50dd_Z_24[] = {
188     0x04, 0xb4, 0xe8, 0x77, 0x0f, 0x19, 0xf5, 0x8d, 0xdf, 0x83, 0xf9, 0x22, 0x0c, 0x3a, 0x93, 0x05, 0x79,
189     0x26, 0x65, 0xe0, 0xc6, 0x09, 0x89, 0xe6, 0xee, 0x9d, 0x7f, 0xa4, 0x49, 0xc7, 0x75, 0xd6, 0x39, 0x5f,
190     0x6f, 0x25, 0xf3, 0x07, 0xe3, 0x90, 0x3a, 0xc0, 0x45, 0xa0, 0x13, 0xfb, 0xb5, 0xa6, 0x76, 0xe8, 0x72,
191     0xa6, 0xab, 0xfc, 0xf4, 0xd7, 0xbb, 0x5a, 0xac, 0x69, 0xef, 0xd6, 0x14, 0x0e, 0xed
192 };
193 static const uint8_t chiptest_e4836c3b50dd_V_25[] = {
194     0x04, 0x14, 0x1d, 0xb8, 0x3b, 0xc7, 0xd9, 0x6f, 0x41, 0xb6, 0x36, 0x62, 0x2e, 0x7a, 0x5c, 0x55, 0x2a,
195     0xd8, 0x32, 0x11, 0xff, 0x55, 0x31, 0x9a, 0xc2, 0x5e, 0xd0, 0xa0, 0x9f, 0x08, 0x18, 0xbd, 0x94, 0x2e,
196     0x81, 0x50, 0x31, 0x9b, 0xfb, 0xfa, 0x68, 0x61, 0x83, 0x80, 0x6d, 0xc6, 0x19, 0x11, 0x18, 0x3f, 0x6a,
197     0x0f, 0x59, 0x56, 0x15, 0x60, 0x23, 0xd9, 0x6e, 0x0f, 0x93, 0xd2, 0x75, 0xbf, 0x50
198 };
199 static const uint8_t chiptest_e4836c3b50dd_Ka_26[]      = { 0xe2, 0xcb, 0xee, 0x3a, 0xe1, 0x9a, 0x4d, 0xbe,
200                                                        0x9f, 0x14, 0x6b, 0xe6, 0xbe, 0xe9, 0xbf, 0xa1 };
201 static const uint8_t chiptest_e4836c3b50dd_Ke_27[]      = { 0x69, 0x89, 0xd8, 0xf9, 0x17, 0x7e, 0xf7, 0xdf,
202                                                        0x67, 0xda, 0x43, 0x79, 0x87, 0xf0, 0x72, 0x55 };
203 static const uint8_t chiptest_e4836c3b50dd_KcA_28[]     = { 0x2f, 0x9e, 0x0b, 0xb6, 0x69, 0xd2, 0xc2, 0x26,
204                                                         0x45, 0xbc, 0xe3, 0x4d, 0xa0, 0x4a, 0xc1, 0x6a };
205 static const uint8_t chiptest_e4836c3b50dd_KcB_29[]     = { 0xeb, 0x7a, 0x35, 0x16, 0x87, 0x59, 0xdd, 0x8e,
206                                                         0x9c, 0xe4, 0x4e, 0x4d, 0xc5, 0x12, 0x77, 0xce };
207 static const uint8_t chiptest_e4836c3b50dd_MAC_KcA_30[] = { 0xe1, 0xb9, 0x25, 0x88, 0x07, 0xba, 0x47, 0x50, 0xda, 0xe1, 0xd7,
208                                                             0xf3, 0xc3, 0xc2, 0x94, 0xf1, 0x3d, 0xc4, 0xfa, 0x60, 0xcd, 0xe3,
209                                                             0x46, 0xd5, 0xde, 0x7d, 0x20, 0x0e, 0x2f, 0x8f, 0xd3, 0xfc };
210 static const uint8_t chiptest_e4836c3b50dd_MAC_KcB_31[] = { 0xb9, 0xc3, 0x9d, 0xfa, 0x49, 0xc4, 0x77, 0x57, 0xde, 0x77, 0x8d,
211                                                             0x9b, 0xed, 0xea, 0xca, 0x24, 0x48, 0xb9, 0x05, 0xbe, 0x19, 0xa4,
212                                                             0x3b, 0x94, 0xee, 0x24, 0xb7, 0x70, 0x20, 0x81, 0x35, 0xe3 };
213 static const struct spake2p_rfc_tv chiptest_e4836c3b50dd_test_vector_32 = {
214     .context               = reinterpret_cast<const uint8_t *>("SPAKE2+-P256-SHA256-HKDF draft-01"),
215     .context_len           = 33,
216     .prover_identity       = reinterpret_cast<const uint8_t *>("client"),
217     .prover_identity_len   = 6,
218     .verifier_identity     = reinterpret_cast<const uint8_t *>(""),
219     .verifier_identity_len = 0,
220     .w0                    = chiptest_e4836c3b50dd_w0_17,
221     .w0_len                = 32,
222     .w1                    = chiptest_e4836c3b50dd_w1_18,
223     .w1_len                = 32,
224     .L                     = chiptest_e4836c3b50dd_L_19,
225     .L_len                 = 65,
226     .x                     = chiptest_e4836c3b50dd_x_20,
227     .x_len                 = 32,
228     .X                     = chiptest_e4836c3b50dd_X_21,
229     .X_len                 = 65,
230     .y                     = chiptest_e4836c3b50dd_y_22,
231     .y_len                 = 32,
232     .Y                     = chiptest_e4836c3b50dd_Y_23,
233     .Y_len                 = 65,
234     .Z                     = chiptest_e4836c3b50dd_Z_24,
235     .Z_len                 = 65,
236     .V                     = chiptest_e4836c3b50dd_V_25,
237     .V_len                 = 65,
238     .Ka                    = chiptest_e4836c3b50dd_Ka_26,
239     .Ka_len                = 16,
240     .Ke                    = chiptest_e4836c3b50dd_Ke_27,
241     .Ke_len                = 16,
242     .KcA                   = chiptest_e4836c3b50dd_KcA_28,
243     .KcA_len               = 16,
244     .KcB                   = chiptest_e4836c3b50dd_KcB_29,
245     .KcB_len               = 16,
246     .MAC_KcA               = chiptest_e4836c3b50dd_MAC_KcA_30,
247     .MAC_KcA_len           = 32,
248     .MAC_KcB               = chiptest_e4836c3b50dd_MAC_KcB_31,
249     .MAC_KcB_len           = 32
250 };
251 static const uint8_t chiptest_e4836c3b50dd_w0_33[] = { 0xe6, 0x88, 0x7c, 0xf9, 0xbd, 0xfb, 0x75, 0x79, 0xc6, 0x9b, 0xf4,
252                                                        0x79, 0x28, 0xa8, 0x45, 0x14, 0xb5, 0xe3, 0x55, 0xac, 0x03, 0x48,
253                                                        0x63, 0xf7, 0xff, 0xaf, 0x43, 0x90, 0xe6, 0x7d, 0x79, 0x8c };
254 static const uint8_t chiptest_e4836c3b50dd_w1_34[] = { 0x24, 0xb5, 0xae, 0x4a, 0xbd, 0xa8, 0x68, 0xec, 0x93, 0x36, 0xff,
255                                                        0xc3, 0xb7, 0x8e, 0xe3, 0x1c, 0x57, 0x55, 0xbe, 0xf1, 0x75, 0x92,
256                                                        0x27, 0xef, 0x53, 0x72, 0xca, 0x13, 0x9b, 0x94, 0xe5, 0x12 };
257 static const uint8_t chiptest_e4836c3b50dd_L_35[]  = {
258     0x04, 0x95, 0x64, 0x5c, 0xfb, 0x74, 0xdf, 0x6e, 0x58, 0xf9, 0x74, 0x8b, 0xb8, 0x3a, 0x86, 0x62, 0x0b,
259     0xab, 0x7c, 0x82, 0xe1, 0x07, 0xf5, 0x7d, 0x68, 0x70, 0xda, 0x8c, 0xbc, 0xb2, 0xff, 0x9f, 0x70, 0x63,
260     0xa1, 0x4b, 0x64, 0x02, 0xc6, 0x2f, 0x99, 0xaf, 0xcb, 0x97, 0x06, 0xa4, 0xd1, 0xa1, 0x43, 0x27, 0x32,
261     0x59, 0xfe, 0x76, 0xf1, 0xc6, 0x05, 0xa3, 0x63, 0x97, 0x45, 0xa9, 0x21, 0x54, 0xb9
262 };
263 static const uint8_t chiptest_e4836c3b50dd_x_36[] = { 0xba, 0x0f, 0x0f, 0x5b, 0x78, 0xef, 0x23, 0xfd, 0x07, 0x86, 0x8e,
264                                                       0x46, 0xae, 0xca, 0x63, 0xb5, 0x1f, 0xda, 0x51, 0x9a, 0x34, 0x20,
265                                                       0x50, 0x1a, 0xcb, 0xe2, 0x3d, 0x53, 0xc2, 0x91, 0x87, 0x48 };
266 static const uint8_t chiptest_e4836c3b50dd_X_37[] = {
267     0x04, 0xc1, 0x4d, 0x28, 0xf4, 0x37, 0x0f, 0xea, 0x20, 0x74, 0x51, 0x06, 0xce, 0xa5, 0x8b, 0xcf, 0xb6,
268     0x0f, 0x29, 0x49, 0xfa, 0x4e, 0x13, 0x1b, 0x9a, 0xff, 0x5e, 0xa1, 0x3f, 0xd5, 0xaa, 0x79, 0xd5, 0x07,
269     0xae, 0x1d, 0x22, 0x9e, 0x44, 0x7e, 0x00, 0x0f, 0x15, 0xeb, 0x78, 0xa9, 0xa3, 0x2c, 0x2b, 0x88, 0x65,
270     0x2e, 0x34, 0x11, 0x64, 0x20, 0x43, 0xc1, 0xb2, 0xb7, 0x99, 0x2c, 0xf2, 0xd4, 0xde
271 };
272 static const uint8_t chiptest_e4836c3b50dd_y_38[] = { 0x39, 0x39, 0x7f, 0xbe, 0x6d, 0xb4, 0x7e, 0x9f, 0xbd, 0x1a, 0x26,
273                                                       0x3d, 0x79, 0xf5, 0xd0, 0xaa, 0xa4, 0x4d, 0xf2, 0x6c, 0xe7, 0x55,
274                                                       0xf7, 0x8e, 0x09, 0x26, 0x44, 0xb4, 0x34, 0x53, 0x3a, 0x42 };
275 static const uint8_t chiptest_e4836c3b50dd_Y_39[] = {
276     0x04, 0xd1, 0xbe, 0xe3, 0x12, 0x0f, 0xd8, 0x7e, 0x86, 0xfe, 0x18, 0x9c, 0xb9, 0x52, 0xdc, 0x68, 0x88,
277     0x23, 0x08, 0x0e, 0x62, 0x52, 0x4d, 0xd2, 0xc0, 0x8d, 0xff, 0xe3, 0xd2, 0x2a, 0x0a, 0x89, 0x86, 0xaa,
278     0x64, 0xc9, 0xfe, 0x01, 0x91, 0x03, 0x3c, 0xaf, 0xbc, 0x9b, 0xca, 0xef, 0xc8, 0xe2, 0xba, 0x8b, 0xa8,
279     0x60, 0xcd, 0x12, 0x7a, 0xf9, 0xef, 0xdd, 0x7f, 0x1c, 0x3a, 0x41, 0x92, 0x0f, 0xe8
280 };
281 static const uint8_t chiptest_e4836c3b50dd_Z_40[] = {
282     0x04, 0xaa, 0xc7, 0x1c, 0xf4, 0xc8, 0xdf, 0x81, 0x81, 0xb8, 0x67, 0xc9, 0xec, 0xbe, 0xe9, 0xd0, 0x96,
283     0x3c, 0xaf, 0x51, 0xf1, 0x53, 0x4a, 0x82, 0x34, 0x29, 0xc2, 0x6f, 0xe5, 0x24, 0x83, 0x13, 0xff, 0xc5,
284     0xc5, 0xe4, 0x4e, 0xa8, 0x16, 0x21, 0x61, 0xab, 0x6b, 0x3d, 0x73, 0xb8, 0x77, 0x04, 0xa4, 0x58, 0x89,
285     0xbf, 0x63, 0x43, 0xd9, 0x6f, 0xa9, 0x6c, 0xd1, 0x64, 0x1e, 0xfa, 0x71, 0x60, 0x7c
286 };
287 static const uint8_t chiptest_e4836c3b50dd_V_41[] = {
288     0x04, 0xc7, 0xc9, 0x50, 0x53, 0x65, 0xf7, 0xce, 0x57, 0x29, 0x3c, 0x92, 0xa3, 0x7f, 0x1b, 0xbd, 0xc6,
289     0x8e, 0x03, 0x22, 0x90, 0x1e, 0x61, 0xed, 0xef, 0x59, 0xfe, 0xe7, 0x87, 0x6b, 0x17, 0xb0, 0x63, 0xe0,
290     0xfa, 0x4a, 0x12, 0x6e, 0xae, 0x0a, 0x67, 0x1b, 0x37, 0xf1, 0x46, 0x4c, 0xf1, 0xcc, 0xad, 0x59, 0x1c,
291     0x33, 0xae, 0x94, 0x4e, 0x3b, 0x1f, 0x31, 0x8d, 0x76, 0xe3, 0x6f, 0xea, 0x99, 0x66
292 };
293 static const uint8_t chiptest_e4836c3b50dd_Ka_42[]      = { 0xec, 0x8d, 0x19, 0xb8, 0x07, 0xff, 0xb1, 0xd1,
294                                                        0xee, 0xa8, 0x1a, 0x93, 0xba, 0x35, 0xcd, 0xfe };
295 static const uint8_t chiptest_e4836c3b50dd_Ke_43[]      = { 0x2e, 0xa4, 0x0e, 0x4b, 0xad, 0xfa, 0x54, 0x52,
296                                                        0xb5, 0x74, 0x4d, 0xc5, 0x98, 0x3e, 0x99, 0xba };
297 static const uint8_t chiptest_e4836c3b50dd_KcA_44[]     = { 0x66, 0xde, 0x53, 0x4d, 0x9b, 0xf1, 0xe4, 0x4e,
298                                                         0x96, 0xa5, 0x3a, 0x4b, 0x48, 0xd6, 0xb3, 0x53 };
299 static const uint8_t chiptest_e4836c3b50dd_KcB_45[]     = { 0x49, 0x45, 0xc3, 0x8b, 0xb4, 0x76, 0xcb, 0x0f,
300                                                         0x34, 0x7f, 0x32, 0x22, 0xbe, 0x9b, 0x64, 0xa2 };
301 static const uint8_t chiptest_e4836c3b50dd_MAC_KcA_46[] = { 0xe5, 0x64, 0xc9, 0x3b, 0x30, 0x15, 0xef, 0xb9, 0x46, 0xdc, 0x16,
302                                                             0xd6, 0x42, 0xbb, 0xe7, 0xd1, 0xc8, 0xda, 0x5b, 0xe1, 0x64, 0xed,
303                                                             0x9f, 0xc3, 0xba, 0xe4, 0xe0, 0xff, 0x86, 0xe1, 0xbd, 0x3c };
304 static const uint8_t chiptest_e4836c3b50dd_MAC_KcB_47[] = { 0x07, 0x2a, 0x94, 0xd9, 0xa5, 0x4e, 0xdc, 0x20, 0x1d, 0x88, 0x91,
305                                                             0x53, 0x4c, 0x23, 0x17, 0xca, 0xdf, 0x3e, 0xa3, 0x79, 0x28, 0x27,
306                                                             0xf4, 0x79, 0xe8, 0x73, 0xf9, 0x3e, 0x90, 0xf2, 0x15, 0x52 };
307 static const struct spake2p_rfc_tv chiptest_e4836c3b50dd_test_vector_48 = {
308     .context               = reinterpret_cast<const uint8_t *>("SPAKE2+-P256-SHA256-HKDF draft-01"),
309     .context_len           = 33,
310     .prover_identity       = reinterpret_cast<const uint8_t *>(""),
311     .prover_identity_len   = 0,
312     .verifier_identity     = reinterpret_cast<const uint8_t *>("server"),
313     .verifier_identity_len = 6,
314     .w0                    = chiptest_e4836c3b50dd_w0_33,
315     .w0_len                = 32,
316     .w1                    = chiptest_e4836c3b50dd_w1_34,
317     .w1_len                = 32,
318     .L                     = chiptest_e4836c3b50dd_L_35,
319     .L_len                 = 65,
320     .x                     = chiptest_e4836c3b50dd_x_36,
321     .x_len                 = 32,
322     .X                     = chiptest_e4836c3b50dd_X_37,
323     .X_len                 = 65,
324     .y                     = chiptest_e4836c3b50dd_y_38,
325     .y_len                 = 32,
326     .Y                     = chiptest_e4836c3b50dd_Y_39,
327     .Y_len                 = 65,
328     .Z                     = chiptest_e4836c3b50dd_Z_40,
329     .Z_len                 = 65,
330     .V                     = chiptest_e4836c3b50dd_V_41,
331     .V_len                 = 65,
332     .Ka                    = chiptest_e4836c3b50dd_Ka_42,
333     .Ka_len                = 16,
334     .Ke                    = chiptest_e4836c3b50dd_Ke_43,
335     .Ke_len                = 16,
336     .KcA                   = chiptest_e4836c3b50dd_KcA_44,
337     .KcA_len               = 16,
338     .KcB                   = chiptest_e4836c3b50dd_KcB_45,
339     .KcB_len               = 16,
340     .MAC_KcA               = chiptest_e4836c3b50dd_MAC_KcA_46,
341     .MAC_KcA_len           = 32,
342     .MAC_KcB               = chiptest_e4836c3b50dd_MAC_KcB_47,
343     .MAC_KcB_len           = 32
344 };
345 static const uint8_t chiptest_e4836c3b50dd_w0_49[] = { 0xe6, 0x88, 0x7c, 0xf9, 0xbd, 0xfb, 0x75, 0x79, 0xc6, 0x9b, 0xf4,
346                                                        0x79, 0x28, 0xa8, 0x45, 0x14, 0xb5, 0xe3, 0x55, 0xac, 0x03, 0x48,
347                                                        0x63, 0xf7, 0xff, 0xaf, 0x43, 0x90, 0xe6, 0x7d, 0x79, 0x8c };
348 static const uint8_t chiptest_e4836c3b50dd_w1_50[] = { 0x24, 0xb5, 0xae, 0x4a, 0xbd, 0xa8, 0x68, 0xec, 0x93, 0x36, 0xff,
349                                                        0xc3, 0xb7, 0x8e, 0xe3, 0x1c, 0x57, 0x55, 0xbe, 0xf1, 0x75, 0x92,
350                                                        0x27, 0xef, 0x53, 0x72, 0xca, 0x13, 0x9b, 0x94, 0xe5, 0x12 };
351 static const uint8_t chiptest_e4836c3b50dd_L_51[]  = {
352     0x04, 0x95, 0x64, 0x5c, 0xfb, 0x74, 0xdf, 0x6e, 0x58, 0xf9, 0x74, 0x8b, 0xb8, 0x3a, 0x86, 0x62, 0x0b,
353     0xab, 0x7c, 0x82, 0xe1, 0x07, 0xf5, 0x7d, 0x68, 0x70, 0xda, 0x8c, 0xbc, 0xb2, 0xff, 0x9f, 0x70, 0x63,
354     0xa1, 0x4b, 0x64, 0x02, 0xc6, 0x2f, 0x99, 0xaf, 0xcb, 0x97, 0x06, 0xa4, 0xd1, 0xa1, 0x43, 0x27, 0x32,
355     0x59, 0xfe, 0x76, 0xf1, 0xc6, 0x05, 0xa3, 0x63, 0x97, 0x45, 0xa9, 0x21, 0x54, 0xb9
356 };
357 static const uint8_t chiptest_e4836c3b50dd_x_52[] = { 0x5b, 0x47, 0x86, 0x19, 0x80, 0x4f, 0x49, 0x38, 0xd3, 0x61, 0xfb,
358                                                       0xba, 0x3a, 0x20, 0x64, 0x87, 0x25, 0x22, 0x2f, 0x0a, 0x54, 0xcc,
359                                                       0x4c, 0x87, 0x61, 0x39, 0xef, 0xe7, 0xd9, 0xa2, 0x17, 0x86 };
360 static const uint8_t chiptest_e4836c3b50dd_X_53[] = {
361     0x04, 0xa6, 0xdb, 0x23, 0xd0, 0x01, 0x72, 0x3f, 0xb0, 0x1f, 0xcf, 0xc9, 0xd0, 0x87, 0x46, 0xc3, 0xc2,
362     0xa0, 0xa3, 0xfe, 0xff, 0x86, 0x35, 0xd2, 0x9c, 0xad, 0x28, 0x53, 0xe7, 0x35, 0x86, 0x23, 0x42, 0x5c,
363     0xf3, 0x97, 0x12, 0xe9, 0x28, 0x05, 0x45, 0x61, 0xba, 0x71, 0xe2, 0xdc, 0x11, 0xf3, 0x00, 0xf1, 0x76,
364     0x0e, 0x71, 0xeb, 0x17, 0x70, 0x21, 0xa8, 0xf8, 0x5e, 0x78, 0x68, 0x90, 0x71, 0xcd
365 };
366 static const uint8_t chiptest_e4836c3b50dd_y_54[] = { 0x76, 0x67, 0x70, 0xda, 0xd8, 0xc8, 0xee, 0xcb, 0xa9, 0x36, 0x82,
367                                                       0x3c, 0x0a, 0xed, 0x04, 0x4b, 0x8c, 0x3c, 0x4f, 0x76, 0x55, 0xe8,
368                                                       0xbe, 0xec, 0x44, 0xa1, 0x5d, 0xcb, 0xca, 0xf7, 0x8e, 0x5e };
369 static const uint8_t chiptest_e4836c3b50dd_Y_55[] = {
370     0x04, 0x39, 0x0d, 0x29, 0xbf, 0x18, 0x5c, 0x3a, 0xbf, 0x99, 0xf1, 0x50, 0xae, 0x7c, 0x13, 0x38, 0x8c,
371     0x82, 0xb6, 0xbe, 0x0c, 0x07, 0xb1, 0xb8, 0xd9, 0x0d, 0x26, 0x85, 0x3e, 0x84, 0x37, 0x4b, 0xbd, 0xc8,
372     0x2b, 0xec, 0xdb, 0x97, 0x8c, 0xa3, 0x79, 0x2f, 0x47, 0x24, 0x24, 0x10, 0x6a, 0x25, 0x78, 0x01, 0x27,
373     0x52, 0xc1, 0x19, 0x38, 0xfc, 0xf6, 0x0a, 0x41, 0xdf, 0x75, 0xff, 0x7c, 0xf9, 0x47
374 };
375 static const uint8_t chiptest_e4836c3b50dd_Z_56[] = {
376     0x04, 0x0a, 0x15, 0x0d, 0x9a, 0x62, 0xf5, 0x14, 0xc9, 0xa1, 0xfe, 0xdd, 0x78, 0x2a, 0x02, 0x40, 0xa3,
377     0x42, 0x72, 0x10, 0x46, 0xce, 0xfb, 0x11, 0x11, 0xc3, 0xad, 0xb3, 0xbe, 0x89, 0x3c, 0xe9, 0xfc, 0xd2,
378     0xff, 0xa1, 0x37, 0x92, 0x2f, 0xcf, 0x8a, 0x58, 0x8d, 0x0f, 0x76, 0xba, 0x9c, 0x55, 0xc8, 0x5d, 0xa2,
379     0xaf, 0x3f, 0x1c, 0x78, 0x9c, 0xa1, 0x79, 0x76, 0x81, 0x03, 0x87, 0xfb, 0x1d, 0x7e
380 };
381 static const uint8_t chiptest_e4836c3b50dd_V_57[] = {
382     0x04, 0xf8, 0xe2, 0x47, 0xcc, 0x26, 0x3a, 0x18, 0x46, 0x27, 0x2f, 0x5a, 0x3b, 0x61, 0xb6, 0x8a, 0xa6,
383     0x0a, 0x5a, 0x26, 0x65, 0xd1, 0x0c, 0xd2, 0x2c, 0x89, 0xcd, 0x6b, 0xad, 0x05, 0xdc, 0x0e, 0x5e, 0x65,
384     0x0f, 0x21, 0xff, 0x01, 0x71, 0x86, 0xcc, 0x92, 0x65, 0x1a, 0x4c, 0xd7, 0xe6, 0x6c, 0xe8, 0x8f, 0x52,
385     0x92, 0x99, 0xf3, 0x40, 0xea, 0x80, 0xfb, 0x90, 0xa9, 0xba, 0xd0, 0x94, 0xe1, 0xa6
386 };
387 static const uint8_t chiptest_e4836c3b50dd_Ka_58[]      = { 0x59, 0x29, 0xa3, 0xce, 0x98, 0x22, 0xc8, 0x14,
388                                                        0x01, 0xbf, 0x0f, 0x76, 0x4f, 0x69, 0xaf, 0x08 };
389 static const uint8_t chiptest_e4836c3b50dd_Ke_59[]      = { 0xea, 0x32, 0x76, 0xd6, 0x83, 0x34, 0x57, 0x60,
390                                                        0x97, 0xe0, 0x4b, 0x19, 0xee, 0x5a, 0x3a, 0x8b };
391 static const uint8_t chiptest_e4836c3b50dd_KcA_60[]     = { 0x7f, 0x84, 0xb9, 0x39, 0xd6, 0x00, 0x11, 0x72,
392                                                         0x56, 0xb0, 0xc8, 0xa6, 0xd4, 0x0c, 0xf1, 0x81 };
393 static const uint8_t chiptest_e4836c3b50dd_KcB_61[]     = { 0xf7, 0xd7, 0x54, 0x7c, 0xed, 0x93, 0xf6, 0x81,
394                                                         0xe8, 0xdf, 0x4c, 0x25, 0x8c, 0x45, 0x16, 0xfd };
395 static const uint8_t chiptest_e4836c3b50dd_MAC_KcA_62[] = { 0x71, 0xd9, 0x41, 0x27, 0x79, 0xb6, 0xc4, 0x5a, 0x2c, 0x61, 0x5c,
396                                                             0x9d, 0xf3, 0xf1, 0xfd, 0x93, 0xdc, 0x0a, 0xaf, 0x63, 0x10, 0x4d,
397                                                             0xa8, 0xec, 0xe4, 0xaa, 0x1b, 0x5a, 0x3a, 0x41, 0x5f, 0xea };
398 static const uint8_t chiptest_e4836c3b50dd_MAC_KcB_63[] = { 0x09, 0x5d, 0xc0, 0x40, 0x03, 0x55, 0xcc, 0x23, 0x3f, 0xde, 0x74,
399                                                             0x37, 0x81, 0x18, 0x15, 0xb3, 0xc1, 0x52, 0x4a, 0xae, 0x80, 0xfd,
400                                                             0x4e, 0x68, 0x10, 0xcf, 0x53, 0x1c, 0xf1, 0x1d, 0x20, 0xe3 };
401 static const struct spake2p_rfc_tv chiptest_e4836c3b50dd_test_vector_64 = {
402     .context               = reinterpret_cast<const uint8_t *>("SPAKE2+-P256-SHA256-HKDF draft-01"),
403     .context_len           = 33,
404     .prover_identity       = reinterpret_cast<const uint8_t *>(""),
405     .prover_identity_len   = 0,
406     .verifier_identity     = reinterpret_cast<const uint8_t *>(""),
407     .verifier_identity_len = 0,
408     .w0                    = chiptest_e4836c3b50dd_w0_49,
409     .w0_len                = 32,
410     .w1                    = chiptest_e4836c3b50dd_w1_50,
411     .w1_len                = 32,
412     .L                     = chiptest_e4836c3b50dd_L_51,
413     .L_len                 = 65,
414     .x                     = chiptest_e4836c3b50dd_x_52,
415     .x_len                 = 32,
416     .X                     = chiptest_e4836c3b50dd_X_53,
417     .X_len                 = 65,
418     .y                     = chiptest_e4836c3b50dd_y_54,
419     .y_len                 = 32,
420     .Y                     = chiptest_e4836c3b50dd_Y_55,
421     .Y_len                 = 65,
422     .Z                     = chiptest_e4836c3b50dd_Z_56,
423     .Z_len                 = 65,
424     .V                     = chiptest_e4836c3b50dd_V_57,
425     .V_len                 = 65,
426     .Ka                    = chiptest_e4836c3b50dd_Ka_58,
427     .Ka_len                = 16,
428     .Ke                    = chiptest_e4836c3b50dd_Ke_59,
429     .Ke_len                = 16,
430     .KcA                   = chiptest_e4836c3b50dd_KcA_60,
431     .KcA_len               = 16,
432     .KcB                   = chiptest_e4836c3b50dd_KcB_61,
433     .KcB_len               = 16,
434     .MAC_KcA               = chiptest_e4836c3b50dd_MAC_KcA_62,
435     .MAC_KcA_len           = 32,
436     .MAC_KcB               = chiptest_e4836c3b50dd_MAC_KcB_63,
437     .MAC_KcB_len           = 32
438 };
439 static const struct spake2p_rfc_tv * rfc_tvs[] = { &chiptest_e4836c3b50dd_test_vector_16, &chiptest_e4836c3b50dd_test_vector_32,
440                                                    &chiptest_e4836c3b50dd_test_vector_48, &chiptest_e4836c3b50dd_test_vector_64 };
441
442 } // namespace Crypto
443 } // namespace chip
444
445 #endif