3 * Copyright (c) 2020 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file - This file contains read / write field element test vectors.
22 #ifndef _SPAKE2P_FE_RW_TEST_VECTORS_H_
23 #define _SPAKE2P_FE_RW_TEST_VECTORS_H_
28 struct spake2p_fe_rw_tv
30 const uint8_t * fe_in;
32 const uint8_t * fe_out;
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,
43 .fe_out = chiptest_53ea71b7cccd_fe_out_2,
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,
53 .fe_out = chiptest_53ea71b7cccd_fe_out_5,
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,
65 .fe_out = chiptest_53ea71b7cccd_fe_out_8,
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,
77 .fe_out = chiptest_53ea71b7cccd_fe_out_11,
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,
89 .fe_out = chiptest_53ea71b7cccd_fe_out_14,
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,
101 .fe_out = chiptest_53ea71b7cccd_fe_out_17,
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,
113 .fe_out = chiptest_53ea71b7cccd_fe_out_20,
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 };
121 } // namespace Crypto