forked from briansmith/ring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathed25519_from_pkcs8_tests.txt
256 lines (215 loc) · 14.4 KB
/
ed25519_from_pkcs8_tests.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# v1. An Ed25519 private key. (This is from BoringSSL's tests.)
Input = 302e020100300506032b6570042204209d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = OK
Public = d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a
# v1. The same as the above, but with an invalid NULL parameter. (This is from BoringSSL's tests.)
Input = 3030020100300706032b65700500042204209d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60
Result-Checked = WrongAlgorithm
Result-Maybe-Unchecked = WrongAlgorithm
# v1. Example private key from RFC 8410 Section 10.3.
Input = 302e020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# v2. Example private key from RFC 8410 Section 10.3.
Input = 3072020101300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c652043686169727381210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# v2. The v2 example from the RFC, without the attributes [0], but retaining
# the public key [1].
Input = 3051020101300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f4475584281210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# v2. The v2 example from the RFC, retaining the attributes [0], but without
# the public key [1].
Input = 304f020101300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c6520436861697273
Result-Checked = PublicKeyIsMissing
Result-Maybe-Unchecked = PublicKeyIsMissing
# v2. The v2 example from the RFC, without the attributes [0] or the public key [1].
Input = 302e020101300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842
Result-Checked = PublicKeyIsMissing
Result-Maybe-Unchecked = PublicKeyIsMissing
# The v2 example from the RFC, encoded with version v1. Invalid because the
# public key is a v2-only attribute.
Input = 3072020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c652043686169727381210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = InvalidEncoding
# The v2 example from the RFC, without the attributes [0], but retaining the
# public key [1], encoded with version v1. Invalid because the public key is a
# v2-only attribute.
Input = 3051020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f4475584281210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = InvalidEncoding
# The v2 example from the RFC, retaining the attributes [0], but without the
# public key [1], encoded as v1.
Input = 304f020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c6520436861697273
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# v1. valid except it includes publicKey.
Input = 3051020100300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a008121001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = InvalidEncoding
# v2. The private key ends with a zero byte.
Input = 3051020101300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a008121001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 1aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
# v2. The private key's last byte, zero, is omitted.
Input = 3050020101300506032b65700421041fa22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a8121001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# v2. The private key starts with a zero byte.
Input = 3051020101300506032b65700422042000b1a7c20b2b4ed9c78f3686db82f854734cdc95be51def304d98e0cd30bf49081210063457cd4dfdd0e98a53796265831d46ac6a5a685f2a54c9697a38b2c800d60ba
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 63457cd4dfdd0e98a53796265831d46ac6a5a685f2a54c9697a38b2c800d60ba
# v2. The private key's first byte, zero, is omitted.
Input = 3050020101300506032b65700421041fb1a7c20b2b4ed9c78f3686db82f854734cdc95be51def304d98e0cd30bf49081210063457cd4dfdd0e98a53796265831d46ac6a5a685f2a54c9697a38b2c800d60ba
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# v2. The public key's first byte is zero.
Input = 3051020101300506032b6570042204202dc67de5186d9193021c0b104d9c6ef24bee2bd395ccb5ed5a2db5f37a2fc1f081210000c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c8c
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 00c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c8c
# v2. The public key's first byte, zero, is omitted.
Input = 3050020101300506032b6570042204202dc67de5186d9193021c0b104d9c6ef24bee2bd395ccb5ed5a2db5f37a2fc1f0812000c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c8c
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# v2. The public key's last byte is zero.
Input = 3051020101300506032b657004220420b2579f555a2eabdabac8d46997b1c08fe8ce63858df124efc29c60dfbb86c3498121009d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e400
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 9d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e400
# v2. The public key's last byte, zero, is omitted (valid ASN.1 DER).
Input = 3050020101300506032b657004220420b2579f555a2eabdabac8d46997b1c08fe8ce63858df124efc29c60dfbb86c3498120009d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e4
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# v2. The public key's last byte, zero, has been truncated (invalid ASN.1 DER).
Input = 3051020101300506032b657004220420b2579f555a2eabdabac8d46997b1c08fe8ce63858df124efc29c60dfbb86c3498121009d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e4
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# v2. The public key's high bit has been flipped. Ed25519 public keys don't
# have their high bit masked, so this is wrong.
Input = 3051020101300506032b6570042204202dc67de5186d9193021c0b104d9c6ef24bee2bd395ccb5ed5a2db5f37a2fc1f081210000c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c0c
Result-Checked = InconsistentComponents
Result-Maybe-Unchecked = InconsistentComponents
# v2. Valid except the public key field is missing.
Input = 302e020101300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a00
Result-Checked = PublicKeyIsMissing
Result-Maybe-Unchecked = PublicKeyIsMissing
# v2. Valid except the public key is encoded as [0] IMPLICIT instead of [1] IMPLICIT;
# i.e. the attributes are invalid and the public key is missing.
Input = 3051020101300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a008021001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# The same v2 test vectors as above, but the public key is encoded with the
# wrong [1] EXPLICIT tag instead of [1] IMPLICIT.
# [1] EXPLICIT bug.
# v2. Example private key from RFC 8410 Section 10.3.
Input = 3074020101300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c6520436861697273A12303210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# [1] EXPLICIT bug.
# v2. The v2 example from the RFC, without the attributes [0], but retaining
# the public key [1].
Input = 3053020101300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842A12303210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# [1] EXPLICIT bug.
# The v2 example from the RFC, encoded with version v1. Invalid because the
# public key is a v2-only attribute.
Input = 3072020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c6520436861697273A12303210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# The v2 example from the RFC, without the attributes [0], but retaining the
# public key [1], encoded with version v1. Invalid because the public key is a
# v2-only attribute.
Input = 3051020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842A12303210019bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# The v2 example from the RFC, retaining the attributes [0], but without the
# public key [1], encoded as v1.
Input = 304f020100300506032b657004220420d4ee72dbf913584ad5b6d8f1f769f8ad3afe7c28cbf1d4fbe097a88f44755842a01f301d060a2a864886f70d01090914310f0c0d437572646c6520436861697273
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = OK
Public = 19bf44096984cdfe8541bac167dc3b96c85086aa30b6b6cb0c5c38ad703166e1
# [1] EXPLICIT bug.
# v1. valid except it includes publicKey.
Input = 3053020100300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a00a1230321001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = VersionNotSupported
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# v2. The private key ends with a zero byte.
Input = 3053020101300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a00a1230321001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 1aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
# [1] EXPLICIT bug.
# v2. The private key's last byte, zero, is omitted.
Input = 3052020101300506032b65700421041fa22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749aa1230321001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# v2. The private key starts with a zero byte.
Input = 3053020101300506032b65700422042000b1a7c20b2b4ed9c78f3686db82f854734cdc95be51def304d98e0cd30bf490a12303210063457cd4dfdd0e98a53796265831d46ac6a5a685f2a54c9697a38b2c800d60ba
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 63457cd4dfdd0e98a53796265831d46ac6a5a685f2a54c9697a38b2c800d60ba
# [1] EXPLICIT bug.
# v2. The private key's first byte, zero, is omitted.
Input = 3052020101300506032b65700421041fb1a7c20b2b4ed9c78f3686db82f854734cdc95be51def304d98e0cd30bf490a12303210063457cd4dfdd0e98a53796265831d46ac6a5a685f2a54c9697a38b2c800d60ba
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# v2. The public key's first byte is zero.
Input = 3053020101300506032b6570042204202dc67de5186d9193021c0b104d9c6ef24bee2bd395ccb5ed5a2db5f37a2fc1f0a12303210000c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c8c
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 00c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c8c
# [1] EXPLICIT bug.
# v2. The public key's first byte, zero, is omitted.
Input = 3052020101300506032b6570042204202dc67de5186d9193021c0b104d9c6ef24bee2bd395ccb5ed5a2db5f37a2fc1f0a122032000c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c8c
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# v2. The public key's last byte is zero.
Input = 3053020101300506032b657004220420b2579f555a2eabdabac8d46997b1c08fe8ce63858df124efc29c60dfbb86c349a1230321009d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e400
Result-Checked = OK
Result-Maybe-Unchecked = OK
Public = 9d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e400
# [1] EXPLICIT bug.
# v2. The public key's last byte, zero, is omitted (valid ASN.1 DER).
Input = 3052020101300506032b657004220420b2579f555a2eabdabac8d46997b1c08fe8ce63858df124efc29c60dfbb86c349a1220320009d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e4
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# v2. The public key's last byte, zero, has been truncated (invalid ASN.1 DER).
Input = 3053020101300506032b657004220420b2579f555a2eabdabac8d46997b1c08fe8ce63858df124efc29c60dfbb86c349a1230321009d421270ce2fcc08672c41e427214876245c9b0f14ab671b8bb9d266a492e4
Result-Checked = InvalidEncoding
Result-Maybe-Unchecked = InvalidEncoding
# [1] EXPLICIT bug.
# v2. The public key's high bit has been flipped. Ed25519 public keys don't
# have their high bit masked, so this is wrong.
Input = 3053020101300506032b6570042204202dc67de5186d9193021c0b104d9c6ef24bee2bd395ccb5ed5a2db5f37a2fc1f0a12303210000c17e4d8bbff27c1fb618c23fce988703c7efa3cd590aacac12d3f1e3c90c0c
Result-Checked = InconsistentComponents
Result-Maybe-Unchecked = InconsistentComponents
# [1] EXPLICIT bug.
# v2. Valid except the public key field is missing.
Input = 302e020101300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a00
Result-Checked = PublicKeyIsMissing
Result-Maybe-Unchecked = PublicKeyIsMissing
# [1] EXPLICIT bug.
# v2. Valid except the public key is encoded as [0] EXPLICIT instead of [1]; i.e. the
# attributes are invalid and the public key is missing.
Input = 3053020101300506032b657004220420a22efdb713f0e1600d2a5ce948e321ca3a18137c47f15091a12c7126c1749a00a0230321001aeb8e3ee5ba5afd91113466d19f4ea77fa0feffbd8c5adcb499927f12535f77
Result-Checked = PublicKeyIsMissing
Result-Maybe-Unchecked = PublicKeyIsMissing