Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / crypto / tests / SPAKE2P_FE_RW_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 read / write field element test vectors.
20  */
21
22 #ifndef _SPAKE2P_FE_RW_TEST_VECTORS_H_
23 #define _SPAKE2P_FE_RW_TEST_VECTORS_H_
24
25 namespace chip {
26 namespace Crypto {
27
28 struct spake2p_fe_rw_tv
29 {
30     const uint8_t * fe_in;
31     size_t fe_in_len;
32     const uint8_t * fe_out;
33     size_t fe_out_len;
34 };
35
36 static const uint8_t chiptest_53ea71b7cccd_fe_in_1[]  = {};
37 static const uint8_t chiptest_53ea71b7cccd_fe_out_2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
38                                                           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
39                                                           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
40 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_3 = {
41     .fe_in      = chiptest_53ea71b7cccd_fe_in_1,
42     .fe_in_len  = 0,
43     .fe_out     = chiptest_53ea71b7cccd_fe_out_2,
44     .fe_out_len = 32,
45 };
46 static const uint8_t chiptest_53ea71b7cccd_fe_in_4[]  = { 0x01 };
47 static const uint8_t chiptest_53ea71b7cccd_fe_out_5[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48                                                           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49                                                           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
50 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_6 = {
51     .fe_in      = chiptest_53ea71b7cccd_fe_in_4,
52     .fe_in_len  = 1,
53     .fe_out     = chiptest_53ea71b7cccd_fe_out_5,
54     .fe_out_len = 32,
55 };
56 static const uint8_t chiptest_53ea71b7cccd_fe_in_7[]  = { 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57                                                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58                                                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
59 static const uint8_t chiptest_53ea71b7cccd_fe_out_8[] = { 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60                                                           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61                                                           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
62 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_9 = {
63     .fe_in      = chiptest_53ea71b7cccd_fe_in_7,
64     .fe_in_len  = 32,
65     .fe_out     = chiptest_53ea71b7cccd_fe_out_8,
66     .fe_out_len = 32,
67 };
68 static const uint8_t chiptest_53ea71b7cccd_fe_in_10[]  = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
69                                                           0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad, 0xa7, 0x17,
70                                                           0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x50 };
71 static const uint8_t chiptest_53ea71b7cccd_fe_out_11[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
72                                                            0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad, 0xa7, 0x17,
73                                                            0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x50 };
74 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_12 = {
75     .fe_in      = chiptest_53ea71b7cccd_fe_in_10,
76     .fe_in_len  = 32,
77     .fe_out     = chiptest_53ea71b7cccd_fe_out_11,
78     .fe_out_len = 32,
79 };
80 static const uint8_t chiptest_53ea71b7cccd_fe_in_13[]  = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
81                                                           0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad, 0xa7, 0x17,
82                                                           0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x51 };
83 static const uint8_t chiptest_53ea71b7cccd_fe_out_14[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
86 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_15 = {
87     .fe_in      = chiptest_53ea71b7cccd_fe_in_13,
88     .fe_in_len  = 32,
89     .fe_out     = chiptest_53ea71b7cccd_fe_out_14,
90     .fe_out_len = 32,
91 };
92 static const uint8_t chiptest_53ea71b7cccd_fe_in_16[]  = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
93                                                           0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad, 0xa7, 0x17,
94                                                           0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x52 };
95 static const uint8_t chiptest_53ea71b7cccd_fe_out_17[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97                                                            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
98 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_18 = {
99     .fe_in      = chiptest_53ea71b7cccd_fe_in_16,
100     .fe_in_len  = 32,
101     .fe_out     = chiptest_53ea71b7cccd_fe_out_17,
102     .fe_out_len = 32,
103 };
104 static const uint8_t chiptest_53ea71b7cccd_fe_in_19[]  = { 0x01, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff,
105                                                           0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x79, 0xcd, 0xf5, 0x5b, 0x4e,
106                                                           0x2f, 0x3d, 0x09, 0xe7, 0x73, 0x95, 0x85, 0xf8, 0xc6, 0x4a, 0xa1 };
107 static const uint8_t chiptest_53ea71b7cccd_fe_out_20[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
108                                                            0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0xe6, 0xfa, 0xad, 0xa7, 0x17,
109                                                            0x9e, 0x84, 0xf3, 0xb9, 0xca, 0xc2, 0xfc, 0x63, 0x25, 0x50 };
110 static const struct spake2p_fe_rw_tv chiptest_53ea71b7cccd_test_vector_21 = {
111     .fe_in      = chiptest_53ea71b7cccd_fe_in_19,
112     .fe_in_len  = 33,
113     .fe_out     = chiptest_53ea71b7cccd_fe_out_20,
114     .fe_out_len = 32,
115 };
116 static const struct spake2p_fe_rw_tv * fe_rw_tvs[] = { &chiptest_53ea71b7cccd_test_vector_3,  &chiptest_53ea71b7cccd_test_vector_6,
117                                                        &chiptest_53ea71b7cccd_test_vector_9,  &chiptest_53ea71b7cccd_test_vector_12,
118                                                        &chiptest_53ea71b7cccd_test_vector_15, &chiptest_53ea71b7cccd_test_vector_18,
119                                                        &chiptest_53ea71b7cccd_test_vector_21 };
120
121 } // namespace Crypto
122 } // namespace chip
123
124 #endif