xref: /linux/lib/crypto/tests/sha1-testvecs.h (revision f2f573ebd42d659111bc71279cc16e5e78e56ae7)
1*66b13060SEric Biggers /* SPDX-License-Identifier: GPL-2.0-or-later */
2*66b13060SEric Biggers /* This file was generated by: ./scripts/crypto/gen-hash-testvecs.py sha1 */
3*66b13060SEric Biggers 
4*66b13060SEric Biggers static const struct {
5*66b13060SEric Biggers 	size_t data_len;
6*66b13060SEric Biggers 	u8 digest[SHA1_DIGEST_SIZE];
7*66b13060SEric Biggers } hash_testvecs[] = {
8*66b13060SEric Biggers 	{
9*66b13060SEric Biggers 		.data_len = 0,
10*66b13060SEric Biggers 		.digest = {
11*66b13060SEric Biggers 			0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d,
12*66b13060SEric Biggers 			0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90,
13*66b13060SEric Biggers 			0xaf, 0xd8, 0x07, 0x09,
14*66b13060SEric Biggers 		},
15*66b13060SEric Biggers 	},
16*66b13060SEric Biggers 	{
17*66b13060SEric Biggers 		.data_len = 1,
18*66b13060SEric Biggers 		.digest = {
19*66b13060SEric Biggers 			0x0a, 0xd0, 0x52, 0xdd, 0x9f, 0x32, 0x40, 0x55,
20*66b13060SEric Biggers 			0x21, 0xe4, 0x3c, 0x6e, 0xbd, 0xc5, 0x2f, 0x5a,
21*66b13060SEric Biggers 			0x02, 0x54, 0x93, 0xb2,
22*66b13060SEric Biggers 		},
23*66b13060SEric Biggers 	},
24*66b13060SEric Biggers 	{
25*66b13060SEric Biggers 		.data_len = 2,
26*66b13060SEric Biggers 		.digest = {
27*66b13060SEric Biggers 			0x13, 0x83, 0x82, 0x03, 0x23, 0xff, 0x46, 0xd6,
28*66b13060SEric Biggers 			0x12, 0x7f, 0xad, 0x05, 0x2b, 0xc3, 0x4a, 0x42,
29*66b13060SEric Biggers 			0x49, 0x6a, 0xf8, 0x84,
30*66b13060SEric Biggers 		},
31*66b13060SEric Biggers 	},
32*66b13060SEric Biggers 	{
33*66b13060SEric Biggers 		.data_len = 3,
34*66b13060SEric Biggers 		.digest = {
35*66b13060SEric Biggers 			0xe4, 0xdf, 0x7b, 0xdc, 0xe8, 0x6e, 0x81, 0x97,
36*66b13060SEric Biggers 			0x1e, 0x0f, 0xe8, 0x8b, 0x76, 0xa8, 0x59, 0x04,
37*66b13060SEric Biggers 			0xae, 0x92, 0x1a, 0x7c,
38*66b13060SEric Biggers 		},
39*66b13060SEric Biggers 	},
40*66b13060SEric Biggers 	{
41*66b13060SEric Biggers 		.data_len = 16,
42*66b13060SEric Biggers 		.digest = {
43*66b13060SEric Biggers 			0x8c, 0x1c, 0x30, 0xd8, 0xbc, 0xc4, 0xc3, 0xf5,
44*66b13060SEric Biggers 			0xf8, 0x83, 0x0d, 0x1e, 0x04, 0x5d, 0x29, 0xb5,
45*66b13060SEric Biggers 			0x68, 0x89, 0xc1, 0xe9,
46*66b13060SEric Biggers 		},
47*66b13060SEric Biggers 	},
48*66b13060SEric Biggers 	{
49*66b13060SEric Biggers 		.data_len = 32,
50*66b13060SEric Biggers 		.digest = {
51*66b13060SEric Biggers 			0x6c, 0x1d, 0x72, 0x31, 0xa5, 0x03, 0x4f, 0xdc,
52*66b13060SEric Biggers 			0xff, 0x2d, 0x06, 0x3e, 0x24, 0x26, 0x34, 0x8d,
53*66b13060SEric Biggers 			0x60, 0xa4, 0x67, 0x16,
54*66b13060SEric Biggers 		},
55*66b13060SEric Biggers 	},
56*66b13060SEric Biggers 	{
57*66b13060SEric Biggers 		.data_len = 48,
58*66b13060SEric Biggers 		.digest = {
59*66b13060SEric Biggers 			0x37, 0x53, 0x33, 0xfa, 0xd0, 0x21, 0xad, 0xe7,
60*66b13060SEric Biggers 			0xa5, 0x43, 0xf1, 0x94, 0x64, 0x11, 0x47, 0x9c,
61*66b13060SEric Biggers 			0x72, 0xb5, 0x78, 0xb4,
62*66b13060SEric Biggers 		},
63*66b13060SEric Biggers 	},
64*66b13060SEric Biggers 	{
65*66b13060SEric Biggers 		.data_len = 49,
66*66b13060SEric Biggers 		.digest = {
67*66b13060SEric Biggers 			0x51, 0x5c, 0xd8, 0x5a, 0xa9, 0xde, 0x7b, 0x2a,
68*66b13060SEric Biggers 			0xa2, 0xff, 0x70, 0x09, 0x56, 0x88, 0x40, 0x2b,
69*66b13060SEric Biggers 			0x50, 0x93, 0x82, 0x47,
70*66b13060SEric Biggers 		},
71*66b13060SEric Biggers 	},
72*66b13060SEric Biggers 	{
73*66b13060SEric Biggers 		.data_len = 63,
74*66b13060SEric Biggers 		.digest = {
75*66b13060SEric Biggers 			0xbc, 0x9c, 0xab, 0x93, 0x06, 0xd5, 0xdb, 0xac,
76*66b13060SEric Biggers 			0x2c, 0x33, 0x15, 0x83, 0x56, 0xf6, 0x91, 0x20,
77*66b13060SEric Biggers 			0x09, 0xc7, 0xb2, 0x6b,
78*66b13060SEric Biggers 		},
79*66b13060SEric Biggers 	},
80*66b13060SEric Biggers 	{
81*66b13060SEric Biggers 		.data_len = 64,
82*66b13060SEric Biggers 		.digest = {
83*66b13060SEric Biggers 			0x26, 0x90, 0x3b, 0x47, 0xe1, 0x92, 0x42, 0xd0,
84*66b13060SEric Biggers 			0x85, 0x63, 0x2e, 0x6b, 0x68, 0xa4, 0xc4, 0x4c,
85*66b13060SEric Biggers 			0xe6, 0xf4, 0xb0, 0x52,
86*66b13060SEric Biggers 		},
87*66b13060SEric Biggers 	},
88*66b13060SEric Biggers 	{
89*66b13060SEric Biggers 		.data_len = 65,
90*66b13060SEric Biggers 		.digest = {
91*66b13060SEric Biggers 			0x55, 0x6f, 0x87, 0xdc, 0x34, 0x3d, 0xe2, 0x4f,
92*66b13060SEric Biggers 			0xc3, 0x81, 0xa4, 0x82, 0x79, 0x84, 0x64, 0x01,
93*66b13060SEric Biggers 			0x55, 0xa0, 0x1e, 0x36,
94*66b13060SEric Biggers 		},
95*66b13060SEric Biggers 	},
96*66b13060SEric Biggers 	{
97*66b13060SEric Biggers 		.data_len = 127,
98*66b13060SEric Biggers 		.digest = {
99*66b13060SEric Biggers 			0xb7, 0xd5, 0x5f, 0xa4, 0xef, 0xbf, 0x4f, 0x96,
100*66b13060SEric Biggers 			0x01, 0xc1, 0x06, 0xe3, 0x75, 0xa8, 0x90, 0x92,
101*66b13060SEric Biggers 			0x4c, 0x5f, 0xf1, 0x21,
102*66b13060SEric Biggers 		},
103*66b13060SEric Biggers 	},
104*66b13060SEric Biggers 	{
105*66b13060SEric Biggers 		.data_len = 128,
106*66b13060SEric Biggers 		.digest = {
107*66b13060SEric Biggers 			0x70, 0x0c, 0xea, 0xa4, 0x93, 0xd0, 0x56, 0xf0,
108*66b13060SEric Biggers 			0x6f, 0xbb, 0x53, 0x42, 0x5b, 0xe3, 0xf2, 0xb0,
109*66b13060SEric Biggers 			0x30, 0x66, 0x8e, 0x75,
110*66b13060SEric Biggers 		},
111*66b13060SEric Biggers 	},
112*66b13060SEric Biggers 	{
113*66b13060SEric Biggers 		.data_len = 129,
114*66b13060SEric Biggers 		.digest = {
115*66b13060SEric Biggers 			0x15, 0x01, 0xbc, 0xb0, 0xee, 0xd8, 0xeb, 0xa8,
116*66b13060SEric Biggers 			0x7d, 0xd9, 0x4d, 0x50, 0x2e, 0x41, 0x30, 0xba,
117*66b13060SEric Biggers 			0x41, 0xaa, 0x7b, 0x02,
118*66b13060SEric Biggers 		},
119*66b13060SEric Biggers 	},
120*66b13060SEric Biggers 	{
121*66b13060SEric Biggers 		.data_len = 256,
122*66b13060SEric Biggers 		.digest = {
123*66b13060SEric Biggers 			0x98, 0x05, 0x52, 0xf5, 0x0f, 0xf0, 0xd3, 0x97,
124*66b13060SEric Biggers 			0x15, 0x8c, 0xa3, 0x9a, 0x2b, 0x4d, 0x67, 0x57,
125*66b13060SEric Biggers 			0x29, 0xa0, 0xac, 0x61,
126*66b13060SEric Biggers 		},
127*66b13060SEric Biggers 	},
128*66b13060SEric Biggers 	{
129*66b13060SEric Biggers 		.data_len = 511,
130*66b13060SEric Biggers 		.digest = {
131*66b13060SEric Biggers 			0x1f, 0x47, 0xf0, 0xcc, 0xd7, 0xda, 0xa5, 0x3b,
132*66b13060SEric Biggers 			0x39, 0xb4, 0x5b, 0xa8, 0x33, 0xd4, 0xca, 0x2f,
133*66b13060SEric Biggers 			0xdd, 0xf2, 0x39, 0x89,
134*66b13060SEric Biggers 		},
135*66b13060SEric Biggers 	},
136*66b13060SEric Biggers 	{
137*66b13060SEric Biggers 		.data_len = 513,
138*66b13060SEric Biggers 		.digest = {
139*66b13060SEric Biggers 			0xb9, 0x75, 0xe6, 0x57, 0x42, 0x7f, 0x8b, 0x0a,
140*66b13060SEric Biggers 			0xcc, 0x53, 0x10, 0x69, 0x45, 0xac, 0xfd, 0x11,
141*66b13060SEric Biggers 			0xf7, 0x1f, 0x4e, 0x6f,
142*66b13060SEric Biggers 		},
143*66b13060SEric Biggers 	},
144*66b13060SEric Biggers 	{
145*66b13060SEric Biggers 		.data_len = 1000,
146*66b13060SEric Biggers 		.digest = {
147*66b13060SEric Biggers 			0x63, 0x66, 0xcb, 0x44, 0xc1, 0x2c, 0xa2, 0x06,
148*66b13060SEric Biggers 			0x5d, 0xb9, 0x8e, 0x31, 0xcb, 0x4f, 0x4e, 0x49,
149*66b13060SEric Biggers 			0xe0, 0xfb, 0x3c, 0x4e,
150*66b13060SEric Biggers 		},
151*66b13060SEric Biggers 	},
152*66b13060SEric Biggers 	{
153*66b13060SEric Biggers 		.data_len = 3333,
154*66b13060SEric Biggers 		.digest = {
155*66b13060SEric Biggers 			0x35, 0xbc, 0x74, 0xfb, 0x31, 0x9c, 0xd4, 0xdd,
156*66b13060SEric Biggers 			0xe8, 0x87, 0xa7, 0x56, 0x3b, 0x08, 0xe5, 0x49,
157*66b13060SEric Biggers 			0xe1, 0xe9, 0xc9, 0xa8,
158*66b13060SEric Biggers 		},
159*66b13060SEric Biggers 	},
160*66b13060SEric Biggers 	{
161*66b13060SEric Biggers 		.data_len = 4096,
162*66b13060SEric Biggers 		.digest = {
163*66b13060SEric Biggers 			0x43, 0x00, 0xea, 0xcd, 0x4e, 0x7c, 0xe9, 0xe4,
164*66b13060SEric Biggers 			0x32, 0xce, 0x25, 0xa8, 0xcd, 0x20, 0xa8, 0xaa,
165*66b13060SEric Biggers 			0x7b, 0x63, 0x2c, 0x3c,
166*66b13060SEric Biggers 		},
167*66b13060SEric Biggers 	},
168*66b13060SEric Biggers 	{
169*66b13060SEric Biggers 		.data_len = 4128,
170*66b13060SEric Biggers 		.digest = {
171*66b13060SEric Biggers 			0xd0, 0x67, 0x26, 0x0e, 0x22, 0x72, 0xaa, 0x63,
172*66b13060SEric Biggers 			0xfc, 0x34, 0x55, 0x07, 0xab, 0xc8, 0x64, 0xb6,
173*66b13060SEric Biggers 			0xc4, 0xea, 0xd5, 0x7c,
174*66b13060SEric Biggers 		},
175*66b13060SEric Biggers 	},
176*66b13060SEric Biggers 	{
177*66b13060SEric Biggers 		.data_len = 4160,
178*66b13060SEric Biggers 		.digest = {
179*66b13060SEric Biggers 			0x6b, 0xc9, 0x5e, 0xb9, 0x41, 0x19, 0x50, 0x35,
180*66b13060SEric Biggers 			0xf1, 0x39, 0xfe, 0xd9, 0x72, 0x6d, 0xd0, 0x55,
181*66b13060SEric Biggers 			0xb8, 0x1f, 0x1a, 0x95,
182*66b13060SEric Biggers 		},
183*66b13060SEric Biggers 	},
184*66b13060SEric Biggers 	{
185*66b13060SEric Biggers 		.data_len = 4224,
186*66b13060SEric Biggers 		.digest = {
187*66b13060SEric Biggers 			0x70, 0x5d, 0x10, 0x2e, 0x4e, 0x44, 0xc9, 0x80,
188*66b13060SEric Biggers 			0x8f, 0xba, 0x13, 0xbc, 0xd0, 0x77, 0x78, 0xc7,
189*66b13060SEric Biggers 			0x84, 0xe3, 0x24, 0x43,
190*66b13060SEric Biggers 		},
191*66b13060SEric Biggers 	},
192*66b13060SEric Biggers 	{
193*66b13060SEric Biggers 		.data_len = 16384,
194*66b13060SEric Biggers 		.digest = {
195*66b13060SEric Biggers 			0xa8, 0x82, 0xca, 0x08, 0xb4, 0x84, 0x09, 0x13,
196*66b13060SEric Biggers 			0xc0, 0x9c, 0x26, 0x18, 0xcf, 0x0f, 0xf3, 0x08,
197*66b13060SEric Biggers 			0xff, 0xa1, 0xe4, 0x5d,
198*66b13060SEric Biggers 		},
199*66b13060SEric Biggers 	},
200*66b13060SEric Biggers };
201*66b13060SEric Biggers 
202*66b13060SEric Biggers static const u8 hash_testvec_consolidated[SHA1_DIGEST_SIZE] = {
203*66b13060SEric Biggers 	0xe1, 0x72, 0xa5, 0x3c, 0xda, 0xf2, 0xe5, 0x56,
204*66b13060SEric Biggers 	0xb8, 0xb5, 0x35, 0x6e, 0xce, 0xc8, 0x37, 0x57,
205*66b13060SEric Biggers 	0x31, 0xb4, 0x05, 0xdd,
206*66b13060SEric Biggers };
207*66b13060SEric Biggers 
208*66b13060SEric Biggers static const u8 hmac_testvec_consolidated[SHA1_DIGEST_SIZE] = {
209*66b13060SEric Biggers 	0x9d, 0xe5, 0xb1, 0x43, 0x97, 0x95, 0x16, 0x52,
210*66b13060SEric Biggers 	0xa0, 0x7a, 0xc0, 0xe2, 0xc1, 0x60, 0x64, 0x7c,
211*66b13060SEric Biggers 	0x24, 0xf9, 0x34, 0xd7,
212*66b13060SEric Biggers };
213