1
2
3 package wycheproof
4
5 import "encoding/json"
6 import "fmt"
7 import "reflect"
8 import "unicode/utf8"
9
10 type AeadTestGroup struct {
11
12 IvSize int `json:"ivSize"`
13
14
15 KeySize int `json:"keySize"`
16
17
18 Source Source `json:"source"`
19
20
21 TagSize int `json:"tagSize"`
22
23
24 Tests []AeadTestVector `json:"tests"`
25
26
27 Type AeadTestGroupType `json:"type"`
28 }
29
30 type AeadTestGroupType string
31
32 const AeadTestGroupTypeAeadTest AeadTestGroupType = "AeadTest"
33
34 var enumValues_AeadTestGroupType = []interface{}{
35 "AeadTest",
36 }
37
38
39 func (j *AeadTestGroupType) UnmarshalJSON(value []byte) error {
40 var v string
41 if err := json.Unmarshal(value, &v); err != nil {
42 return err
43 }
44 var ok bool
45 for _, expected := range enumValues_AeadTestGroupType {
46 if reflect.DeepEqual(v, expected) {
47 ok = true
48 break
49 }
50 }
51 if !ok {
52 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_AeadTestGroupType, v)
53 }
54 *j = AeadTestGroupType(v)
55 return nil
56 }
57
58
59 func (j *AeadTestGroup) UnmarshalJSON(value []byte) error {
60 var raw map[string]interface{}
61 if err := json.Unmarshal(value, &raw); err != nil {
62 return err
63 }
64 if _, ok := raw["ivSize"]; raw != nil && !ok {
65 return fmt.Errorf("field ivSize in AeadTestGroup: required")
66 }
67 if _, ok := raw["keySize"]; raw != nil && !ok {
68 return fmt.Errorf("field keySize in AeadTestGroup: required")
69 }
70 if _, ok := raw["source"]; raw != nil && !ok {
71 return fmt.Errorf("field source in AeadTestGroup: required")
72 }
73 if _, ok := raw["tagSize"]; raw != nil && !ok {
74 return fmt.Errorf("field tagSize in AeadTestGroup: required")
75 }
76 if _, ok := raw["tests"]; raw != nil && !ok {
77 return fmt.Errorf("field tests in AeadTestGroup: required")
78 }
79 if _, ok := raw["type"]; raw != nil && !ok {
80 return fmt.Errorf("field type in AeadTestGroup: required")
81 }
82 type Plain AeadTestGroup
83 var plain Plain
84 if err := json.Unmarshal(value, &plain); err != nil {
85 return err
86 }
87 *j = AeadTestGroup(plain)
88 return nil
89 }
90
91 type AeadTestSchemaV1Json struct {
92
93 Algorithm string `json:"algorithm"`
94
95
96 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
97
98
99 Header []string `json:"header"`
100
101
102 Notes Notes `json:"notes"`
103
104
105 NumberOfTests int `json:"numberOfTests"`
106
107
108 Schema AeadTestSchemaV1JsonSchema `json:"schema"`
109
110
111 TestGroups []AeadTestGroup `json:"testGroups"`
112 }
113
114 type AeadTestSchemaV1JsonSchema string
115
116 const AeadTestSchemaV1JsonSchemaAeadTestSchemaV1Json AeadTestSchemaV1JsonSchema = "aead_test_schema_v1.json"
117
118 var enumValues_AeadTestSchemaV1JsonSchema = []interface{}{
119 "aead_test_schema_v1.json",
120 }
121
122
123 func (j *AeadTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
124 var v string
125 if err := json.Unmarshal(value, &v); err != nil {
126 return err
127 }
128 var ok bool
129 for _, expected := range enumValues_AeadTestSchemaV1JsonSchema {
130 if reflect.DeepEqual(v, expected) {
131 ok = true
132 break
133 }
134 }
135 if !ok {
136 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_AeadTestSchemaV1JsonSchema, v)
137 }
138 *j = AeadTestSchemaV1JsonSchema(v)
139 return nil
140 }
141
142
143 func (j *AeadTestSchemaV1Json) UnmarshalJSON(value []byte) error {
144 var raw map[string]interface{}
145 if err := json.Unmarshal(value, &raw); err != nil {
146 return err
147 }
148 if _, ok := raw["algorithm"]; raw != nil && !ok {
149 return fmt.Errorf("field algorithm in AeadTestSchemaV1Json: required")
150 }
151 if _, ok := raw["header"]; raw != nil && !ok {
152 return fmt.Errorf("field header in AeadTestSchemaV1Json: required")
153 }
154 if _, ok := raw["notes"]; raw != nil && !ok {
155 return fmt.Errorf("field notes in AeadTestSchemaV1Json: required")
156 }
157 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
158 return fmt.Errorf("field numberOfTests in AeadTestSchemaV1Json: required")
159 }
160 if _, ok := raw["schema"]; raw != nil && !ok {
161 return fmt.Errorf("field schema in AeadTestSchemaV1Json: required")
162 }
163 if _, ok := raw["testGroups"]; raw != nil && !ok {
164 return fmt.Errorf("field testGroups in AeadTestSchemaV1Json: required")
165 }
166 type Plain AeadTestSchemaV1Json
167 var plain Plain
168 if err := json.Unmarshal(value, &plain); err != nil {
169 return err
170 }
171 *j = AeadTestSchemaV1Json(plain)
172 return nil
173 }
174
175 type AeadTestVector struct {
176
177 Aad string `json:"aad"`
178
179
180 Comment string `json:"comment"`
181
182
183 Ct string `json:"ct"`
184
185
186 Flags []string `json:"flags"`
187
188
189 Iv string `json:"iv"`
190
191
192 Key string `json:"key"`
193
194
195 Msg string `json:"msg"`
196
197
198 Result Result `json:"result"`
199
200
201 Tag string `json:"tag"`
202
203
204 TcId int `json:"tcId"`
205 }
206
207
208 func (j *AeadTestVector) UnmarshalJSON(value []byte) error {
209 var raw map[string]interface{}
210 if err := json.Unmarshal(value, &raw); err != nil {
211 return err
212 }
213 if _, ok := raw["aad"]; raw != nil && !ok {
214 return fmt.Errorf("field aad in AeadTestVector: required")
215 }
216 if _, ok := raw["comment"]; raw != nil && !ok {
217 return fmt.Errorf("field comment in AeadTestVector: required")
218 }
219 if _, ok := raw["ct"]; raw != nil && !ok {
220 return fmt.Errorf("field ct in AeadTestVector: required")
221 }
222 if _, ok := raw["flags"]; raw != nil && !ok {
223 return fmt.Errorf("field flags in AeadTestVector: required")
224 }
225 if _, ok := raw["iv"]; raw != nil && !ok {
226 return fmt.Errorf("field iv in AeadTestVector: required")
227 }
228 if _, ok := raw["key"]; raw != nil && !ok {
229 return fmt.Errorf("field key in AeadTestVector: required")
230 }
231 if _, ok := raw["msg"]; raw != nil && !ok {
232 return fmt.Errorf("field msg in AeadTestVector: required")
233 }
234 if _, ok := raw["result"]; raw != nil && !ok {
235 return fmt.Errorf("field result in AeadTestVector: required")
236 }
237 if _, ok := raw["tag"]; raw != nil && !ok {
238 return fmt.Errorf("field tag in AeadTestVector: required")
239 }
240 if _, ok := raw["tcId"]; raw != nil && !ok {
241 return fmt.Errorf("field tcId in AeadTestVector: required")
242 }
243 type Plain AeadTestVector
244 var plain Plain
245 if err := json.Unmarshal(value, &plain); err != nil {
246 return err
247 }
248 *j = AeadTestVector(plain)
249 return nil
250 }
251
252 type AsnSignatureTestVector struct {
253
254 Comment string `json:"comment"`
255
256
257 Flags []string `json:"flags"`
258
259
260 Msg string `json:"msg"`
261
262
263 Result Result `json:"result"`
264
265
266 Sig string `json:"sig"`
267
268
269 TcId int `json:"tcId"`
270 }
271
272
273 func (j *AsnSignatureTestVector) UnmarshalJSON(value []byte) error {
274 var raw map[string]interface{}
275 if err := json.Unmarshal(value, &raw); err != nil {
276 return err
277 }
278 if _, ok := raw["comment"]; raw != nil && !ok {
279 return fmt.Errorf("field comment in AsnSignatureTestVector: required")
280 }
281 if _, ok := raw["flags"]; raw != nil && !ok {
282 return fmt.Errorf("field flags in AsnSignatureTestVector: required")
283 }
284 if _, ok := raw["msg"]; raw != nil && !ok {
285 return fmt.Errorf("field msg in AsnSignatureTestVector: required")
286 }
287 if _, ok := raw["result"]; raw != nil && !ok {
288 return fmt.Errorf("field result in AsnSignatureTestVector: required")
289 }
290 if _, ok := raw["sig"]; raw != nil && !ok {
291 return fmt.Errorf("field sig in AsnSignatureTestVector: required")
292 }
293 if _, ok := raw["tcId"]; raw != nil && !ok {
294 return fmt.Errorf("field tcId in AsnSignatureTestVector: required")
295 }
296 type Plain AsnSignatureTestVector
297 var plain Plain
298 if err := json.Unmarshal(value, &plain); err != nil {
299 return err
300 }
301 *j = AsnSignatureTestVector(plain)
302 return nil
303 }
304
305 type BlsAggregateVerifySchemaJson struct {
306
307 Algorithm string `json:"algorithm"`
308
309
310 Header []string `json:"header"`
311
312
313 Notes Notes `json:"notes"`
314
315
316 NumberOfTests int `json:"numberOfTests"`
317
318
319 Schema BlsAggregateVerifySchemaJsonSchema `json:"schema"`
320
321
322 TestGroups []BlsAggregateVerifyTestGroup `json:"testGroups"`
323 }
324
325 type BlsAggregateVerifySchemaJsonSchema string
326
327 const BlsAggregateVerifySchemaJsonSchemaBlsAggregateVerifySchemaJson BlsAggregateVerifySchemaJsonSchema = "bls_aggregate_verify_schema.json"
328
329 var enumValues_BlsAggregateVerifySchemaJsonSchema = []interface{}{
330 "bls_aggregate_verify_schema.json",
331 }
332
333
334 func (j *BlsAggregateVerifySchemaJsonSchema) UnmarshalJSON(value []byte) error {
335 var v string
336 if err := json.Unmarshal(value, &v); err != nil {
337 return err
338 }
339 var ok bool
340 for _, expected := range enumValues_BlsAggregateVerifySchemaJsonSchema {
341 if reflect.DeepEqual(v, expected) {
342 ok = true
343 break
344 }
345 }
346 if !ok {
347 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsAggregateVerifySchemaJsonSchema, v)
348 }
349 *j = BlsAggregateVerifySchemaJsonSchema(v)
350 return nil
351 }
352
353
354 func (j *BlsAggregateVerifySchemaJson) UnmarshalJSON(value []byte) error {
355 var raw map[string]interface{}
356 if err := json.Unmarshal(value, &raw); err != nil {
357 return err
358 }
359 if _, ok := raw["algorithm"]; raw != nil && !ok {
360 return fmt.Errorf("field algorithm in BlsAggregateVerifySchemaJson: required")
361 }
362 if _, ok := raw["header"]; raw != nil && !ok {
363 return fmt.Errorf("field header in BlsAggregateVerifySchemaJson: required")
364 }
365 if _, ok := raw["notes"]; raw != nil && !ok {
366 return fmt.Errorf("field notes in BlsAggregateVerifySchemaJson: required")
367 }
368 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
369 return fmt.Errorf("field numberOfTests in BlsAggregateVerifySchemaJson: required")
370 }
371 if _, ok := raw["schema"]; raw != nil && !ok {
372 return fmt.Errorf("field schema in BlsAggregateVerifySchemaJson: required")
373 }
374 if _, ok := raw["testGroups"]; raw != nil && !ok {
375 return fmt.Errorf("field testGroups in BlsAggregateVerifySchemaJson: required")
376 }
377 type Plain BlsAggregateVerifySchemaJson
378 var plain Plain
379 if err := json.Unmarshal(value, &plain); err != nil {
380 return err
381 }
382 *j = BlsAggregateVerifySchemaJson(plain)
383 return nil
384 }
385
386 type BlsAggregateVerifyTestGroup struct {
387
388 Ciphersuite string `json:"ciphersuite"`
389
390
391 Source Source `json:"source"`
392
393
394 Tests []BlsAggregateVerifyTestVector `json:"tests"`
395
396
397 Type BlsAggregateVerifyTestGroupType `json:"type"`
398 }
399
400 type BlsAggregateVerifyTestGroupType string
401
402 const BlsAggregateVerifyTestGroupTypeBlsAggregateVerify BlsAggregateVerifyTestGroupType = "BlsAggregateVerify"
403
404 var enumValues_BlsAggregateVerifyTestGroupType = []interface{}{
405 "BlsAggregateVerify",
406 }
407
408
409 func (j *BlsAggregateVerifyTestGroupType) UnmarshalJSON(value []byte) error {
410 var v string
411 if err := json.Unmarshal(value, &v); err != nil {
412 return err
413 }
414 var ok bool
415 for _, expected := range enumValues_BlsAggregateVerifyTestGroupType {
416 if reflect.DeepEqual(v, expected) {
417 ok = true
418 break
419 }
420 }
421 if !ok {
422 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsAggregateVerifyTestGroupType, v)
423 }
424 *j = BlsAggregateVerifyTestGroupType(v)
425 return nil
426 }
427
428
429 func (j *BlsAggregateVerifyTestGroup) UnmarshalJSON(value []byte) error {
430 var raw map[string]interface{}
431 if err := json.Unmarshal(value, &raw); err != nil {
432 return err
433 }
434 if _, ok := raw["ciphersuite"]; raw != nil && !ok {
435 return fmt.Errorf("field ciphersuite in BlsAggregateVerifyTestGroup: required")
436 }
437 if _, ok := raw["source"]; raw != nil && !ok {
438 return fmt.Errorf("field source in BlsAggregateVerifyTestGroup: required")
439 }
440 if _, ok := raw["tests"]; raw != nil && !ok {
441 return fmt.Errorf("field tests in BlsAggregateVerifyTestGroup: required")
442 }
443 if _, ok := raw["type"]; raw != nil && !ok {
444 return fmt.Errorf("field type in BlsAggregateVerifyTestGroup: required")
445 }
446 type Plain BlsAggregateVerifyTestGroup
447 var plain Plain
448 if err := json.Unmarshal(value, &plain); err != nil {
449 return err
450 }
451 *j = BlsAggregateVerifyTestGroup(plain)
452 return nil
453 }
454
455 type BlsAggregateVerifyTestVector struct {
456
457 Comment string `json:"comment"`
458
459
460 Flags []string `json:"flags"`
461
462
463 Messages []string `json:"messages"`
464
465
466 Pubkeys []string `json:"pubkeys"`
467
468
469 Result Result `json:"result"`
470
471
472 Sig string `json:"sig"`
473
474
475 TcId int `json:"tcId"`
476 }
477
478
479 func (j *BlsAggregateVerifyTestVector) UnmarshalJSON(value []byte) error {
480 var raw map[string]interface{}
481 if err := json.Unmarshal(value, &raw); err != nil {
482 return err
483 }
484 if _, ok := raw["comment"]; raw != nil && !ok {
485 return fmt.Errorf("field comment in BlsAggregateVerifyTestVector: required")
486 }
487 if _, ok := raw["flags"]; raw != nil && !ok {
488 return fmt.Errorf("field flags in BlsAggregateVerifyTestVector: required")
489 }
490 if _, ok := raw["messages"]; raw != nil && !ok {
491 return fmt.Errorf("field messages in BlsAggregateVerifyTestVector: required")
492 }
493 if _, ok := raw["pubkeys"]; raw != nil && !ok {
494 return fmt.Errorf("field pubkeys in BlsAggregateVerifyTestVector: required")
495 }
496 if _, ok := raw["result"]; raw != nil && !ok {
497 return fmt.Errorf("field result in BlsAggregateVerifyTestVector: required")
498 }
499 if _, ok := raw["sig"]; raw != nil && !ok {
500 return fmt.Errorf("field sig in BlsAggregateVerifyTestVector: required")
501 }
502 if _, ok := raw["tcId"]; raw != nil && !ok {
503 return fmt.Errorf("field tcId in BlsAggregateVerifyTestVector: required")
504 }
505 type Plain BlsAggregateVerifyTestVector
506 var plain Plain
507 if err := json.Unmarshal(value, &plain); err != nil {
508 return err
509 }
510 *j = BlsAggregateVerifyTestVector(plain)
511 return nil
512 }
513
514 type BlsHashToG2SchemaJson struct {
515
516 Algorithm string `json:"algorithm"`
517
518
519 Header []string `json:"header"`
520
521
522 Notes Notes `json:"notes"`
523
524
525 NumberOfTests int `json:"numberOfTests"`
526
527
528 Schema BlsHashToG2SchemaJsonSchema `json:"schema"`
529
530
531 TestGroups []BlsHashToG2TestGroup `json:"testGroups"`
532 }
533
534 type BlsHashToG2SchemaJsonSchema string
535
536 const BlsHashToG2SchemaJsonSchemaBlsHashToG2SchemaJson BlsHashToG2SchemaJsonSchema = "bls_hash_to_g2_schema.json"
537
538 var enumValues_BlsHashToG2SchemaJsonSchema = []interface{}{
539 "bls_hash_to_g2_schema.json",
540 }
541
542
543 func (j *BlsHashToG2SchemaJsonSchema) UnmarshalJSON(value []byte) error {
544 var v string
545 if err := json.Unmarshal(value, &v); err != nil {
546 return err
547 }
548 var ok bool
549 for _, expected := range enumValues_BlsHashToG2SchemaJsonSchema {
550 if reflect.DeepEqual(v, expected) {
551 ok = true
552 break
553 }
554 }
555 if !ok {
556 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsHashToG2SchemaJsonSchema, v)
557 }
558 *j = BlsHashToG2SchemaJsonSchema(v)
559 return nil
560 }
561
562
563 func (j *BlsHashToG2SchemaJson) UnmarshalJSON(value []byte) error {
564 var raw map[string]interface{}
565 if err := json.Unmarshal(value, &raw); err != nil {
566 return err
567 }
568 if _, ok := raw["algorithm"]; raw != nil && !ok {
569 return fmt.Errorf("field algorithm in BlsHashToG2SchemaJson: required")
570 }
571 if _, ok := raw["header"]; raw != nil && !ok {
572 return fmt.Errorf("field header in BlsHashToG2SchemaJson: required")
573 }
574 if _, ok := raw["notes"]; raw != nil && !ok {
575 return fmt.Errorf("field notes in BlsHashToG2SchemaJson: required")
576 }
577 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
578 return fmt.Errorf("field numberOfTests in BlsHashToG2SchemaJson: required")
579 }
580 if _, ok := raw["schema"]; raw != nil && !ok {
581 return fmt.Errorf("field schema in BlsHashToG2SchemaJson: required")
582 }
583 if _, ok := raw["testGroups"]; raw != nil && !ok {
584 return fmt.Errorf("field testGroups in BlsHashToG2SchemaJson: required")
585 }
586 type Plain BlsHashToG2SchemaJson
587 var plain Plain
588 if err := json.Unmarshal(value, &plain); err != nil {
589 return err
590 }
591 *j = BlsHashToG2SchemaJson(plain)
592 return nil
593 }
594
595 type BlsHashToG2TestGroup struct {
596
597 Dst string `json:"dst"`
598
599
600 Source Source `json:"source"`
601
602
603 Tests []BlsHashToG2TestVector `json:"tests"`
604
605
606 Type BlsHashToG2TestGroupType `json:"type"`
607 }
608
609 type BlsHashToG2TestGroupType string
610
611 const BlsHashToG2TestGroupTypeBlsHashToG2 BlsHashToG2TestGroupType = "BlsHashToG2"
612
613 var enumValues_BlsHashToG2TestGroupType = []interface{}{
614 "BlsHashToG2",
615 }
616
617
618 func (j *BlsHashToG2TestGroupType) UnmarshalJSON(value []byte) error {
619 var v string
620 if err := json.Unmarshal(value, &v); err != nil {
621 return err
622 }
623 var ok bool
624 for _, expected := range enumValues_BlsHashToG2TestGroupType {
625 if reflect.DeepEqual(v, expected) {
626 ok = true
627 break
628 }
629 }
630 if !ok {
631 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsHashToG2TestGroupType, v)
632 }
633 *j = BlsHashToG2TestGroupType(v)
634 return nil
635 }
636
637
638 func (j *BlsHashToG2TestGroup) UnmarshalJSON(value []byte) error {
639 var raw map[string]interface{}
640 if err := json.Unmarshal(value, &raw); err != nil {
641 return err
642 }
643 if _, ok := raw["dst"]; raw != nil && !ok {
644 return fmt.Errorf("field dst in BlsHashToG2TestGroup: required")
645 }
646 if _, ok := raw["source"]; raw != nil && !ok {
647 return fmt.Errorf("field source in BlsHashToG2TestGroup: required")
648 }
649 if _, ok := raw["tests"]; raw != nil && !ok {
650 return fmt.Errorf("field tests in BlsHashToG2TestGroup: required")
651 }
652 if _, ok := raw["type"]; raw != nil && !ok {
653 return fmt.Errorf("field type in BlsHashToG2TestGroup: required")
654 }
655 type Plain BlsHashToG2TestGroup
656 var plain Plain
657 if err := json.Unmarshal(value, &plain); err != nil {
658 return err
659 }
660 *j = BlsHashToG2TestGroup(plain)
661 return nil
662 }
663
664 type BlsHashToG2TestVector struct {
665
666 Comment string `json:"comment"`
667
668
669 Expected string `json:"expected"`
670
671
672 Flags []string `json:"flags"`
673
674
675 Msg string `json:"msg"`
676
677
678 Result Result `json:"result"`
679
680
681 TcId int `json:"tcId"`
682 }
683
684
685 func (j *BlsHashToG2TestVector) UnmarshalJSON(value []byte) error {
686 var raw map[string]interface{}
687 if err := json.Unmarshal(value, &raw); err != nil {
688 return err
689 }
690 if _, ok := raw["comment"]; raw != nil && !ok {
691 return fmt.Errorf("field comment in BlsHashToG2TestVector: required")
692 }
693 if _, ok := raw["expected"]; raw != nil && !ok {
694 return fmt.Errorf("field expected in BlsHashToG2TestVector: required")
695 }
696 if _, ok := raw["flags"]; raw != nil && !ok {
697 return fmt.Errorf("field flags in BlsHashToG2TestVector: required")
698 }
699 if _, ok := raw["msg"]; raw != nil && !ok {
700 return fmt.Errorf("field msg in BlsHashToG2TestVector: required")
701 }
702 if _, ok := raw["result"]; raw != nil && !ok {
703 return fmt.Errorf("field result in BlsHashToG2TestVector: required")
704 }
705 if _, ok := raw["tcId"]; raw != nil && !ok {
706 return fmt.Errorf("field tcId in BlsHashToG2TestVector: required")
707 }
708 type Plain BlsHashToG2TestVector
709 var plain Plain
710 if err := json.Unmarshal(value, &plain); err != nil {
711 return err
712 }
713 *j = BlsHashToG2TestVector(plain)
714 return nil
715 }
716
717 type BlsPublicKey struct {
718
719 Group BlsPublicKeyGroup `json:"group"`
720
721
722 KeySize int `json:"keySize"`
723
724
725 Pk string `json:"pk"`
726 }
727
728 type BlsPublicKeyGroup string
729
730 const BlsPublicKeyGroupG1 BlsPublicKeyGroup = "G1"
731 const BlsPublicKeyGroupG2 BlsPublicKeyGroup = "G2"
732
733 var enumValues_BlsPublicKeyGroup = []interface{}{
734 "G1",
735 "G2",
736 }
737
738
739 func (j *BlsPublicKeyGroup) UnmarshalJSON(value []byte) error {
740 var v string
741 if err := json.Unmarshal(value, &v); err != nil {
742 return err
743 }
744 var ok bool
745 for _, expected := range enumValues_BlsPublicKeyGroup {
746 if reflect.DeepEqual(v, expected) {
747 ok = true
748 break
749 }
750 }
751 if !ok {
752 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsPublicKeyGroup, v)
753 }
754 *j = BlsPublicKeyGroup(v)
755 return nil
756 }
757
758
759 func (j *BlsPublicKey) UnmarshalJSON(value []byte) error {
760 var raw map[string]interface{}
761 if err := json.Unmarshal(value, &raw); err != nil {
762 return err
763 }
764 if _, ok := raw["group"]; raw != nil && !ok {
765 return fmt.Errorf("field group in BlsPublicKey: required")
766 }
767 if _, ok := raw["keySize"]; raw != nil && !ok {
768 return fmt.Errorf("field keySize in BlsPublicKey: required")
769 }
770 if _, ok := raw["pk"]; raw != nil && !ok {
771 return fmt.Errorf("field pk in BlsPublicKey: required")
772 }
773 type Plain BlsPublicKey
774 var plain Plain
775 if err := json.Unmarshal(value, &plain); err != nil {
776 return err
777 }
778 *j = BlsPublicKey(plain)
779 return nil
780 }
781
782 type BlsSigVerifySchemaJson struct {
783
784 Algorithm string `json:"algorithm"`
785
786
787 Header []string `json:"header"`
788
789
790 Notes Notes `json:"notes"`
791
792
793 NumberOfTests int `json:"numberOfTests"`
794
795
796 Schema BlsSigVerifySchemaJsonSchema `json:"schema"`
797
798
799 TestGroups []BlsSigVerifyTestGroup `json:"testGroups"`
800 }
801
802 type BlsSigVerifySchemaJsonSchema string
803
804 const BlsSigVerifySchemaJsonSchemaBlsSigVerifySchemaJson BlsSigVerifySchemaJsonSchema = "bls_sig_verify_schema.json"
805
806 var enumValues_BlsSigVerifySchemaJsonSchema = []interface{}{
807 "bls_sig_verify_schema.json",
808 }
809
810
811 func (j *BlsSigVerifySchemaJsonSchema) UnmarshalJSON(value []byte) error {
812 var v string
813 if err := json.Unmarshal(value, &v); err != nil {
814 return err
815 }
816 var ok bool
817 for _, expected := range enumValues_BlsSigVerifySchemaJsonSchema {
818 if reflect.DeepEqual(v, expected) {
819 ok = true
820 break
821 }
822 }
823 if !ok {
824 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsSigVerifySchemaJsonSchema, v)
825 }
826 *j = BlsSigVerifySchemaJsonSchema(v)
827 return nil
828 }
829
830
831 func (j *BlsSigVerifySchemaJson) UnmarshalJSON(value []byte) error {
832 var raw map[string]interface{}
833 if err := json.Unmarshal(value, &raw); err != nil {
834 return err
835 }
836 if _, ok := raw["algorithm"]; raw != nil && !ok {
837 return fmt.Errorf("field algorithm in BlsSigVerifySchemaJson: required")
838 }
839 if _, ok := raw["header"]; raw != nil && !ok {
840 return fmt.Errorf("field header in BlsSigVerifySchemaJson: required")
841 }
842 if _, ok := raw["notes"]; raw != nil && !ok {
843 return fmt.Errorf("field notes in BlsSigVerifySchemaJson: required")
844 }
845 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
846 return fmt.Errorf("field numberOfTests in BlsSigVerifySchemaJson: required")
847 }
848 if _, ok := raw["schema"]; raw != nil && !ok {
849 return fmt.Errorf("field schema in BlsSigVerifySchemaJson: required")
850 }
851 if _, ok := raw["testGroups"]; raw != nil && !ok {
852 return fmt.Errorf("field testGroups in BlsSigVerifySchemaJson: required")
853 }
854 type Plain BlsSigVerifySchemaJson
855 var plain Plain
856 if err := json.Unmarshal(value, &plain); err != nil {
857 return err
858 }
859 *j = BlsSigVerifySchemaJson(plain)
860 return nil
861 }
862
863 type BlsSigVerifyTestGroup struct {
864
865
866 Ciphersuite string `json:"ciphersuite"`
867
868
869 PublicKey BlsPublicKey `json:"publicKey"`
870
871
872 Source Source `json:"source"`
873
874
875 Tests []SignatureTestVector `json:"tests"`
876
877
878 Type BlsSigVerifyTestGroupType `json:"type"`
879 }
880
881 type BlsSigVerifyTestGroupType string
882
883 const BlsSigVerifyTestGroupTypeBlsSigVerify BlsSigVerifyTestGroupType = "BlsSigVerify"
884
885 var enumValues_BlsSigVerifyTestGroupType = []interface{}{
886 "BlsSigVerify",
887 }
888
889
890 func (j *BlsSigVerifyTestGroupType) UnmarshalJSON(value []byte) error {
891 var v string
892 if err := json.Unmarshal(value, &v); err != nil {
893 return err
894 }
895 var ok bool
896 for _, expected := range enumValues_BlsSigVerifyTestGroupType {
897 if reflect.DeepEqual(v, expected) {
898 ok = true
899 break
900 }
901 }
902 if !ok {
903 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BlsSigVerifyTestGroupType, v)
904 }
905 *j = BlsSigVerifyTestGroupType(v)
906 return nil
907 }
908
909
910 func (j *BlsSigVerifyTestGroup) UnmarshalJSON(value []byte) error {
911 var raw map[string]interface{}
912 if err := json.Unmarshal(value, &raw); err != nil {
913 return err
914 }
915 if _, ok := raw["ciphersuite"]; raw != nil && !ok {
916 return fmt.Errorf("field ciphersuite in BlsSigVerifyTestGroup: required")
917 }
918 if _, ok := raw["publicKey"]; raw != nil && !ok {
919 return fmt.Errorf("field publicKey in BlsSigVerifyTestGroup: required")
920 }
921 if _, ok := raw["source"]; raw != nil && !ok {
922 return fmt.Errorf("field source in BlsSigVerifyTestGroup: required")
923 }
924 if _, ok := raw["tests"]; raw != nil && !ok {
925 return fmt.Errorf("field tests in BlsSigVerifyTestGroup: required")
926 }
927 if _, ok := raw["type"]; raw != nil && !ok {
928 return fmt.Errorf("field type in BlsSigVerifyTestGroup: required")
929 }
930 type Plain BlsSigVerifyTestGroup
931 var plain Plain
932 if err := json.Unmarshal(value, &plain); err != nil {
933 return err
934 }
935 *j = BlsSigVerifyTestGroup(plain)
936 return nil
937 }
938
939 type DaeadTestGroup struct {
940
941 KeySize int `json:"keySize"`
942
943
944 Source Source `json:"source"`
945
946
947 Tests []DaeadTestVector `json:"tests"`
948
949
950 Type DaeadTestGroupType `json:"type"`
951 }
952
953 type DaeadTestGroupType string
954
955 const DaeadTestGroupTypeDaeadTest DaeadTestGroupType = "DaeadTest"
956
957 var enumValues_DaeadTestGroupType = []interface{}{
958 "DaeadTest",
959 }
960
961
962 func (j *DaeadTestGroupType) UnmarshalJSON(value []byte) error {
963 var v string
964 if err := json.Unmarshal(value, &v); err != nil {
965 return err
966 }
967 var ok bool
968 for _, expected := range enumValues_DaeadTestGroupType {
969 if reflect.DeepEqual(v, expected) {
970 ok = true
971 break
972 }
973 }
974 if !ok {
975 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DaeadTestGroupType, v)
976 }
977 *j = DaeadTestGroupType(v)
978 return nil
979 }
980
981
982 func (j *DaeadTestGroup) UnmarshalJSON(value []byte) error {
983 var raw map[string]interface{}
984 if err := json.Unmarshal(value, &raw); err != nil {
985 return err
986 }
987 if _, ok := raw["keySize"]; raw != nil && !ok {
988 return fmt.Errorf("field keySize in DaeadTestGroup: required")
989 }
990 if _, ok := raw["source"]; raw != nil && !ok {
991 return fmt.Errorf("field source in DaeadTestGroup: required")
992 }
993 if _, ok := raw["tests"]; raw != nil && !ok {
994 return fmt.Errorf("field tests in DaeadTestGroup: required")
995 }
996 if _, ok := raw["type"]; raw != nil && !ok {
997 return fmt.Errorf("field type in DaeadTestGroup: required")
998 }
999 type Plain DaeadTestGroup
1000 var plain Plain
1001 if err := json.Unmarshal(value, &plain); err != nil {
1002 return err
1003 }
1004 *j = DaeadTestGroup(plain)
1005 return nil
1006 }
1007
1008 type DaeadTestSchemaV1Json struct {
1009
1010 Algorithm string `json:"algorithm"`
1011
1012
1013 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
1014
1015
1016 Header []string `json:"header"`
1017
1018
1019 Notes Notes `json:"notes"`
1020
1021
1022 NumberOfTests int `json:"numberOfTests"`
1023
1024
1025 Schema DaeadTestSchemaV1JsonSchema `json:"schema"`
1026
1027
1028 TestGroups []DaeadTestGroup `json:"testGroups"`
1029 }
1030
1031 type DaeadTestSchemaV1JsonSchema string
1032
1033 const DaeadTestSchemaV1JsonSchemaDaeadTestSchemaV1Json DaeadTestSchemaV1JsonSchema = "daead_test_schema_v1.json"
1034
1035 var enumValues_DaeadTestSchemaV1JsonSchema = []interface{}{
1036 "daead_test_schema_v1.json",
1037 }
1038
1039
1040 func (j *DaeadTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
1041 var v string
1042 if err := json.Unmarshal(value, &v); err != nil {
1043 return err
1044 }
1045 var ok bool
1046 for _, expected := range enumValues_DaeadTestSchemaV1JsonSchema {
1047 if reflect.DeepEqual(v, expected) {
1048 ok = true
1049 break
1050 }
1051 }
1052 if !ok {
1053 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DaeadTestSchemaV1JsonSchema, v)
1054 }
1055 *j = DaeadTestSchemaV1JsonSchema(v)
1056 return nil
1057 }
1058
1059
1060 func (j *DaeadTestSchemaV1Json) UnmarshalJSON(value []byte) error {
1061 var raw map[string]interface{}
1062 if err := json.Unmarshal(value, &raw); err != nil {
1063 return err
1064 }
1065 if _, ok := raw["algorithm"]; raw != nil && !ok {
1066 return fmt.Errorf("field algorithm in DaeadTestSchemaV1Json: required")
1067 }
1068 if _, ok := raw["header"]; raw != nil && !ok {
1069 return fmt.Errorf("field header in DaeadTestSchemaV1Json: required")
1070 }
1071 if _, ok := raw["notes"]; raw != nil && !ok {
1072 return fmt.Errorf("field notes in DaeadTestSchemaV1Json: required")
1073 }
1074 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
1075 return fmt.Errorf("field numberOfTests in DaeadTestSchemaV1Json: required")
1076 }
1077 if _, ok := raw["schema"]; raw != nil && !ok {
1078 return fmt.Errorf("field schema in DaeadTestSchemaV1Json: required")
1079 }
1080 if _, ok := raw["testGroups"]; raw != nil && !ok {
1081 return fmt.Errorf("field testGroups in DaeadTestSchemaV1Json: required")
1082 }
1083 type Plain DaeadTestSchemaV1Json
1084 var plain Plain
1085 if err := json.Unmarshal(value, &plain); err != nil {
1086 return err
1087 }
1088 *j = DaeadTestSchemaV1Json(plain)
1089 return nil
1090 }
1091
1092 type DaeadTestVector struct {
1093
1094 Aad string `json:"aad"`
1095
1096
1097 Comment string `json:"comment"`
1098
1099
1100 Ct string `json:"ct"`
1101
1102
1103 Flags []string `json:"flags,omitempty,omitzero"`
1104
1105
1106 Key string `json:"key"`
1107
1108
1109 Msg string `json:"msg"`
1110
1111
1112 Result Result `json:"result"`
1113
1114
1115 TcId int `json:"tcId"`
1116 }
1117
1118
1119 func (j *DaeadTestVector) UnmarshalJSON(value []byte) error {
1120 var raw map[string]interface{}
1121 if err := json.Unmarshal(value, &raw); err != nil {
1122 return err
1123 }
1124 if _, ok := raw["aad"]; raw != nil && !ok {
1125 return fmt.Errorf("field aad in DaeadTestVector: required")
1126 }
1127 if _, ok := raw["comment"]; raw != nil && !ok {
1128 return fmt.Errorf("field comment in DaeadTestVector: required")
1129 }
1130 if _, ok := raw["ct"]; raw != nil && !ok {
1131 return fmt.Errorf("field ct in DaeadTestVector: required")
1132 }
1133 if _, ok := raw["key"]; raw != nil && !ok {
1134 return fmt.Errorf("field key in DaeadTestVector: required")
1135 }
1136 if _, ok := raw["msg"]; raw != nil && !ok {
1137 return fmt.Errorf("field msg in DaeadTestVector: required")
1138 }
1139 if _, ok := raw["result"]; raw != nil && !ok {
1140 return fmt.Errorf("field result in DaeadTestVector: required")
1141 }
1142 if _, ok := raw["tcId"]; raw != nil && !ok {
1143 return fmt.Errorf("field tcId in DaeadTestVector: required")
1144 }
1145 type Plain DaeadTestVector
1146 var plain Plain
1147 if err := json.Unmarshal(value, &plain); err != nil {
1148 return err
1149 }
1150 *j = DaeadTestVector(plain)
1151 return nil
1152 }
1153
1154 type DsaP1363TestGroup struct {
1155
1156 PublicKey DsaPublicKey `json:"publicKey"`
1157
1158
1159 PublicKeyDer string `json:"publicKeyDer"`
1160
1161
1162 PublicKeyPem string `json:"publicKeyPem"`
1163
1164
1165 Sha string `json:"sha"`
1166
1167
1168 Source Source `json:"source"`
1169
1170
1171 Tests []SignatureTestVector `json:"tests"`
1172
1173
1174 Type DsaP1363TestGroupType `json:"type"`
1175 }
1176
1177 type DsaP1363TestGroupType string
1178
1179 const DsaP1363TestGroupTypeDsaP1363Verify DsaP1363TestGroupType = "DsaP1363Verify"
1180
1181 var enumValues_DsaP1363TestGroupType = []interface{}{
1182 "DsaP1363Verify",
1183 }
1184
1185
1186 func (j *DsaP1363TestGroupType) UnmarshalJSON(value []byte) error {
1187 var v string
1188 if err := json.Unmarshal(value, &v); err != nil {
1189 return err
1190 }
1191 var ok bool
1192 for _, expected := range enumValues_DsaP1363TestGroupType {
1193 if reflect.DeepEqual(v, expected) {
1194 ok = true
1195 break
1196 }
1197 }
1198 if !ok {
1199 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DsaP1363TestGroupType, v)
1200 }
1201 *j = DsaP1363TestGroupType(v)
1202 return nil
1203 }
1204
1205
1206 func (j *DsaP1363TestGroup) UnmarshalJSON(value []byte) error {
1207 var raw map[string]interface{}
1208 if err := json.Unmarshal(value, &raw); err != nil {
1209 return err
1210 }
1211 if _, ok := raw["publicKey"]; raw != nil && !ok {
1212 return fmt.Errorf("field publicKey in DsaP1363TestGroup: required")
1213 }
1214 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
1215 return fmt.Errorf("field publicKeyDer in DsaP1363TestGroup: required")
1216 }
1217 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
1218 return fmt.Errorf("field publicKeyPem in DsaP1363TestGroup: required")
1219 }
1220 if _, ok := raw["sha"]; raw != nil && !ok {
1221 return fmt.Errorf("field sha in DsaP1363TestGroup: required")
1222 }
1223 if _, ok := raw["source"]; raw != nil && !ok {
1224 return fmt.Errorf("field source in DsaP1363TestGroup: required")
1225 }
1226 if _, ok := raw["tests"]; raw != nil && !ok {
1227 return fmt.Errorf("field tests in DsaP1363TestGroup: required")
1228 }
1229 if _, ok := raw["type"]; raw != nil && !ok {
1230 return fmt.Errorf("field type in DsaP1363TestGroup: required")
1231 }
1232 type Plain DsaP1363TestGroup
1233 var plain Plain
1234 if err := json.Unmarshal(value, &plain); err != nil {
1235 return err
1236 }
1237 *j = DsaP1363TestGroup(plain)
1238 return nil
1239 }
1240
1241 type DsaP1363VerifySchemaV1Json struct {
1242
1243 Algorithm string `json:"algorithm"`
1244
1245
1246 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
1247
1248
1249 Header []string `json:"header"`
1250
1251
1252 Notes Notes `json:"notes"`
1253
1254
1255 NumberOfTests int `json:"numberOfTests"`
1256
1257
1258 Schema DsaP1363VerifySchemaV1JsonSchema `json:"schema"`
1259
1260
1261 TestGroups []DsaP1363TestGroup `json:"testGroups"`
1262 }
1263
1264 type DsaP1363VerifySchemaV1JsonSchema string
1265
1266 const DsaP1363VerifySchemaV1JsonSchemaDsaP1363VerifySchemaV1Json DsaP1363VerifySchemaV1JsonSchema = "dsa_p1363_verify_schema_v1.json"
1267
1268 var enumValues_DsaP1363VerifySchemaV1JsonSchema = []interface{}{
1269 "dsa_p1363_verify_schema_v1.json",
1270 }
1271
1272
1273 func (j *DsaP1363VerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
1274 var v string
1275 if err := json.Unmarshal(value, &v); err != nil {
1276 return err
1277 }
1278 var ok bool
1279 for _, expected := range enumValues_DsaP1363VerifySchemaV1JsonSchema {
1280 if reflect.DeepEqual(v, expected) {
1281 ok = true
1282 break
1283 }
1284 }
1285 if !ok {
1286 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DsaP1363VerifySchemaV1JsonSchema, v)
1287 }
1288 *j = DsaP1363VerifySchemaV1JsonSchema(v)
1289 return nil
1290 }
1291
1292
1293 func (j *DsaP1363VerifySchemaV1Json) UnmarshalJSON(value []byte) error {
1294 var raw map[string]interface{}
1295 if err := json.Unmarshal(value, &raw); err != nil {
1296 return err
1297 }
1298 if _, ok := raw["algorithm"]; raw != nil && !ok {
1299 return fmt.Errorf("field algorithm in DsaP1363VerifySchemaV1Json: required")
1300 }
1301 if _, ok := raw["header"]; raw != nil && !ok {
1302 return fmt.Errorf("field header in DsaP1363VerifySchemaV1Json: required")
1303 }
1304 if _, ok := raw["notes"]; raw != nil && !ok {
1305 return fmt.Errorf("field notes in DsaP1363VerifySchemaV1Json: required")
1306 }
1307 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
1308 return fmt.Errorf("field numberOfTests in DsaP1363VerifySchemaV1Json: required")
1309 }
1310 if _, ok := raw["schema"]; raw != nil && !ok {
1311 return fmt.Errorf("field schema in DsaP1363VerifySchemaV1Json: required")
1312 }
1313 if _, ok := raw["testGroups"]; raw != nil && !ok {
1314 return fmt.Errorf("field testGroups in DsaP1363VerifySchemaV1Json: required")
1315 }
1316 type Plain DsaP1363VerifySchemaV1Json
1317 var plain Plain
1318 if err := json.Unmarshal(value, &plain); err != nil {
1319 return err
1320 }
1321 *j = DsaP1363VerifySchemaV1Json(plain)
1322 return nil
1323 }
1324
1325 type DsaPublicKey struct {
1326
1327 G string `json:"g"`
1328
1329
1330 KeySize int `json:"keySize"`
1331
1332
1333 P string `json:"p"`
1334
1335
1336 Q string `json:"q"`
1337
1338
1339 Type DsaPublicKeyType `json:"type"`
1340
1341
1342 Y string `json:"y"`
1343 }
1344
1345 type DsaPublicKeyType string
1346
1347 const DsaPublicKeyTypeDsaPublicKey DsaPublicKeyType = "DsaPublicKey"
1348
1349 var enumValues_DsaPublicKeyType = []interface{}{
1350 "DsaPublicKey",
1351 }
1352
1353
1354 func (j *DsaPublicKeyType) UnmarshalJSON(value []byte) error {
1355 var v string
1356 if err := json.Unmarshal(value, &v); err != nil {
1357 return err
1358 }
1359 var ok bool
1360 for _, expected := range enumValues_DsaPublicKeyType {
1361 if reflect.DeepEqual(v, expected) {
1362 ok = true
1363 break
1364 }
1365 }
1366 if !ok {
1367 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DsaPublicKeyType, v)
1368 }
1369 *j = DsaPublicKeyType(v)
1370 return nil
1371 }
1372
1373
1374 func (j *DsaPublicKey) UnmarshalJSON(value []byte) error {
1375 var raw map[string]interface{}
1376 if err := json.Unmarshal(value, &raw); err != nil {
1377 return err
1378 }
1379 if _, ok := raw["g"]; raw != nil && !ok {
1380 return fmt.Errorf("field g in DsaPublicKey: required")
1381 }
1382 if _, ok := raw["keySize"]; raw != nil && !ok {
1383 return fmt.Errorf("field keySize in DsaPublicKey: required")
1384 }
1385 if _, ok := raw["p"]; raw != nil && !ok {
1386 return fmt.Errorf("field p in DsaPublicKey: required")
1387 }
1388 if _, ok := raw["q"]; raw != nil && !ok {
1389 return fmt.Errorf("field q in DsaPublicKey: required")
1390 }
1391 if _, ok := raw["type"]; raw != nil && !ok {
1392 return fmt.Errorf("field type in DsaPublicKey: required")
1393 }
1394 if _, ok := raw["y"]; raw != nil && !ok {
1395 return fmt.Errorf("field y in DsaPublicKey: required")
1396 }
1397 type Plain DsaPublicKey
1398 var plain Plain
1399 if err := json.Unmarshal(value, &plain); err != nil {
1400 return err
1401 }
1402 *j = DsaPublicKey(plain)
1403 return nil
1404 }
1405
1406 type DsaTestGroup struct {
1407
1408 PublicKey DsaPublicKey `json:"publicKey"`
1409
1410
1411 PublicKeyDer string `json:"publicKeyDer"`
1412
1413
1414 PublicKeyPem string `json:"publicKeyPem"`
1415
1416
1417 Sha string `json:"sha"`
1418
1419
1420 Source Source `json:"source"`
1421
1422
1423 Tests []AsnSignatureTestVector `json:"tests"`
1424
1425
1426 Type DsaTestGroupType `json:"type"`
1427 }
1428
1429 type DsaTestGroupType string
1430
1431 const DsaTestGroupTypeDsaVerify DsaTestGroupType = "DsaVerify"
1432
1433 var enumValues_DsaTestGroupType = []interface{}{
1434 "DsaVerify",
1435 }
1436
1437
1438 func (j *DsaTestGroupType) UnmarshalJSON(value []byte) error {
1439 var v string
1440 if err := json.Unmarshal(value, &v); err != nil {
1441 return err
1442 }
1443 var ok bool
1444 for _, expected := range enumValues_DsaTestGroupType {
1445 if reflect.DeepEqual(v, expected) {
1446 ok = true
1447 break
1448 }
1449 }
1450 if !ok {
1451 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DsaTestGroupType, v)
1452 }
1453 *j = DsaTestGroupType(v)
1454 return nil
1455 }
1456
1457
1458 func (j *DsaTestGroup) UnmarshalJSON(value []byte) error {
1459 var raw map[string]interface{}
1460 if err := json.Unmarshal(value, &raw); err != nil {
1461 return err
1462 }
1463 if _, ok := raw["publicKey"]; raw != nil && !ok {
1464 return fmt.Errorf("field publicKey in DsaTestGroup: required")
1465 }
1466 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
1467 return fmt.Errorf("field publicKeyDer in DsaTestGroup: required")
1468 }
1469 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
1470 return fmt.Errorf("field publicKeyPem in DsaTestGroup: required")
1471 }
1472 if _, ok := raw["sha"]; raw != nil && !ok {
1473 return fmt.Errorf("field sha in DsaTestGroup: required")
1474 }
1475 if _, ok := raw["source"]; raw != nil && !ok {
1476 return fmt.Errorf("field source in DsaTestGroup: required")
1477 }
1478 if _, ok := raw["tests"]; raw != nil && !ok {
1479 return fmt.Errorf("field tests in DsaTestGroup: required")
1480 }
1481 if _, ok := raw["type"]; raw != nil && !ok {
1482 return fmt.Errorf("field type in DsaTestGroup: required")
1483 }
1484 type Plain DsaTestGroup
1485 var plain Plain
1486 if err := json.Unmarshal(value, &plain); err != nil {
1487 return err
1488 }
1489 *j = DsaTestGroup(plain)
1490 return nil
1491 }
1492
1493 type DsaVerifySchemaV1Json struct {
1494
1495 Algorithm string `json:"algorithm"`
1496
1497
1498 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
1499
1500
1501 Header []string `json:"header"`
1502
1503
1504 Notes Notes `json:"notes"`
1505
1506
1507 NumberOfTests int `json:"numberOfTests"`
1508
1509
1510 Schema DsaVerifySchemaV1JsonSchema `json:"schema"`
1511
1512
1513 TestGroups []DsaTestGroup `json:"testGroups"`
1514 }
1515
1516 type DsaVerifySchemaV1JsonSchema string
1517
1518 const DsaVerifySchemaV1JsonSchemaDsaVerifySchemaV1Json DsaVerifySchemaV1JsonSchema = "dsa_verify_schema_v1.json"
1519
1520 var enumValues_DsaVerifySchemaV1JsonSchema = []interface{}{
1521 "dsa_verify_schema_v1.json",
1522 }
1523
1524
1525 func (j *DsaVerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
1526 var v string
1527 if err := json.Unmarshal(value, &v); err != nil {
1528 return err
1529 }
1530 var ok bool
1531 for _, expected := range enumValues_DsaVerifySchemaV1JsonSchema {
1532 if reflect.DeepEqual(v, expected) {
1533 ok = true
1534 break
1535 }
1536 }
1537 if !ok {
1538 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_DsaVerifySchemaV1JsonSchema, v)
1539 }
1540 *j = DsaVerifySchemaV1JsonSchema(v)
1541 return nil
1542 }
1543
1544
1545 func (j *DsaVerifySchemaV1Json) UnmarshalJSON(value []byte) error {
1546 var raw map[string]interface{}
1547 if err := json.Unmarshal(value, &raw); err != nil {
1548 return err
1549 }
1550 if _, ok := raw["algorithm"]; raw != nil && !ok {
1551 return fmt.Errorf("field algorithm in DsaVerifySchemaV1Json: required")
1552 }
1553 if _, ok := raw["header"]; raw != nil && !ok {
1554 return fmt.Errorf("field header in DsaVerifySchemaV1Json: required")
1555 }
1556 if _, ok := raw["notes"]; raw != nil && !ok {
1557 return fmt.Errorf("field notes in DsaVerifySchemaV1Json: required")
1558 }
1559 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
1560 return fmt.Errorf("field numberOfTests in DsaVerifySchemaV1Json: required")
1561 }
1562 if _, ok := raw["schema"]; raw != nil && !ok {
1563 return fmt.Errorf("field schema in DsaVerifySchemaV1Json: required")
1564 }
1565 if _, ok := raw["testGroups"]; raw != nil && !ok {
1566 return fmt.Errorf("field testGroups in DsaVerifySchemaV1Json: required")
1567 }
1568 type Plain DsaVerifySchemaV1Json
1569 var plain Plain
1570 if err := json.Unmarshal(value, &plain); err != nil {
1571 return err
1572 }
1573 *j = DsaVerifySchemaV1Json(plain)
1574 return nil
1575 }
1576
1577
1578 type EcCurveTest struct {
1579
1580 Source Source `json:"source"`
1581
1582
1583 Tests []EcCurveTestTestsElem `json:"tests"`
1584
1585
1586 Type EcCurveTestType `json:"type"`
1587 }
1588
1589 type EcCurveTestSchemaJson struct {
1590
1591 Algorithm EcCurveTestSchemaJsonAlgorithm `json:"algorithm"`
1592
1593
1594 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
1595
1596
1597 Header []string `json:"header"`
1598
1599
1600 Notes Notes `json:"notes"`
1601
1602
1603 NumberOfTests int `json:"numberOfTests"`
1604
1605
1606 Schema EcCurveTestSchemaJsonSchema `json:"schema"`
1607
1608
1609 TestGroups []EcCurveTest `json:"testGroups"`
1610 }
1611
1612 type EcCurveTestSchemaJsonAlgorithm string
1613
1614 const EcCurveTestSchemaJsonAlgorithmEcCurveTest EcCurveTestSchemaJsonAlgorithm = "EcCurveTest"
1615
1616 var enumValues_EcCurveTestSchemaJsonAlgorithm = []interface{}{
1617 "EcCurveTest",
1618 }
1619
1620
1621 func (j *EcCurveTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
1622 var v string
1623 if err := json.Unmarshal(value, &v); err != nil {
1624 return err
1625 }
1626 var ok bool
1627 for _, expected := range enumValues_EcCurveTestSchemaJsonAlgorithm {
1628 if reflect.DeepEqual(v, expected) {
1629 ok = true
1630 break
1631 }
1632 }
1633 if !ok {
1634 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcCurveTestSchemaJsonAlgorithm, v)
1635 }
1636 *j = EcCurveTestSchemaJsonAlgorithm(v)
1637 return nil
1638 }
1639
1640 type EcCurveTestSchemaJsonSchema string
1641
1642 const EcCurveTestSchemaJsonSchemaEcCurveTestSchemaJson EcCurveTestSchemaJsonSchema = "ec_curve_test_schema.json"
1643
1644 var enumValues_EcCurveTestSchemaJsonSchema = []interface{}{
1645 "ec_curve_test_schema.json",
1646 }
1647
1648
1649 func (j *EcCurveTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
1650 var v string
1651 if err := json.Unmarshal(value, &v); err != nil {
1652 return err
1653 }
1654 var ok bool
1655 for _, expected := range enumValues_EcCurveTestSchemaJsonSchema {
1656 if reflect.DeepEqual(v, expected) {
1657 ok = true
1658 break
1659 }
1660 }
1661 if !ok {
1662 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcCurveTestSchemaJsonSchema, v)
1663 }
1664 *j = EcCurveTestSchemaJsonSchema(v)
1665 return nil
1666 }
1667
1668
1669 func (j *EcCurveTestSchemaJson) UnmarshalJSON(value []byte) error {
1670 var raw map[string]interface{}
1671 if err := json.Unmarshal(value, &raw); err != nil {
1672 return err
1673 }
1674 if _, ok := raw["algorithm"]; raw != nil && !ok {
1675 return fmt.Errorf("field algorithm in EcCurveTestSchemaJson: required")
1676 }
1677 if _, ok := raw["header"]; raw != nil && !ok {
1678 return fmt.Errorf("field header in EcCurveTestSchemaJson: required")
1679 }
1680 if _, ok := raw["notes"]; raw != nil && !ok {
1681 return fmt.Errorf("field notes in EcCurveTestSchemaJson: required")
1682 }
1683 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
1684 return fmt.Errorf("field numberOfTests in EcCurveTestSchemaJson: required")
1685 }
1686 if _, ok := raw["schema"]; raw != nil && !ok {
1687 return fmt.Errorf("field schema in EcCurveTestSchemaJson: required")
1688 }
1689 if _, ok := raw["testGroups"]; raw != nil && !ok {
1690 return fmt.Errorf("field testGroups in EcCurveTestSchemaJson: required")
1691 }
1692 type Plain EcCurveTestSchemaJson
1693 var plain Plain
1694 if err := json.Unmarshal(value, &plain); err != nil {
1695 return err
1696 }
1697 *j = EcCurveTestSchemaJson(plain)
1698 return nil
1699 }
1700
1701 type EcCurveTestTestsElem struct {
1702
1703 A string `json:"a"`
1704
1705
1706 B string `json:"b"`
1707
1708
1709 Comment *string `json:"comment,omitempty,omitzero"`
1710
1711
1712 Flags []string `json:"flags,omitempty,omitzero"`
1713
1714
1715 Gx string `json:"gx"`
1716
1717
1718 Gy string `json:"gy"`
1719
1720
1721 H int `json:"h"`
1722
1723
1724 N string `json:"n"`
1725
1726
1727 Name *string `json:"name,omitempty,omitzero"`
1728
1729
1730 Oid string `json:"oid"`
1731
1732
1733 P string `json:"p"`
1734
1735
1736 Ref *string `json:"ref,omitempty,omitzero"`
1737
1738
1739 Result Result `json:"result"`
1740
1741
1742 TcId int `json:"tcId"`
1743 }
1744
1745
1746 func (j *EcCurveTestTestsElem) UnmarshalJSON(value []byte) error {
1747 var raw map[string]interface{}
1748 if err := json.Unmarshal(value, &raw); err != nil {
1749 return err
1750 }
1751 if _, ok := raw["a"]; raw != nil && !ok {
1752 return fmt.Errorf("field a in EcCurveTestTestsElem: required")
1753 }
1754 if _, ok := raw["b"]; raw != nil && !ok {
1755 return fmt.Errorf("field b in EcCurveTestTestsElem: required")
1756 }
1757 if _, ok := raw["gx"]; raw != nil && !ok {
1758 return fmt.Errorf("field gx in EcCurveTestTestsElem: required")
1759 }
1760 if _, ok := raw["gy"]; raw != nil && !ok {
1761 return fmt.Errorf("field gy in EcCurveTestTestsElem: required")
1762 }
1763 if _, ok := raw["h"]; raw != nil && !ok {
1764 return fmt.Errorf("field h in EcCurveTestTestsElem: required")
1765 }
1766 if _, ok := raw["n"]; raw != nil && !ok {
1767 return fmt.Errorf("field n in EcCurveTestTestsElem: required")
1768 }
1769 if _, ok := raw["oid"]; raw != nil && !ok {
1770 return fmt.Errorf("field oid in EcCurveTestTestsElem: required")
1771 }
1772 if _, ok := raw["p"]; raw != nil && !ok {
1773 return fmt.Errorf("field p in EcCurveTestTestsElem: required")
1774 }
1775 if _, ok := raw["result"]; raw != nil && !ok {
1776 return fmt.Errorf("field result in EcCurveTestTestsElem: required")
1777 }
1778 if _, ok := raw["tcId"]; raw != nil && !ok {
1779 return fmt.Errorf("field tcId in EcCurveTestTestsElem: required")
1780 }
1781 type Plain EcCurveTestTestsElem
1782 var plain Plain
1783 if err := json.Unmarshal(value, &plain); err != nil {
1784 return err
1785 }
1786 *j = EcCurveTestTestsElem(plain)
1787 return nil
1788 }
1789
1790 type EcCurveTestType string
1791
1792 const EcCurveTestTypeEcCurveTest EcCurveTestType = "EcCurveTest"
1793
1794 var enumValues_EcCurveTestType = []interface{}{
1795 "EcCurveTest",
1796 }
1797
1798
1799 func (j *EcCurveTestType) UnmarshalJSON(value []byte) error {
1800 var v string
1801 if err := json.Unmarshal(value, &v); err != nil {
1802 return err
1803 }
1804 var ok bool
1805 for _, expected := range enumValues_EcCurveTestType {
1806 if reflect.DeepEqual(v, expected) {
1807 ok = true
1808 break
1809 }
1810 }
1811 if !ok {
1812 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcCurveTestType, v)
1813 }
1814 *j = EcCurveTestType(v)
1815 return nil
1816 }
1817
1818
1819 func (j *EcCurveTest) UnmarshalJSON(value []byte) error {
1820 var raw map[string]interface{}
1821 if err := json.Unmarshal(value, &raw); err != nil {
1822 return err
1823 }
1824 if _, ok := raw["source"]; raw != nil && !ok {
1825 return fmt.Errorf("field source in EcCurveTest: required")
1826 }
1827 if _, ok := raw["tests"]; raw != nil && !ok {
1828 return fmt.Errorf("field tests in EcCurveTest: required")
1829 }
1830 if _, ok := raw["type"]; raw != nil && !ok {
1831 return fmt.Errorf("field type in EcCurveTest: required")
1832 }
1833 type Plain EcCurveTest
1834 var plain Plain
1835 if err := json.Unmarshal(value, &plain); err != nil {
1836 return err
1837 }
1838 *j = EcCurveTest(plain)
1839 return nil
1840 }
1841
1842 type EcPublicKey struct {
1843
1844 Curve string `json:"curve"`
1845
1846
1847 KeySize int `json:"keySize"`
1848
1849
1850 Type EcPublicKeyType `json:"type"`
1851
1852
1853 Uncompressed string `json:"uncompressed"`
1854
1855
1856 Wx string `json:"wx"`
1857
1858
1859 Wy string `json:"wy"`
1860 }
1861
1862 type EcPublicKeyType string
1863
1864 const EcPublicKeyTypeEcPublicKey EcPublicKeyType = "EcPublicKey"
1865
1866 var enumValues_EcPublicKeyType = []interface{}{
1867 "EcPublicKey",
1868 }
1869
1870
1871 func (j *EcPublicKeyType) UnmarshalJSON(value []byte) error {
1872 var v string
1873 if err := json.Unmarshal(value, &v); err != nil {
1874 return err
1875 }
1876 var ok bool
1877 for _, expected := range enumValues_EcPublicKeyType {
1878 if reflect.DeepEqual(v, expected) {
1879 ok = true
1880 break
1881 }
1882 }
1883 if !ok {
1884 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcPublicKeyType, v)
1885 }
1886 *j = EcPublicKeyType(v)
1887 return nil
1888 }
1889
1890
1891 func (j *EcPublicKey) UnmarshalJSON(value []byte) error {
1892 var raw map[string]interface{}
1893 if err := json.Unmarshal(value, &raw); err != nil {
1894 return err
1895 }
1896 if _, ok := raw["curve"]; raw != nil && !ok {
1897 return fmt.Errorf("field curve in EcPublicKey: required")
1898 }
1899 if _, ok := raw["keySize"]; raw != nil && !ok {
1900 return fmt.Errorf("field keySize in EcPublicKey: required")
1901 }
1902 if _, ok := raw["type"]; raw != nil && !ok {
1903 return fmt.Errorf("field type in EcPublicKey: required")
1904 }
1905 if _, ok := raw["uncompressed"]; raw != nil && !ok {
1906 return fmt.Errorf("field uncompressed in EcPublicKey: required")
1907 }
1908 if _, ok := raw["wx"]; raw != nil && !ok {
1909 return fmt.Errorf("field wx in EcPublicKey: required")
1910 }
1911 if _, ok := raw["wy"]; raw != nil && !ok {
1912 return fmt.Errorf("field wy in EcPublicKey: required")
1913 }
1914 type Plain EcPublicKey
1915 var plain Plain
1916 if err := json.Unmarshal(value, &plain); err != nil {
1917 return err
1918 }
1919 *j = EcPublicKey(plain)
1920 return nil
1921 }
1922
1923 type EcdhEcpointTestGroup struct {
1924
1925 Curve string `json:"curve"`
1926
1927
1928 Encoding string `json:"encoding"`
1929
1930
1931 Source Source `json:"source"`
1932
1933
1934 Tests []EcdhEcpointTestVector `json:"tests"`
1935
1936
1937 Type EcdhEcpointTestGroupType `json:"type"`
1938 }
1939
1940 type EcdhEcpointTestGroupType string
1941
1942 const EcdhEcpointTestGroupTypeEcdhEcpointTest EcdhEcpointTestGroupType = "EcdhEcpointTest"
1943
1944 var enumValues_EcdhEcpointTestGroupType = []interface{}{
1945 "EcdhEcpointTest",
1946 }
1947
1948
1949 func (j *EcdhEcpointTestGroupType) UnmarshalJSON(value []byte) error {
1950 var v string
1951 if err := json.Unmarshal(value, &v); err != nil {
1952 return err
1953 }
1954 var ok bool
1955 for _, expected := range enumValues_EcdhEcpointTestGroupType {
1956 if reflect.DeepEqual(v, expected) {
1957 ok = true
1958 break
1959 }
1960 }
1961 if !ok {
1962 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhEcpointTestGroupType, v)
1963 }
1964 *j = EcdhEcpointTestGroupType(v)
1965 return nil
1966 }
1967
1968
1969 func (j *EcdhEcpointTestGroup) UnmarshalJSON(value []byte) error {
1970 var raw map[string]interface{}
1971 if err := json.Unmarshal(value, &raw); err != nil {
1972 return err
1973 }
1974 if _, ok := raw["curve"]; raw != nil && !ok {
1975 return fmt.Errorf("field curve in EcdhEcpointTestGroup: required")
1976 }
1977 if _, ok := raw["encoding"]; raw != nil && !ok {
1978 return fmt.Errorf("field encoding in EcdhEcpointTestGroup: required")
1979 }
1980 if _, ok := raw["source"]; raw != nil && !ok {
1981 return fmt.Errorf("field source in EcdhEcpointTestGroup: required")
1982 }
1983 if _, ok := raw["tests"]; raw != nil && !ok {
1984 return fmt.Errorf("field tests in EcdhEcpointTestGroup: required")
1985 }
1986 if _, ok := raw["type"]; raw != nil && !ok {
1987 return fmt.Errorf("field type in EcdhEcpointTestGroup: required")
1988 }
1989 type Plain EcdhEcpointTestGroup
1990 var plain Plain
1991 if err := json.Unmarshal(value, &plain); err != nil {
1992 return err
1993 }
1994 *j = EcdhEcpointTestGroup(plain)
1995 return nil
1996 }
1997
1998 type EcdhEcpointTestSchemaV1Json struct {
1999
2000 Algorithm string `json:"algorithm"`
2001
2002
2003 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
2004
2005
2006 Header []string `json:"header"`
2007
2008
2009 Notes Notes `json:"notes"`
2010
2011
2012 NumberOfTests int `json:"numberOfTests"`
2013
2014
2015 Schema EcdhEcpointTestSchemaV1JsonSchema `json:"schema"`
2016
2017
2018 TestGroups []EcdhEcpointTestGroup `json:"testGroups"`
2019 }
2020
2021 type EcdhEcpointTestSchemaV1JsonSchema string
2022
2023 const EcdhEcpointTestSchemaV1JsonSchemaEcdhEcpointTestSchemaV1Json EcdhEcpointTestSchemaV1JsonSchema = "ecdh_ecpoint_test_schema_v1.json"
2024
2025 var enumValues_EcdhEcpointTestSchemaV1JsonSchema = []interface{}{
2026 "ecdh_ecpoint_test_schema_v1.json",
2027 }
2028
2029
2030 func (j *EcdhEcpointTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
2031 var v string
2032 if err := json.Unmarshal(value, &v); err != nil {
2033 return err
2034 }
2035 var ok bool
2036 for _, expected := range enumValues_EcdhEcpointTestSchemaV1JsonSchema {
2037 if reflect.DeepEqual(v, expected) {
2038 ok = true
2039 break
2040 }
2041 }
2042 if !ok {
2043 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhEcpointTestSchemaV1JsonSchema, v)
2044 }
2045 *j = EcdhEcpointTestSchemaV1JsonSchema(v)
2046 return nil
2047 }
2048
2049
2050 func (j *EcdhEcpointTestSchemaV1Json) UnmarshalJSON(value []byte) error {
2051 var raw map[string]interface{}
2052 if err := json.Unmarshal(value, &raw); err != nil {
2053 return err
2054 }
2055 if _, ok := raw["algorithm"]; raw != nil && !ok {
2056 return fmt.Errorf("field algorithm in EcdhEcpointTestSchemaV1Json: required")
2057 }
2058 if _, ok := raw["header"]; raw != nil && !ok {
2059 return fmt.Errorf("field header in EcdhEcpointTestSchemaV1Json: required")
2060 }
2061 if _, ok := raw["notes"]; raw != nil && !ok {
2062 return fmt.Errorf("field notes in EcdhEcpointTestSchemaV1Json: required")
2063 }
2064 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
2065 return fmt.Errorf("field numberOfTests in EcdhEcpointTestSchemaV1Json: required")
2066 }
2067 if _, ok := raw["schema"]; raw != nil && !ok {
2068 return fmt.Errorf("field schema in EcdhEcpointTestSchemaV1Json: required")
2069 }
2070 if _, ok := raw["testGroups"]; raw != nil && !ok {
2071 return fmt.Errorf("field testGroups in EcdhEcpointTestSchemaV1Json: required")
2072 }
2073 type Plain EcdhEcpointTestSchemaV1Json
2074 var plain Plain
2075 if err := json.Unmarshal(value, &plain); err != nil {
2076 return err
2077 }
2078 *j = EcdhEcpointTestSchemaV1Json(plain)
2079 return nil
2080 }
2081
2082 type EcdhEcpointTestVector struct {
2083
2084 Comment string `json:"comment"`
2085
2086
2087 Flags []string `json:"flags"`
2088
2089
2090 Private string `json:"private"`
2091
2092
2093 Public string `json:"public"`
2094
2095
2096 Result Result `json:"result"`
2097
2098
2099 Shared string `json:"shared"`
2100
2101
2102 TcId int `json:"tcId"`
2103 }
2104
2105
2106 func (j *EcdhEcpointTestVector) UnmarshalJSON(value []byte) error {
2107 var raw map[string]interface{}
2108 if err := json.Unmarshal(value, &raw); err != nil {
2109 return err
2110 }
2111 if _, ok := raw["comment"]; raw != nil && !ok {
2112 return fmt.Errorf("field comment in EcdhEcpointTestVector: required")
2113 }
2114 if _, ok := raw["flags"]; raw != nil && !ok {
2115 return fmt.Errorf("field flags in EcdhEcpointTestVector: required")
2116 }
2117 if _, ok := raw["private"]; raw != nil && !ok {
2118 return fmt.Errorf("field private in EcdhEcpointTestVector: required")
2119 }
2120 if _, ok := raw["public"]; raw != nil && !ok {
2121 return fmt.Errorf("field public in EcdhEcpointTestVector: required")
2122 }
2123 if _, ok := raw["result"]; raw != nil && !ok {
2124 return fmt.Errorf("field result in EcdhEcpointTestVector: required")
2125 }
2126 if _, ok := raw["shared"]; raw != nil && !ok {
2127 return fmt.Errorf("field shared in EcdhEcpointTestVector: required")
2128 }
2129 if _, ok := raw["tcId"]; raw != nil && !ok {
2130 return fmt.Errorf("field tcId in EcdhEcpointTestVector: required")
2131 }
2132 type Plain EcdhEcpointTestVector
2133 var plain Plain
2134 if err := json.Unmarshal(value, &plain); err != nil {
2135 return err
2136 }
2137 *j = EcdhEcpointTestVector(plain)
2138 return nil
2139 }
2140
2141 type EcdhPemTestGroup struct {
2142
2143 Curve string `json:"curve"`
2144
2145
2146 Encoding string `json:"encoding"`
2147
2148
2149 Source Source `json:"source"`
2150
2151
2152 Tests []EcdhPemTestVector `json:"tests"`
2153
2154
2155 Type EcdhPemTestGroupType `json:"type"`
2156 }
2157
2158 type EcdhPemTestGroupType string
2159
2160 const EcdhPemTestGroupTypeEcdhPemTest EcdhPemTestGroupType = "EcdhPemTest"
2161
2162 var enumValues_EcdhPemTestGroupType = []interface{}{
2163 "EcdhPemTest",
2164 }
2165
2166
2167 func (j *EcdhPemTestGroupType) UnmarshalJSON(value []byte) error {
2168 var v string
2169 if err := json.Unmarshal(value, &v); err != nil {
2170 return err
2171 }
2172 var ok bool
2173 for _, expected := range enumValues_EcdhPemTestGroupType {
2174 if reflect.DeepEqual(v, expected) {
2175 ok = true
2176 break
2177 }
2178 }
2179 if !ok {
2180 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhPemTestGroupType, v)
2181 }
2182 *j = EcdhPemTestGroupType(v)
2183 return nil
2184 }
2185
2186
2187 func (j *EcdhPemTestGroup) UnmarshalJSON(value []byte) error {
2188 var raw map[string]interface{}
2189 if err := json.Unmarshal(value, &raw); err != nil {
2190 return err
2191 }
2192 if _, ok := raw["curve"]; raw != nil && !ok {
2193 return fmt.Errorf("field curve in EcdhPemTestGroup: required")
2194 }
2195 if _, ok := raw["encoding"]; raw != nil && !ok {
2196 return fmt.Errorf("field encoding in EcdhPemTestGroup: required")
2197 }
2198 if _, ok := raw["source"]; raw != nil && !ok {
2199 return fmt.Errorf("field source in EcdhPemTestGroup: required")
2200 }
2201 if _, ok := raw["tests"]; raw != nil && !ok {
2202 return fmt.Errorf("field tests in EcdhPemTestGroup: required")
2203 }
2204 if _, ok := raw["type"]; raw != nil && !ok {
2205 return fmt.Errorf("field type in EcdhPemTestGroup: required")
2206 }
2207 type Plain EcdhPemTestGroup
2208 var plain Plain
2209 if err := json.Unmarshal(value, &plain); err != nil {
2210 return err
2211 }
2212 *j = EcdhPemTestGroup(plain)
2213 return nil
2214 }
2215
2216 type EcdhPemTestSchemaV1Json struct {
2217
2218 Algorithm string `json:"algorithm"`
2219
2220
2221 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
2222
2223
2224 Header []string `json:"header"`
2225
2226
2227 Notes Notes `json:"notes"`
2228
2229
2230 NumberOfTests int `json:"numberOfTests"`
2231
2232
2233 Schema EcdhPemTestSchemaV1JsonSchema `json:"schema"`
2234
2235
2236 TestGroups []EcdhPemTestGroup `json:"testGroups"`
2237 }
2238
2239 type EcdhPemTestSchemaV1JsonSchema string
2240
2241 const EcdhPemTestSchemaV1JsonSchemaEcdhPemTestSchemaV1Json EcdhPemTestSchemaV1JsonSchema = "ecdh_pem_test_schema_v1.json"
2242
2243 var enumValues_EcdhPemTestSchemaV1JsonSchema = []interface{}{
2244 "ecdh_pem_test_schema_v1.json",
2245 }
2246
2247
2248 func (j *EcdhPemTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
2249 var v string
2250 if err := json.Unmarshal(value, &v); err != nil {
2251 return err
2252 }
2253 var ok bool
2254 for _, expected := range enumValues_EcdhPemTestSchemaV1JsonSchema {
2255 if reflect.DeepEqual(v, expected) {
2256 ok = true
2257 break
2258 }
2259 }
2260 if !ok {
2261 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhPemTestSchemaV1JsonSchema, v)
2262 }
2263 *j = EcdhPemTestSchemaV1JsonSchema(v)
2264 return nil
2265 }
2266
2267
2268 func (j *EcdhPemTestSchemaV1Json) UnmarshalJSON(value []byte) error {
2269 var raw map[string]interface{}
2270 if err := json.Unmarshal(value, &raw); err != nil {
2271 return err
2272 }
2273 if _, ok := raw["algorithm"]; raw != nil && !ok {
2274 return fmt.Errorf("field algorithm in EcdhPemTestSchemaV1Json: required")
2275 }
2276 if _, ok := raw["header"]; raw != nil && !ok {
2277 return fmt.Errorf("field header in EcdhPemTestSchemaV1Json: required")
2278 }
2279 if _, ok := raw["notes"]; raw != nil && !ok {
2280 return fmt.Errorf("field notes in EcdhPemTestSchemaV1Json: required")
2281 }
2282 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
2283 return fmt.Errorf("field numberOfTests in EcdhPemTestSchemaV1Json: required")
2284 }
2285 if _, ok := raw["schema"]; raw != nil && !ok {
2286 return fmt.Errorf("field schema in EcdhPemTestSchemaV1Json: required")
2287 }
2288 if _, ok := raw["testGroups"]; raw != nil && !ok {
2289 return fmt.Errorf("field testGroups in EcdhPemTestSchemaV1Json: required")
2290 }
2291 type Plain EcdhPemTestSchemaV1Json
2292 var plain Plain
2293 if err := json.Unmarshal(value, &plain); err != nil {
2294 return err
2295 }
2296 *j = EcdhPemTestSchemaV1Json(plain)
2297 return nil
2298 }
2299
2300 type EcdhPemTestVector struct {
2301
2302 Comment string `json:"comment"`
2303
2304
2305 Flags []string `json:"flags"`
2306
2307
2308 Private string `json:"private"`
2309
2310
2311 Public string `json:"public"`
2312
2313
2314 Result Result `json:"result"`
2315
2316
2317 Shared string `json:"shared"`
2318
2319
2320 TcId int `json:"tcId"`
2321 }
2322
2323
2324 func (j *EcdhPemTestVector) UnmarshalJSON(value []byte) error {
2325 var raw map[string]interface{}
2326 if err := json.Unmarshal(value, &raw); err != nil {
2327 return err
2328 }
2329 if _, ok := raw["comment"]; raw != nil && !ok {
2330 return fmt.Errorf("field comment in EcdhPemTestVector: required")
2331 }
2332 if _, ok := raw["flags"]; raw != nil && !ok {
2333 return fmt.Errorf("field flags in EcdhPemTestVector: required")
2334 }
2335 if _, ok := raw["private"]; raw != nil && !ok {
2336 return fmt.Errorf("field private in EcdhPemTestVector: required")
2337 }
2338 if _, ok := raw["public"]; raw != nil && !ok {
2339 return fmt.Errorf("field public in EcdhPemTestVector: required")
2340 }
2341 if _, ok := raw["result"]; raw != nil && !ok {
2342 return fmt.Errorf("field result in EcdhPemTestVector: required")
2343 }
2344 if _, ok := raw["shared"]; raw != nil && !ok {
2345 return fmt.Errorf("field shared in EcdhPemTestVector: required")
2346 }
2347 if _, ok := raw["tcId"]; raw != nil && !ok {
2348 return fmt.Errorf("field tcId in EcdhPemTestVector: required")
2349 }
2350 type Plain EcdhPemTestVector
2351 var plain Plain
2352 if err := json.Unmarshal(value, &plain); err != nil {
2353 return err
2354 }
2355 *j = EcdhPemTestVector(plain)
2356 return nil
2357 }
2358
2359 type EcdhTestGroup struct {
2360
2361 Curve string `json:"curve"`
2362
2363
2364 Encoding string `json:"encoding"`
2365
2366
2367 Source Source `json:"source"`
2368
2369
2370 Tests []EcdhTestVector `json:"tests"`
2371
2372
2373 Type EcdhTestGroupType `json:"type"`
2374 }
2375
2376 type EcdhTestGroupType string
2377
2378 const EcdhTestGroupTypeEcdhTest EcdhTestGroupType = "EcdhTest"
2379
2380 var enumValues_EcdhTestGroupType = []interface{}{
2381 "EcdhTest",
2382 }
2383
2384
2385 func (j *EcdhTestGroupType) UnmarshalJSON(value []byte) error {
2386 var v string
2387 if err := json.Unmarshal(value, &v); err != nil {
2388 return err
2389 }
2390 var ok bool
2391 for _, expected := range enumValues_EcdhTestGroupType {
2392 if reflect.DeepEqual(v, expected) {
2393 ok = true
2394 break
2395 }
2396 }
2397 if !ok {
2398 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhTestGroupType, v)
2399 }
2400 *j = EcdhTestGroupType(v)
2401 return nil
2402 }
2403
2404
2405 func (j *EcdhTestGroup) UnmarshalJSON(value []byte) error {
2406 var raw map[string]interface{}
2407 if err := json.Unmarshal(value, &raw); err != nil {
2408 return err
2409 }
2410 if _, ok := raw["curve"]; raw != nil && !ok {
2411 return fmt.Errorf("field curve in EcdhTestGroup: required")
2412 }
2413 if _, ok := raw["encoding"]; raw != nil && !ok {
2414 return fmt.Errorf("field encoding in EcdhTestGroup: required")
2415 }
2416 if _, ok := raw["source"]; raw != nil && !ok {
2417 return fmt.Errorf("field source in EcdhTestGroup: required")
2418 }
2419 if _, ok := raw["tests"]; raw != nil && !ok {
2420 return fmt.Errorf("field tests in EcdhTestGroup: required")
2421 }
2422 if _, ok := raw["type"]; raw != nil && !ok {
2423 return fmt.Errorf("field type in EcdhTestGroup: required")
2424 }
2425 type Plain EcdhTestGroup
2426 var plain Plain
2427 if err := json.Unmarshal(value, &plain); err != nil {
2428 return err
2429 }
2430 *j = EcdhTestGroup(plain)
2431 return nil
2432 }
2433
2434 type EcdhTestSchemaV1Json struct {
2435
2436 Algorithm string `json:"algorithm"`
2437
2438
2439 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
2440
2441
2442 Header []string `json:"header"`
2443
2444
2445 Notes Notes `json:"notes"`
2446
2447
2448 NumberOfTests int `json:"numberOfTests"`
2449
2450
2451 Schema EcdhTestSchemaV1JsonSchema `json:"schema"`
2452
2453
2454 TestGroups []EcdhTestGroup `json:"testGroups"`
2455 }
2456
2457 type EcdhTestSchemaV1JsonSchema string
2458
2459 const EcdhTestSchemaV1JsonSchemaEcdhTestSchemaV1Json EcdhTestSchemaV1JsonSchema = "ecdh_test_schema_v1.json"
2460
2461 var enumValues_EcdhTestSchemaV1JsonSchema = []interface{}{
2462 "ecdh_test_schema_v1.json",
2463 }
2464
2465
2466 func (j *EcdhTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
2467 var v string
2468 if err := json.Unmarshal(value, &v); err != nil {
2469 return err
2470 }
2471 var ok bool
2472 for _, expected := range enumValues_EcdhTestSchemaV1JsonSchema {
2473 if reflect.DeepEqual(v, expected) {
2474 ok = true
2475 break
2476 }
2477 }
2478 if !ok {
2479 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhTestSchemaV1JsonSchema, v)
2480 }
2481 *j = EcdhTestSchemaV1JsonSchema(v)
2482 return nil
2483 }
2484
2485
2486 func (j *EcdhTestSchemaV1Json) UnmarshalJSON(value []byte) error {
2487 var raw map[string]interface{}
2488 if err := json.Unmarshal(value, &raw); err != nil {
2489 return err
2490 }
2491 if _, ok := raw["algorithm"]; raw != nil && !ok {
2492 return fmt.Errorf("field algorithm in EcdhTestSchemaV1Json: required")
2493 }
2494 if _, ok := raw["header"]; raw != nil && !ok {
2495 return fmt.Errorf("field header in EcdhTestSchemaV1Json: required")
2496 }
2497 if _, ok := raw["notes"]; raw != nil && !ok {
2498 return fmt.Errorf("field notes in EcdhTestSchemaV1Json: required")
2499 }
2500 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
2501 return fmt.Errorf("field numberOfTests in EcdhTestSchemaV1Json: required")
2502 }
2503 if _, ok := raw["schema"]; raw != nil && !ok {
2504 return fmt.Errorf("field schema in EcdhTestSchemaV1Json: required")
2505 }
2506 if _, ok := raw["testGroups"]; raw != nil && !ok {
2507 return fmt.Errorf("field testGroups in EcdhTestSchemaV1Json: required")
2508 }
2509 type Plain EcdhTestSchemaV1Json
2510 var plain Plain
2511 if err := json.Unmarshal(value, &plain); err != nil {
2512 return err
2513 }
2514 *j = EcdhTestSchemaV1Json(plain)
2515 return nil
2516 }
2517
2518 type EcdhTestVector struct {
2519
2520 Comment string `json:"comment"`
2521
2522
2523 Flags []string `json:"flags"`
2524
2525
2526 Private string `json:"private"`
2527
2528
2529 Public string `json:"public"`
2530
2531
2532 Result Result `json:"result"`
2533
2534
2535 Shared string `json:"shared"`
2536
2537
2538 TcId int `json:"tcId"`
2539 }
2540
2541
2542 func (j *EcdhTestVector) UnmarshalJSON(value []byte) error {
2543 var raw map[string]interface{}
2544 if err := json.Unmarshal(value, &raw); err != nil {
2545 return err
2546 }
2547 if _, ok := raw["comment"]; raw != nil && !ok {
2548 return fmt.Errorf("field comment in EcdhTestVector: required")
2549 }
2550 if _, ok := raw["flags"]; raw != nil && !ok {
2551 return fmt.Errorf("field flags in EcdhTestVector: required")
2552 }
2553 if _, ok := raw["private"]; raw != nil && !ok {
2554 return fmt.Errorf("field private in EcdhTestVector: required")
2555 }
2556 if _, ok := raw["public"]; raw != nil && !ok {
2557 return fmt.Errorf("field public in EcdhTestVector: required")
2558 }
2559 if _, ok := raw["result"]; raw != nil && !ok {
2560 return fmt.Errorf("field result in EcdhTestVector: required")
2561 }
2562 if _, ok := raw["shared"]; raw != nil && !ok {
2563 return fmt.Errorf("field shared in EcdhTestVector: required")
2564 }
2565 if _, ok := raw["tcId"]; raw != nil && !ok {
2566 return fmt.Errorf("field tcId in EcdhTestVector: required")
2567 }
2568 type Plain EcdhTestVector
2569 var plain Plain
2570 if err := json.Unmarshal(value, &plain); err != nil {
2571 return err
2572 }
2573 *j = EcdhTestVector(plain)
2574 return nil
2575 }
2576
2577 type EcdhWebcryptoTestGroup struct {
2578
2579 Curve string `json:"curve"`
2580
2581
2582 Encoding string `json:"encoding"`
2583
2584
2585 Source Source `json:"source"`
2586
2587
2588 Tests []EcdhWebcryptoTestVector `json:"tests"`
2589
2590
2591 Type EcdhWebcryptoTestGroupType `json:"type"`
2592 }
2593
2594 type EcdhWebcryptoTestGroupType string
2595
2596 const EcdhWebcryptoTestGroupTypeEcdhWebcryptoTest EcdhWebcryptoTestGroupType = "EcdhWebcryptoTest"
2597
2598 var enumValues_EcdhWebcryptoTestGroupType = []interface{}{
2599 "EcdhWebcryptoTest",
2600 }
2601
2602
2603 func (j *EcdhWebcryptoTestGroupType) UnmarshalJSON(value []byte) error {
2604 var v string
2605 if err := json.Unmarshal(value, &v); err != nil {
2606 return err
2607 }
2608 var ok bool
2609 for _, expected := range enumValues_EcdhWebcryptoTestGroupType {
2610 if reflect.DeepEqual(v, expected) {
2611 ok = true
2612 break
2613 }
2614 }
2615 if !ok {
2616 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhWebcryptoTestGroupType, v)
2617 }
2618 *j = EcdhWebcryptoTestGroupType(v)
2619 return nil
2620 }
2621
2622
2623 func (j *EcdhWebcryptoTestGroup) UnmarshalJSON(value []byte) error {
2624 var raw map[string]interface{}
2625 if err := json.Unmarshal(value, &raw); err != nil {
2626 return err
2627 }
2628 if _, ok := raw["curve"]; raw != nil && !ok {
2629 return fmt.Errorf("field curve in EcdhWebcryptoTestGroup: required")
2630 }
2631 if _, ok := raw["encoding"]; raw != nil && !ok {
2632 return fmt.Errorf("field encoding in EcdhWebcryptoTestGroup: required")
2633 }
2634 if _, ok := raw["source"]; raw != nil && !ok {
2635 return fmt.Errorf("field source in EcdhWebcryptoTestGroup: required")
2636 }
2637 if _, ok := raw["tests"]; raw != nil && !ok {
2638 return fmt.Errorf("field tests in EcdhWebcryptoTestGroup: required")
2639 }
2640 if _, ok := raw["type"]; raw != nil && !ok {
2641 return fmt.Errorf("field type in EcdhWebcryptoTestGroup: required")
2642 }
2643 type Plain EcdhWebcryptoTestGroup
2644 var plain Plain
2645 if err := json.Unmarshal(value, &plain); err != nil {
2646 return err
2647 }
2648 *j = EcdhWebcryptoTestGroup(plain)
2649 return nil
2650 }
2651
2652 type EcdhWebcryptoTestSchemaV1Json struct {
2653
2654 Algorithm string `json:"algorithm"`
2655
2656
2657 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
2658
2659
2660 Header []string `json:"header"`
2661
2662
2663 Notes Notes `json:"notes"`
2664
2665
2666 NumberOfTests int `json:"numberOfTests"`
2667
2668
2669 Schema EcdhWebcryptoTestSchemaV1JsonSchema `json:"schema"`
2670
2671
2672 TestGroups []EcdhWebcryptoTestGroup `json:"testGroups"`
2673 }
2674
2675 type EcdhWebcryptoTestSchemaV1JsonSchema string
2676
2677 const EcdhWebcryptoTestSchemaV1JsonSchemaEcdhWebcryptoTestSchemaV1Json EcdhWebcryptoTestSchemaV1JsonSchema = "ecdh_webcrypto_test_schema_v1.json"
2678
2679 var enumValues_EcdhWebcryptoTestSchemaV1JsonSchema = []interface{}{
2680 "ecdh_webcrypto_test_schema_v1.json",
2681 }
2682
2683
2684 func (j *EcdhWebcryptoTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
2685 var v string
2686 if err := json.Unmarshal(value, &v); err != nil {
2687 return err
2688 }
2689 var ok bool
2690 for _, expected := range enumValues_EcdhWebcryptoTestSchemaV1JsonSchema {
2691 if reflect.DeepEqual(v, expected) {
2692 ok = true
2693 break
2694 }
2695 }
2696 if !ok {
2697 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdhWebcryptoTestSchemaV1JsonSchema, v)
2698 }
2699 *j = EcdhWebcryptoTestSchemaV1JsonSchema(v)
2700 return nil
2701 }
2702
2703
2704 func (j *EcdhWebcryptoTestSchemaV1Json) UnmarshalJSON(value []byte) error {
2705 var raw map[string]interface{}
2706 if err := json.Unmarshal(value, &raw); err != nil {
2707 return err
2708 }
2709 if _, ok := raw["algorithm"]; raw != nil && !ok {
2710 return fmt.Errorf("field algorithm in EcdhWebcryptoTestSchemaV1Json: required")
2711 }
2712 if _, ok := raw["header"]; raw != nil && !ok {
2713 return fmt.Errorf("field header in EcdhWebcryptoTestSchemaV1Json: required")
2714 }
2715 if _, ok := raw["notes"]; raw != nil && !ok {
2716 return fmt.Errorf("field notes in EcdhWebcryptoTestSchemaV1Json: required")
2717 }
2718 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
2719 return fmt.Errorf("field numberOfTests in EcdhWebcryptoTestSchemaV1Json: required")
2720 }
2721 if _, ok := raw["schema"]; raw != nil && !ok {
2722 return fmt.Errorf("field schema in EcdhWebcryptoTestSchemaV1Json: required")
2723 }
2724 if _, ok := raw["testGroups"]; raw != nil && !ok {
2725 return fmt.Errorf("field testGroups in EcdhWebcryptoTestSchemaV1Json: required")
2726 }
2727 type Plain EcdhWebcryptoTestSchemaV1Json
2728 var plain Plain
2729 if err := json.Unmarshal(value, &plain); err != nil {
2730 return err
2731 }
2732 *j = EcdhWebcryptoTestSchemaV1Json(plain)
2733 return nil
2734 }
2735
2736 type EcdhWebcryptoTestVector struct {
2737
2738 Comment string `json:"comment"`
2739
2740
2741 Flags []string `json:"flags"`
2742
2743
2744 Private EcdhWebcryptoTestVectorPrivate `json:"private"`
2745
2746
2747 Public EcdhWebcryptoTestVectorPublic `json:"public"`
2748
2749
2750 Result Result `json:"result"`
2751
2752
2753 Shared string `json:"shared"`
2754
2755
2756 TcId int `json:"tcId"`
2757 }
2758
2759
2760 type EcdhWebcryptoTestVectorPrivate map[string]interface{}
2761
2762
2763 type EcdhWebcryptoTestVectorPublic map[string]interface{}
2764
2765
2766 func (j *EcdhWebcryptoTestVector) UnmarshalJSON(value []byte) error {
2767 var raw map[string]interface{}
2768 if err := json.Unmarshal(value, &raw); err != nil {
2769 return err
2770 }
2771 if _, ok := raw["comment"]; raw != nil && !ok {
2772 return fmt.Errorf("field comment in EcdhWebcryptoTestVector: required")
2773 }
2774 if _, ok := raw["flags"]; raw != nil && !ok {
2775 return fmt.Errorf("field flags in EcdhWebcryptoTestVector: required")
2776 }
2777 if _, ok := raw["private"]; raw != nil && !ok {
2778 return fmt.Errorf("field private in EcdhWebcryptoTestVector: required")
2779 }
2780 if _, ok := raw["public"]; raw != nil && !ok {
2781 return fmt.Errorf("field public in EcdhWebcryptoTestVector: required")
2782 }
2783 if _, ok := raw["result"]; raw != nil && !ok {
2784 return fmt.Errorf("field result in EcdhWebcryptoTestVector: required")
2785 }
2786 if _, ok := raw["shared"]; raw != nil && !ok {
2787 return fmt.Errorf("field shared in EcdhWebcryptoTestVector: required")
2788 }
2789 if _, ok := raw["tcId"]; raw != nil && !ok {
2790 return fmt.Errorf("field tcId in EcdhWebcryptoTestVector: required")
2791 }
2792 type Plain EcdhWebcryptoTestVector
2793 var plain Plain
2794 if err := json.Unmarshal(value, &plain); err != nil {
2795 return err
2796 }
2797 *j = EcdhWebcryptoTestVector(plain)
2798 return nil
2799 }
2800
2801 type EcdsaP1363TestGroup struct {
2802
2803 PublicKey EcPublicKey `json:"publicKey"`
2804
2805
2806 PublicKeyDer string `json:"publicKeyDer"`
2807
2808
2809 PublicKeyJwk *JsonWebKey `json:"publicKeyJwk,omitempty,omitzero"`
2810
2811
2812 PublicKeyPem string `json:"publicKeyPem"`
2813
2814
2815 Sha string `json:"sha"`
2816
2817
2818 Source Source `json:"source"`
2819
2820
2821 Tests []SignatureTestVector `json:"tests"`
2822
2823
2824 Type EcdsaP1363TestGroupType `json:"type"`
2825 }
2826
2827 type EcdsaP1363TestGroupType string
2828
2829 const EcdsaP1363TestGroupTypeEcdsaP1363Verify EcdsaP1363TestGroupType = "EcdsaP1363Verify"
2830
2831 var enumValues_EcdsaP1363TestGroupType = []interface{}{
2832 "EcdsaP1363Verify",
2833 }
2834
2835
2836 func (j *EcdsaP1363TestGroupType) UnmarshalJSON(value []byte) error {
2837 var v string
2838 if err := json.Unmarshal(value, &v); err != nil {
2839 return err
2840 }
2841 var ok bool
2842 for _, expected := range enumValues_EcdsaP1363TestGroupType {
2843 if reflect.DeepEqual(v, expected) {
2844 ok = true
2845 break
2846 }
2847 }
2848 if !ok {
2849 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdsaP1363TestGroupType, v)
2850 }
2851 *j = EcdsaP1363TestGroupType(v)
2852 return nil
2853 }
2854
2855
2856 func (j *EcdsaP1363TestGroup) UnmarshalJSON(value []byte) error {
2857 var raw map[string]interface{}
2858 if err := json.Unmarshal(value, &raw); err != nil {
2859 return err
2860 }
2861 if _, ok := raw["publicKey"]; raw != nil && !ok {
2862 return fmt.Errorf("field publicKey in EcdsaP1363TestGroup: required")
2863 }
2864 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
2865 return fmt.Errorf("field publicKeyDer in EcdsaP1363TestGroup: required")
2866 }
2867 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
2868 return fmt.Errorf("field publicKeyPem in EcdsaP1363TestGroup: required")
2869 }
2870 if _, ok := raw["sha"]; raw != nil && !ok {
2871 return fmt.Errorf("field sha in EcdsaP1363TestGroup: required")
2872 }
2873 if _, ok := raw["source"]; raw != nil && !ok {
2874 return fmt.Errorf("field source in EcdsaP1363TestGroup: required")
2875 }
2876 if _, ok := raw["tests"]; raw != nil && !ok {
2877 return fmt.Errorf("field tests in EcdsaP1363TestGroup: required")
2878 }
2879 if _, ok := raw["type"]; raw != nil && !ok {
2880 return fmt.Errorf("field type in EcdsaP1363TestGroup: required")
2881 }
2882 type Plain EcdsaP1363TestGroup
2883 var plain Plain
2884 if err := json.Unmarshal(value, &plain); err != nil {
2885 return err
2886 }
2887 *j = EcdsaP1363TestGroup(plain)
2888 return nil
2889 }
2890
2891 type EcdsaP1363VerifySchemaV1Json struct {
2892
2893 Algorithm string `json:"algorithm"`
2894
2895
2896 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
2897
2898
2899 Header []string `json:"header"`
2900
2901
2902 Notes Notes `json:"notes"`
2903
2904
2905 NumberOfTests int `json:"numberOfTests"`
2906
2907
2908 Schema EcdsaP1363VerifySchemaV1JsonSchema `json:"schema"`
2909
2910
2911 TestGroups []EcdsaP1363TestGroup `json:"testGroups"`
2912 }
2913
2914 type EcdsaP1363VerifySchemaV1JsonSchema string
2915
2916 const EcdsaP1363VerifySchemaV1JsonSchemaEcdsaP1363VerifySchemaV1Json EcdsaP1363VerifySchemaV1JsonSchema = "ecdsa_p1363_verify_schema_v1.json"
2917
2918 var enumValues_EcdsaP1363VerifySchemaV1JsonSchema = []interface{}{
2919 "ecdsa_p1363_verify_schema_v1.json",
2920 }
2921
2922
2923 func (j *EcdsaP1363VerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
2924 var v string
2925 if err := json.Unmarshal(value, &v); err != nil {
2926 return err
2927 }
2928 var ok bool
2929 for _, expected := range enumValues_EcdsaP1363VerifySchemaV1JsonSchema {
2930 if reflect.DeepEqual(v, expected) {
2931 ok = true
2932 break
2933 }
2934 }
2935 if !ok {
2936 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdsaP1363VerifySchemaV1JsonSchema, v)
2937 }
2938 *j = EcdsaP1363VerifySchemaV1JsonSchema(v)
2939 return nil
2940 }
2941
2942
2943 func (j *EcdsaP1363VerifySchemaV1Json) UnmarshalJSON(value []byte) error {
2944 var raw map[string]interface{}
2945 if err := json.Unmarshal(value, &raw); err != nil {
2946 return err
2947 }
2948 if _, ok := raw["algorithm"]; raw != nil && !ok {
2949 return fmt.Errorf("field algorithm in EcdsaP1363VerifySchemaV1Json: required")
2950 }
2951 if _, ok := raw["header"]; raw != nil && !ok {
2952 return fmt.Errorf("field header in EcdsaP1363VerifySchemaV1Json: required")
2953 }
2954 if _, ok := raw["notes"]; raw != nil && !ok {
2955 return fmt.Errorf("field notes in EcdsaP1363VerifySchemaV1Json: required")
2956 }
2957 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
2958 return fmt.Errorf("field numberOfTests in EcdsaP1363VerifySchemaV1Json: required")
2959 }
2960 if _, ok := raw["schema"]; raw != nil && !ok {
2961 return fmt.Errorf("field schema in EcdsaP1363VerifySchemaV1Json: required")
2962 }
2963 if _, ok := raw["testGroups"]; raw != nil && !ok {
2964 return fmt.Errorf("field testGroups in EcdsaP1363VerifySchemaV1Json: required")
2965 }
2966 type Plain EcdsaP1363VerifySchemaV1Json
2967 var plain Plain
2968 if err := json.Unmarshal(value, &plain); err != nil {
2969 return err
2970 }
2971 *j = EcdsaP1363VerifySchemaV1Json(plain)
2972 return nil
2973 }
2974
2975 type EcdsaTestGroup struct {
2976
2977 PublicKey EcPublicKey `json:"publicKey"`
2978
2979
2980 PublicKeyDer string `json:"publicKeyDer"`
2981
2982
2983 PublicKeyPem string `json:"publicKeyPem"`
2984
2985
2986 Sha string `json:"sha"`
2987
2988
2989 Source Source `json:"source"`
2990
2991
2992 Tests []AsnSignatureTestVector `json:"tests"`
2993
2994
2995 Type EcdsaTestGroupType `json:"type"`
2996 }
2997
2998 type EcdsaTestGroupType string
2999
3000 const EcdsaTestGroupTypeEcdsaVerify EcdsaTestGroupType = "EcdsaVerify"
3001
3002 var enumValues_EcdsaTestGroupType = []interface{}{
3003 "EcdsaVerify",
3004 }
3005
3006
3007 func (j *EcdsaTestGroupType) UnmarshalJSON(value []byte) error {
3008 var v string
3009 if err := json.Unmarshal(value, &v); err != nil {
3010 return err
3011 }
3012 var ok bool
3013 for _, expected := range enumValues_EcdsaTestGroupType {
3014 if reflect.DeepEqual(v, expected) {
3015 ok = true
3016 break
3017 }
3018 }
3019 if !ok {
3020 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdsaTestGroupType, v)
3021 }
3022 *j = EcdsaTestGroupType(v)
3023 return nil
3024 }
3025
3026
3027 func (j *EcdsaTestGroup) UnmarshalJSON(value []byte) error {
3028 var raw map[string]interface{}
3029 if err := json.Unmarshal(value, &raw); err != nil {
3030 return err
3031 }
3032 if _, ok := raw["publicKey"]; raw != nil && !ok {
3033 return fmt.Errorf("field publicKey in EcdsaTestGroup: required")
3034 }
3035 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
3036 return fmt.Errorf("field publicKeyDer in EcdsaTestGroup: required")
3037 }
3038 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
3039 return fmt.Errorf("field publicKeyPem in EcdsaTestGroup: required")
3040 }
3041 if _, ok := raw["sha"]; raw != nil && !ok {
3042 return fmt.Errorf("field sha in EcdsaTestGroup: required")
3043 }
3044 if _, ok := raw["source"]; raw != nil && !ok {
3045 return fmt.Errorf("field source in EcdsaTestGroup: required")
3046 }
3047 if _, ok := raw["tests"]; raw != nil && !ok {
3048 return fmt.Errorf("field tests in EcdsaTestGroup: required")
3049 }
3050 if _, ok := raw["type"]; raw != nil && !ok {
3051 return fmt.Errorf("field type in EcdsaTestGroup: required")
3052 }
3053 type Plain EcdsaTestGroup
3054 var plain Plain
3055 if err := json.Unmarshal(value, &plain); err != nil {
3056 return err
3057 }
3058 *j = EcdsaTestGroup(plain)
3059 return nil
3060 }
3061
3062 type EcdsaVerifySchemaV1Json struct {
3063
3064 Algorithm string `json:"algorithm"`
3065
3066
3067 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
3068
3069
3070 Header []string `json:"header"`
3071
3072
3073 Notes Notes `json:"notes"`
3074
3075
3076 NumberOfTests int `json:"numberOfTests"`
3077
3078
3079 Schema EcdsaVerifySchemaV1JsonSchema `json:"schema"`
3080
3081
3082 TestGroups []EcdsaTestGroup `json:"testGroups"`
3083 }
3084
3085 type EcdsaVerifySchemaV1JsonSchema string
3086
3087 const EcdsaVerifySchemaV1JsonSchemaEcdsaVerifySchemaV1Json EcdsaVerifySchemaV1JsonSchema = "ecdsa_verify_schema_v1.json"
3088
3089 var enumValues_EcdsaVerifySchemaV1JsonSchema = []interface{}{
3090 "ecdsa_verify_schema_v1.json",
3091 }
3092
3093
3094 func (j *EcdsaVerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
3095 var v string
3096 if err := json.Unmarshal(value, &v); err != nil {
3097 return err
3098 }
3099 var ok bool
3100 for _, expected := range enumValues_EcdsaVerifySchemaV1JsonSchema {
3101 if reflect.DeepEqual(v, expected) {
3102 ok = true
3103 break
3104 }
3105 }
3106 if !ok {
3107 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EcdsaVerifySchemaV1JsonSchema, v)
3108 }
3109 *j = EcdsaVerifySchemaV1JsonSchema(v)
3110 return nil
3111 }
3112
3113
3114 func (j *EcdsaVerifySchemaV1Json) UnmarshalJSON(value []byte) error {
3115 var raw map[string]interface{}
3116 if err := json.Unmarshal(value, &raw); err != nil {
3117 return err
3118 }
3119 if _, ok := raw["algorithm"]; raw != nil && !ok {
3120 return fmt.Errorf("field algorithm in EcdsaVerifySchemaV1Json: required")
3121 }
3122 if _, ok := raw["header"]; raw != nil && !ok {
3123 return fmt.Errorf("field header in EcdsaVerifySchemaV1Json: required")
3124 }
3125 if _, ok := raw["notes"]; raw != nil && !ok {
3126 return fmt.Errorf("field notes in EcdsaVerifySchemaV1Json: required")
3127 }
3128 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
3129 return fmt.Errorf("field numberOfTests in EcdsaVerifySchemaV1Json: required")
3130 }
3131 if _, ok := raw["schema"]; raw != nil && !ok {
3132 return fmt.Errorf("field schema in EcdsaVerifySchemaV1Json: required")
3133 }
3134 if _, ok := raw["testGroups"]; raw != nil && !ok {
3135 return fmt.Errorf("field testGroups in EcdsaVerifySchemaV1Json: required")
3136 }
3137 type Plain EcdsaVerifySchemaV1Json
3138 var plain Plain
3139 if err := json.Unmarshal(value, &plain); err != nil {
3140 return err
3141 }
3142 *j = EcdsaVerifySchemaV1Json(plain)
3143 return nil
3144 }
3145
3146 type EddsaTestGroup struct {
3147
3148 PublicKey PublicKey `json:"publicKey"`
3149
3150
3151 PublicKeyDer string `json:"publicKeyDer"`
3152
3153
3154 PublicKeyJwk *JsonWebKey `json:"publicKeyJwk,omitempty,omitzero"`
3155
3156
3157 PublicKeyPem string `json:"publicKeyPem"`
3158
3159
3160 Source Source `json:"source"`
3161
3162
3163 Tests []SignatureTestVector `json:"tests"`
3164
3165
3166 Type EddsaTestGroupType `json:"type"`
3167 }
3168
3169 type EddsaTestGroupType string
3170
3171 const EddsaTestGroupTypeEddsaVerify EddsaTestGroupType = "EddsaVerify"
3172
3173 var enumValues_EddsaTestGroupType = []interface{}{
3174 "EddsaVerify",
3175 }
3176
3177
3178 func (j *EddsaTestGroupType) UnmarshalJSON(value []byte) error {
3179 var v string
3180 if err := json.Unmarshal(value, &v); err != nil {
3181 return err
3182 }
3183 var ok bool
3184 for _, expected := range enumValues_EddsaTestGroupType {
3185 if reflect.DeepEqual(v, expected) {
3186 ok = true
3187 break
3188 }
3189 }
3190 if !ok {
3191 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EddsaTestGroupType, v)
3192 }
3193 *j = EddsaTestGroupType(v)
3194 return nil
3195 }
3196
3197
3198 func (j *EddsaTestGroup) UnmarshalJSON(value []byte) error {
3199 var raw map[string]interface{}
3200 if err := json.Unmarshal(value, &raw); err != nil {
3201 return err
3202 }
3203 if _, ok := raw["publicKey"]; raw != nil && !ok {
3204 return fmt.Errorf("field publicKey in EddsaTestGroup: required")
3205 }
3206 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
3207 return fmt.Errorf("field publicKeyDer in EddsaTestGroup: required")
3208 }
3209 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
3210 return fmt.Errorf("field publicKeyPem in EddsaTestGroup: required")
3211 }
3212 if _, ok := raw["source"]; raw != nil && !ok {
3213 return fmt.Errorf("field source in EddsaTestGroup: required")
3214 }
3215 if _, ok := raw["tests"]; raw != nil && !ok {
3216 return fmt.Errorf("field tests in EddsaTestGroup: required")
3217 }
3218 if _, ok := raw["type"]; raw != nil && !ok {
3219 return fmt.Errorf("field type in EddsaTestGroup: required")
3220 }
3221 type Plain EddsaTestGroup
3222 var plain Plain
3223 if err := json.Unmarshal(value, &plain); err != nil {
3224 return err
3225 }
3226 *j = EddsaTestGroup(plain)
3227 return nil
3228 }
3229
3230 type EddsaVerifySchemaV1Json struct {
3231
3232 Algorithm string `json:"algorithm"`
3233
3234
3235 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
3236
3237
3238 Header []string `json:"header"`
3239
3240
3241 Notes Notes `json:"notes"`
3242
3243
3244 NumberOfTests int `json:"numberOfTests"`
3245
3246
3247 Schema EddsaVerifySchemaV1JsonSchema `json:"schema"`
3248
3249
3250 TestGroups []EddsaTestGroup `json:"testGroups"`
3251 }
3252
3253 type EddsaVerifySchemaV1JsonSchema string
3254
3255 const EddsaVerifySchemaV1JsonSchemaEddsaVerifySchemaV1Json EddsaVerifySchemaV1JsonSchema = "eddsa_verify_schema_v1.json"
3256
3257 var enumValues_EddsaVerifySchemaV1JsonSchema = []interface{}{
3258 "eddsa_verify_schema_v1.json",
3259 }
3260
3261
3262 func (j *EddsaVerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
3263 var v string
3264 if err := json.Unmarshal(value, &v); err != nil {
3265 return err
3266 }
3267 var ok bool
3268 for _, expected := range enumValues_EddsaVerifySchemaV1JsonSchema {
3269 if reflect.DeepEqual(v, expected) {
3270 ok = true
3271 break
3272 }
3273 }
3274 if !ok {
3275 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_EddsaVerifySchemaV1JsonSchema, v)
3276 }
3277 *j = EddsaVerifySchemaV1JsonSchema(v)
3278 return nil
3279 }
3280
3281
3282 func (j *EddsaVerifySchemaV1Json) UnmarshalJSON(value []byte) error {
3283 var raw map[string]interface{}
3284 if err := json.Unmarshal(value, &raw); err != nil {
3285 return err
3286 }
3287 if _, ok := raw["algorithm"]; raw != nil && !ok {
3288 return fmt.Errorf("field algorithm in EddsaVerifySchemaV1Json: required")
3289 }
3290 if _, ok := raw["header"]; raw != nil && !ok {
3291 return fmt.Errorf("field header in EddsaVerifySchemaV1Json: required")
3292 }
3293 if _, ok := raw["notes"]; raw != nil && !ok {
3294 return fmt.Errorf("field notes in EddsaVerifySchemaV1Json: required")
3295 }
3296 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
3297 return fmt.Errorf("field numberOfTests in EddsaVerifySchemaV1Json: required")
3298 }
3299 if _, ok := raw["schema"]; raw != nil && !ok {
3300 return fmt.Errorf("field schema in EddsaVerifySchemaV1Json: required")
3301 }
3302 if _, ok := raw["testGroups"]; raw != nil && !ok {
3303 return fmt.Errorf("field testGroups in EddsaVerifySchemaV1Json: required")
3304 }
3305 type Plain EddsaVerifySchemaV1Json
3306 var plain Plain
3307 if err := json.Unmarshal(value, &plain); err != nil {
3308 return err
3309 }
3310 *j = EddsaVerifySchemaV1Json(plain)
3311 return nil
3312 }
3313
3314 type HkdfTestGroup struct {
3315
3316 KeySize int `json:"keySize"`
3317
3318
3319 Source Source `json:"source"`
3320
3321
3322 Tests []HkdfTestVector `json:"tests"`
3323
3324
3325 Type HkdfTestGroupType `json:"type"`
3326 }
3327
3328 type HkdfTestGroupType string
3329
3330 const HkdfTestGroupTypeHkdfTest HkdfTestGroupType = "HkdfTest"
3331
3332 var enumValues_HkdfTestGroupType = []interface{}{
3333 "HkdfTest",
3334 }
3335
3336
3337 func (j *HkdfTestGroupType) UnmarshalJSON(value []byte) error {
3338 var v string
3339 if err := json.Unmarshal(value, &v); err != nil {
3340 return err
3341 }
3342 var ok bool
3343 for _, expected := range enumValues_HkdfTestGroupType {
3344 if reflect.DeepEqual(v, expected) {
3345 ok = true
3346 break
3347 }
3348 }
3349 if !ok {
3350 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_HkdfTestGroupType, v)
3351 }
3352 *j = HkdfTestGroupType(v)
3353 return nil
3354 }
3355
3356
3357 func (j *HkdfTestGroup) UnmarshalJSON(value []byte) error {
3358 var raw map[string]interface{}
3359 if err := json.Unmarshal(value, &raw); err != nil {
3360 return err
3361 }
3362 if _, ok := raw["keySize"]; raw != nil && !ok {
3363 return fmt.Errorf("field keySize in HkdfTestGroup: required")
3364 }
3365 if _, ok := raw["source"]; raw != nil && !ok {
3366 return fmt.Errorf("field source in HkdfTestGroup: required")
3367 }
3368 if _, ok := raw["tests"]; raw != nil && !ok {
3369 return fmt.Errorf("field tests in HkdfTestGroup: required")
3370 }
3371 if _, ok := raw["type"]; raw != nil && !ok {
3372 return fmt.Errorf("field type in HkdfTestGroup: required")
3373 }
3374 type Plain HkdfTestGroup
3375 var plain Plain
3376 if err := json.Unmarshal(value, &plain); err != nil {
3377 return err
3378 }
3379 *j = HkdfTestGroup(plain)
3380 return nil
3381 }
3382
3383 type HkdfTestSchemaV1Json struct {
3384
3385 Algorithm string `json:"algorithm"`
3386
3387
3388 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
3389
3390
3391 Header []string `json:"header"`
3392
3393
3394 Notes Notes `json:"notes"`
3395
3396
3397 NumberOfTests int `json:"numberOfTests"`
3398
3399
3400 Schema HkdfTestSchemaV1JsonSchema `json:"schema"`
3401
3402
3403 TestGroups []HkdfTestGroup `json:"testGroups"`
3404 }
3405
3406 type HkdfTestSchemaV1JsonSchema string
3407
3408 const HkdfTestSchemaV1JsonSchemaHkdfTestSchemaV1Json HkdfTestSchemaV1JsonSchema = "hkdf_test_schema_v1.json"
3409
3410 var enumValues_HkdfTestSchemaV1JsonSchema = []interface{}{
3411 "hkdf_test_schema_v1.json",
3412 }
3413
3414
3415 func (j *HkdfTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
3416 var v string
3417 if err := json.Unmarshal(value, &v); err != nil {
3418 return err
3419 }
3420 var ok bool
3421 for _, expected := range enumValues_HkdfTestSchemaV1JsonSchema {
3422 if reflect.DeepEqual(v, expected) {
3423 ok = true
3424 break
3425 }
3426 }
3427 if !ok {
3428 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_HkdfTestSchemaV1JsonSchema, v)
3429 }
3430 *j = HkdfTestSchemaV1JsonSchema(v)
3431 return nil
3432 }
3433
3434
3435 func (j *HkdfTestSchemaV1Json) UnmarshalJSON(value []byte) error {
3436 var raw map[string]interface{}
3437 if err := json.Unmarshal(value, &raw); err != nil {
3438 return err
3439 }
3440 if _, ok := raw["algorithm"]; raw != nil && !ok {
3441 return fmt.Errorf("field algorithm in HkdfTestSchemaV1Json: required")
3442 }
3443 if _, ok := raw["header"]; raw != nil && !ok {
3444 return fmt.Errorf("field header in HkdfTestSchemaV1Json: required")
3445 }
3446 if _, ok := raw["notes"]; raw != nil && !ok {
3447 return fmt.Errorf("field notes in HkdfTestSchemaV1Json: required")
3448 }
3449 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
3450 return fmt.Errorf("field numberOfTests in HkdfTestSchemaV1Json: required")
3451 }
3452 if _, ok := raw["schema"]; raw != nil && !ok {
3453 return fmt.Errorf("field schema in HkdfTestSchemaV1Json: required")
3454 }
3455 if _, ok := raw["testGroups"]; raw != nil && !ok {
3456 return fmt.Errorf("field testGroups in HkdfTestSchemaV1Json: required")
3457 }
3458 type Plain HkdfTestSchemaV1Json
3459 var plain Plain
3460 if err := json.Unmarshal(value, &plain); err != nil {
3461 return err
3462 }
3463 *j = HkdfTestSchemaV1Json(plain)
3464 return nil
3465 }
3466
3467 type HkdfTestVector struct {
3468
3469 Comment string `json:"comment"`
3470
3471
3472 Flags []string `json:"flags"`
3473
3474
3475 Ikm string `json:"ikm"`
3476
3477
3478 Info string `json:"info"`
3479
3480
3481 Okm string `json:"okm"`
3482
3483
3484 Result Result `json:"result"`
3485
3486
3487 Salt string `json:"salt"`
3488
3489
3490 Size int `json:"size"`
3491
3492
3493 TcId int `json:"tcId"`
3494 }
3495
3496
3497 func (j *HkdfTestVector) UnmarshalJSON(value []byte) error {
3498 var raw map[string]interface{}
3499 if err := json.Unmarshal(value, &raw); err != nil {
3500 return err
3501 }
3502 if _, ok := raw["comment"]; raw != nil && !ok {
3503 return fmt.Errorf("field comment in HkdfTestVector: required")
3504 }
3505 if _, ok := raw["flags"]; raw != nil && !ok {
3506 return fmt.Errorf("field flags in HkdfTestVector: required")
3507 }
3508 if _, ok := raw["ikm"]; raw != nil && !ok {
3509 return fmt.Errorf("field ikm in HkdfTestVector: required")
3510 }
3511 if _, ok := raw["info"]; raw != nil && !ok {
3512 return fmt.Errorf("field info in HkdfTestVector: required")
3513 }
3514 if _, ok := raw["okm"]; raw != nil && !ok {
3515 return fmt.Errorf("field okm in HkdfTestVector: required")
3516 }
3517 if _, ok := raw["result"]; raw != nil && !ok {
3518 return fmt.Errorf("field result in HkdfTestVector: required")
3519 }
3520 if _, ok := raw["salt"]; raw != nil && !ok {
3521 return fmt.Errorf("field salt in HkdfTestVector: required")
3522 }
3523 if _, ok := raw["size"]; raw != nil && !ok {
3524 return fmt.Errorf("field size in HkdfTestVector: required")
3525 }
3526 if _, ok := raw["tcId"]; raw != nil && !ok {
3527 return fmt.Errorf("field tcId in HkdfTestVector: required")
3528 }
3529 type Plain HkdfTestVector
3530 var plain Plain
3531 if err := json.Unmarshal(value, &plain); err != nil {
3532 return err
3533 }
3534 *j = HkdfTestVector(plain)
3535 return nil
3536 }
3537
3538 type IndCpaTestGroup struct {
3539
3540 IvSize int `json:"ivSize"`
3541
3542
3543 KeySize int `json:"keySize"`
3544
3545
3546 Source Source `json:"source"`
3547
3548
3549 Tests []IndCpaTestVector `json:"tests"`
3550
3551
3552 Type IndCpaTestGroupType `json:"type"`
3553 }
3554
3555 type IndCpaTestGroupType string
3556
3557 const IndCpaTestGroupTypeIndCpaTest IndCpaTestGroupType = "IndCpaTest"
3558
3559 var enumValues_IndCpaTestGroupType = []interface{}{
3560 "IndCpaTest",
3561 }
3562
3563
3564 func (j *IndCpaTestGroupType) UnmarshalJSON(value []byte) error {
3565 var v string
3566 if err := json.Unmarshal(value, &v); err != nil {
3567 return err
3568 }
3569 var ok bool
3570 for _, expected := range enumValues_IndCpaTestGroupType {
3571 if reflect.DeepEqual(v, expected) {
3572 ok = true
3573 break
3574 }
3575 }
3576 if !ok {
3577 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_IndCpaTestGroupType, v)
3578 }
3579 *j = IndCpaTestGroupType(v)
3580 return nil
3581 }
3582
3583
3584 func (j *IndCpaTestGroup) UnmarshalJSON(value []byte) error {
3585 var raw map[string]interface{}
3586 if err := json.Unmarshal(value, &raw); err != nil {
3587 return err
3588 }
3589 if _, ok := raw["ivSize"]; raw != nil && !ok {
3590 return fmt.Errorf("field ivSize in IndCpaTestGroup: required")
3591 }
3592 if _, ok := raw["keySize"]; raw != nil && !ok {
3593 return fmt.Errorf("field keySize in IndCpaTestGroup: required")
3594 }
3595 if _, ok := raw["source"]; raw != nil && !ok {
3596 return fmt.Errorf("field source in IndCpaTestGroup: required")
3597 }
3598 if _, ok := raw["tests"]; raw != nil && !ok {
3599 return fmt.Errorf("field tests in IndCpaTestGroup: required")
3600 }
3601 if _, ok := raw["type"]; raw != nil && !ok {
3602 return fmt.Errorf("field type in IndCpaTestGroup: required")
3603 }
3604 type Plain IndCpaTestGroup
3605 var plain Plain
3606 if err := json.Unmarshal(value, &plain); err != nil {
3607 return err
3608 }
3609 *j = IndCpaTestGroup(plain)
3610 return nil
3611 }
3612
3613 type IndCpaTestSchemaV1Json struct {
3614
3615 Algorithm string `json:"algorithm"`
3616
3617
3618 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
3619
3620
3621 Header []string `json:"header"`
3622
3623
3624 Notes Notes `json:"notes"`
3625
3626
3627 NumberOfTests int `json:"numberOfTests"`
3628
3629
3630 Schema IndCpaTestSchemaV1JsonSchema `json:"schema"`
3631
3632
3633 TestGroups []IndCpaTestGroup `json:"testGroups"`
3634 }
3635
3636 type IndCpaTestSchemaV1JsonSchema string
3637
3638 const IndCpaTestSchemaV1JsonSchemaIndCpaTestSchemaV1Json IndCpaTestSchemaV1JsonSchema = "ind_cpa_test_schema_v1.json"
3639
3640 var enumValues_IndCpaTestSchemaV1JsonSchema = []interface{}{
3641 "ind_cpa_test_schema_v1.json",
3642 }
3643
3644
3645 func (j *IndCpaTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
3646 var v string
3647 if err := json.Unmarshal(value, &v); err != nil {
3648 return err
3649 }
3650 var ok bool
3651 for _, expected := range enumValues_IndCpaTestSchemaV1JsonSchema {
3652 if reflect.DeepEqual(v, expected) {
3653 ok = true
3654 break
3655 }
3656 }
3657 if !ok {
3658 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_IndCpaTestSchemaV1JsonSchema, v)
3659 }
3660 *j = IndCpaTestSchemaV1JsonSchema(v)
3661 return nil
3662 }
3663
3664
3665 func (j *IndCpaTestSchemaV1Json) UnmarshalJSON(value []byte) error {
3666 var raw map[string]interface{}
3667 if err := json.Unmarshal(value, &raw); err != nil {
3668 return err
3669 }
3670 if _, ok := raw["algorithm"]; raw != nil && !ok {
3671 return fmt.Errorf("field algorithm in IndCpaTestSchemaV1Json: required")
3672 }
3673 if _, ok := raw["header"]; raw != nil && !ok {
3674 return fmt.Errorf("field header in IndCpaTestSchemaV1Json: required")
3675 }
3676 if _, ok := raw["notes"]; raw != nil && !ok {
3677 return fmt.Errorf("field notes in IndCpaTestSchemaV1Json: required")
3678 }
3679 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
3680 return fmt.Errorf("field numberOfTests in IndCpaTestSchemaV1Json: required")
3681 }
3682 if _, ok := raw["schema"]; raw != nil && !ok {
3683 return fmt.Errorf("field schema in IndCpaTestSchemaV1Json: required")
3684 }
3685 if _, ok := raw["testGroups"]; raw != nil && !ok {
3686 return fmt.Errorf("field testGroups in IndCpaTestSchemaV1Json: required")
3687 }
3688 type Plain IndCpaTestSchemaV1Json
3689 var plain Plain
3690 if err := json.Unmarshal(value, &plain); err != nil {
3691 return err
3692 }
3693 *j = IndCpaTestSchemaV1Json(plain)
3694 return nil
3695 }
3696
3697 type IndCpaTestVector struct {
3698
3699 Comment string `json:"comment"`
3700
3701
3702 Ct string `json:"ct"`
3703
3704
3705 Flags []string `json:"flags"`
3706
3707
3708 Iv string `json:"iv"`
3709
3710
3711 Key string `json:"key"`
3712
3713
3714 Msg string `json:"msg"`
3715
3716
3717 Result Result `json:"result"`
3718
3719
3720 TcId int `json:"tcId"`
3721 }
3722
3723
3724 func (j *IndCpaTestVector) UnmarshalJSON(value []byte) error {
3725 var raw map[string]interface{}
3726 if err := json.Unmarshal(value, &raw); err != nil {
3727 return err
3728 }
3729 if _, ok := raw["comment"]; raw != nil && !ok {
3730 return fmt.Errorf("field comment in IndCpaTestVector: required")
3731 }
3732 if _, ok := raw["ct"]; raw != nil && !ok {
3733 return fmt.Errorf("field ct in IndCpaTestVector: required")
3734 }
3735 if _, ok := raw["flags"]; raw != nil && !ok {
3736 return fmt.Errorf("field flags in IndCpaTestVector: required")
3737 }
3738 if _, ok := raw["iv"]; raw != nil && !ok {
3739 return fmt.Errorf("field iv in IndCpaTestVector: required")
3740 }
3741 if _, ok := raw["key"]; raw != nil && !ok {
3742 return fmt.Errorf("field key in IndCpaTestVector: required")
3743 }
3744 if _, ok := raw["msg"]; raw != nil && !ok {
3745 return fmt.Errorf("field msg in IndCpaTestVector: required")
3746 }
3747 if _, ok := raw["result"]; raw != nil && !ok {
3748 return fmt.Errorf("field result in IndCpaTestVector: required")
3749 }
3750 if _, ok := raw["tcId"]; raw != nil && !ok {
3751 return fmt.Errorf("field tcId in IndCpaTestVector: required")
3752 }
3753 type Plain IndCpaTestVector
3754 var plain Plain
3755 if err := json.Unmarshal(value, &plain); err != nil {
3756 return err
3757 }
3758 *j = IndCpaTestVector(plain)
3759 return nil
3760 }
3761
3762 type JsonWebCryptoSchemaV1Json struct {
3763
3764 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
3765
3766
3767 Header []string `json:"header"`
3768
3769
3770 Notes Notes `json:"notes"`
3771
3772
3773 NumberOfTests int `json:"numberOfTests"`
3774
3775
3776 Schema JsonWebCryptoSchemaV1JsonSchema `json:"schema"`
3777
3778
3779 TestGroups []JsonWebCryptoTestGroup `json:"testGroups"`
3780 }
3781
3782 type JsonWebCryptoSchemaV1JsonSchema string
3783
3784 const JsonWebCryptoSchemaV1JsonSchemaJsonWebCryptoSchemaV1Json JsonWebCryptoSchemaV1JsonSchema = "json_web_crypto_schema_v1.json"
3785
3786 var enumValues_JsonWebCryptoSchemaV1JsonSchema = []interface{}{
3787 "json_web_crypto_schema_v1.json",
3788 }
3789
3790
3791 func (j *JsonWebCryptoSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
3792 var v string
3793 if err := json.Unmarshal(value, &v); err != nil {
3794 return err
3795 }
3796 var ok bool
3797 for _, expected := range enumValues_JsonWebCryptoSchemaV1JsonSchema {
3798 if reflect.DeepEqual(v, expected) {
3799 ok = true
3800 break
3801 }
3802 }
3803 if !ok {
3804 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebCryptoSchemaV1JsonSchema, v)
3805 }
3806 *j = JsonWebCryptoSchemaV1JsonSchema(v)
3807 return nil
3808 }
3809
3810
3811 func (j *JsonWebCryptoSchemaV1Json) UnmarshalJSON(value []byte) error {
3812 var raw map[string]interface{}
3813 if err := json.Unmarshal(value, &raw); err != nil {
3814 return err
3815 }
3816 if _, ok := raw["header"]; raw != nil && !ok {
3817 return fmt.Errorf("field header in JsonWebCryptoSchemaV1Json: required")
3818 }
3819 if _, ok := raw["notes"]; raw != nil && !ok {
3820 return fmt.Errorf("field notes in JsonWebCryptoSchemaV1Json: required")
3821 }
3822 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
3823 return fmt.Errorf("field numberOfTests in JsonWebCryptoSchemaV1Json: required")
3824 }
3825 if _, ok := raw["schema"]; raw != nil && !ok {
3826 return fmt.Errorf("field schema in JsonWebCryptoSchemaV1Json: required")
3827 }
3828 if _, ok := raw["testGroups"]; raw != nil && !ok {
3829 return fmt.Errorf("field testGroups in JsonWebCryptoSchemaV1Json: required")
3830 }
3831 type Plain JsonWebCryptoSchemaV1Json
3832 var plain Plain
3833 if err := json.Unmarshal(value, &plain); err != nil {
3834 return err
3835 }
3836 *j = JsonWebCryptoSchemaV1Json(plain)
3837 return nil
3838 }
3839
3840 type JsonWebCryptoTestGroup struct {
3841
3842 Comment *string `json:"comment,omitempty,omitzero"`
3843
3844
3845 Private JsonWebKeyOrKeyset `json:"private,omitempty,omitzero"`
3846
3847
3848 Public JsonWebKeyOrKeyset `json:"public,omitempty,omitzero"`
3849
3850
3851 Source Source `json:"source"`
3852
3853
3854 Tests []JsonWebCryptoTestVector `json:"tests"`
3855
3856
3857 Type *JsonWebCryptoTestGroupType `json:"type,omitempty,omitzero"`
3858 }
3859
3860 type JsonWebCryptoTestGroupType string
3861
3862 const JsonWebCryptoTestGroupTypeJsonWebCrypto JsonWebCryptoTestGroupType = "JsonWebCrypto"
3863
3864 var enumValues_JsonWebCryptoTestGroupType = []interface{}{
3865 "JsonWebCrypto",
3866 }
3867
3868
3869 func (j *JsonWebCryptoTestGroupType) UnmarshalJSON(value []byte) error {
3870 var v string
3871 if err := json.Unmarshal(value, &v); err != nil {
3872 return err
3873 }
3874 var ok bool
3875 for _, expected := range enumValues_JsonWebCryptoTestGroupType {
3876 if reflect.DeepEqual(v, expected) {
3877 ok = true
3878 break
3879 }
3880 }
3881 if !ok {
3882 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebCryptoTestGroupType, v)
3883 }
3884 *j = JsonWebCryptoTestGroupType(v)
3885 return nil
3886 }
3887
3888
3889 func (j *JsonWebCryptoTestGroup) UnmarshalJSON(value []byte) error {
3890 var raw map[string]interface{}
3891 if err := json.Unmarshal(value, &raw); err != nil {
3892 return err
3893 }
3894 if _, ok := raw["source"]; raw != nil && !ok {
3895 return fmt.Errorf("field source in JsonWebCryptoTestGroup: required")
3896 }
3897 if _, ok := raw["tests"]; raw != nil && !ok {
3898 return fmt.Errorf("field tests in JsonWebCryptoTestGroup: required")
3899 }
3900 type Plain JsonWebCryptoTestGroup
3901 var plain Plain
3902 if err := json.Unmarshal(value, &plain); err != nil {
3903 return err
3904 }
3905 *j = JsonWebCryptoTestGroup(plain)
3906 return nil
3907 }
3908
3909 type JsonWebCryptoTestVector struct {
3910
3911 Comment string `json:"comment"`
3912
3913
3914 Flags []string `json:"flags"`
3915
3916
3917 Jwe interface{} `json:"jwe,omitempty,omitzero"`
3918
3919
3920 Jws interface{} `json:"jws,omitempty,omitzero"`
3921
3922
3923 Pt *string `json:"pt,omitempty,omitzero"`
3924
3925
3926 Result Result `json:"result"`
3927
3928
3929 TcId int `json:"tcId"`
3930 }
3931
3932
3933 func (j *JsonWebCryptoTestVector) UnmarshalJSON(value []byte) error {
3934 var raw map[string]interface{}
3935 if err := json.Unmarshal(value, &raw); err != nil {
3936 return err
3937 }
3938 if _, ok := raw["comment"]; raw != nil && !ok {
3939 return fmt.Errorf("field comment in JsonWebCryptoTestVector: required")
3940 }
3941 if _, ok := raw["flags"]; raw != nil && !ok {
3942 return fmt.Errorf("field flags in JsonWebCryptoTestVector: required")
3943 }
3944 if _, ok := raw["result"]; raw != nil && !ok {
3945 return fmt.Errorf("field result in JsonWebCryptoTestVector: required")
3946 }
3947 if _, ok := raw["tcId"]; raw != nil && !ok {
3948 return fmt.Errorf("field tcId in JsonWebCryptoTestVector: required")
3949 }
3950 type Plain JsonWebCryptoTestVector
3951 var plain Plain
3952 if err := json.Unmarshal(value, &plain); err != nil {
3953 return err
3954 }
3955 *j = JsonWebCryptoTestVector(plain)
3956 return nil
3957 }
3958
3959 type JsonWebEncryptionSchemaV1Json struct {
3960
3961 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
3962
3963
3964 Header []string `json:"header"`
3965
3966
3967 Notes Notes `json:"notes"`
3968
3969
3970 NumberOfTests int `json:"numberOfTests"`
3971
3972
3973 Schema JsonWebEncryptionSchemaV1JsonSchema `json:"schema"`
3974
3975
3976 TestGroups []JsonWebEncryptionTestGroup `json:"testGroups"`
3977 }
3978
3979 type JsonWebEncryptionSchemaV1JsonSchema string
3980
3981 const JsonWebEncryptionSchemaV1JsonSchemaJsonWebEncryptionSchemaV1Json JsonWebEncryptionSchemaV1JsonSchema = "json_web_encryption_schema_v1.json"
3982
3983 var enumValues_JsonWebEncryptionSchemaV1JsonSchema = []interface{}{
3984 "json_web_encryption_schema_v1.json",
3985 }
3986
3987
3988 func (j *JsonWebEncryptionSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
3989 var v string
3990 if err := json.Unmarshal(value, &v); err != nil {
3991 return err
3992 }
3993 var ok bool
3994 for _, expected := range enumValues_JsonWebEncryptionSchemaV1JsonSchema {
3995 if reflect.DeepEqual(v, expected) {
3996 ok = true
3997 break
3998 }
3999 }
4000 if !ok {
4001 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebEncryptionSchemaV1JsonSchema, v)
4002 }
4003 *j = JsonWebEncryptionSchemaV1JsonSchema(v)
4004 return nil
4005 }
4006
4007
4008 func (j *JsonWebEncryptionSchemaV1Json) UnmarshalJSON(value []byte) error {
4009 var raw map[string]interface{}
4010 if err := json.Unmarshal(value, &raw); err != nil {
4011 return err
4012 }
4013 if _, ok := raw["header"]; raw != nil && !ok {
4014 return fmt.Errorf("field header in JsonWebEncryptionSchemaV1Json: required")
4015 }
4016 if _, ok := raw["notes"]; raw != nil && !ok {
4017 return fmt.Errorf("field notes in JsonWebEncryptionSchemaV1Json: required")
4018 }
4019 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
4020 return fmt.Errorf("field numberOfTests in JsonWebEncryptionSchemaV1Json: required")
4021 }
4022 if _, ok := raw["schema"]; raw != nil && !ok {
4023 return fmt.Errorf("field schema in JsonWebEncryptionSchemaV1Json: required")
4024 }
4025 if _, ok := raw["testGroups"]; raw != nil && !ok {
4026 return fmt.Errorf("field testGroups in JsonWebEncryptionSchemaV1Json: required")
4027 }
4028 type Plain JsonWebEncryptionSchemaV1Json
4029 var plain Plain
4030 if err := json.Unmarshal(value, &plain); err != nil {
4031 return err
4032 }
4033 *j = JsonWebEncryptionSchemaV1Json(plain)
4034 return nil
4035 }
4036
4037 type JsonWebEncryptionTestGroup struct {
4038
4039 Comment *string `json:"comment,omitempty,omitzero"`
4040
4041
4042 Private *JsonWebKey `json:"private,omitempty,omitzero"`
4043
4044
4045 Public *JsonWebKey `json:"public,omitempty,omitzero"`
4046
4047
4048 Source Source `json:"source"`
4049
4050
4051 Tests []JsonWebEncryptionTestVector `json:"tests"`
4052
4053
4054 Type *JsonWebEncryptionTestGroupType `json:"type,omitempty,omitzero"`
4055 }
4056
4057 type JsonWebEncryptionTestGroupType string
4058
4059 const JsonWebEncryptionTestGroupTypeJsonWebEncryption JsonWebEncryptionTestGroupType = "JsonWebEncryption"
4060
4061 var enumValues_JsonWebEncryptionTestGroupType = []interface{}{
4062 "JsonWebEncryption",
4063 }
4064
4065
4066 func (j *JsonWebEncryptionTestGroupType) UnmarshalJSON(value []byte) error {
4067 var v string
4068 if err := json.Unmarshal(value, &v); err != nil {
4069 return err
4070 }
4071 var ok bool
4072 for _, expected := range enumValues_JsonWebEncryptionTestGroupType {
4073 if reflect.DeepEqual(v, expected) {
4074 ok = true
4075 break
4076 }
4077 }
4078 if !ok {
4079 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebEncryptionTestGroupType, v)
4080 }
4081 *j = JsonWebEncryptionTestGroupType(v)
4082 return nil
4083 }
4084
4085
4086 func (j *JsonWebEncryptionTestGroup) UnmarshalJSON(value []byte) error {
4087 var raw map[string]interface{}
4088 if err := json.Unmarshal(value, &raw); err != nil {
4089 return err
4090 }
4091 if _, ok := raw["source"]; raw != nil && !ok {
4092 return fmt.Errorf("field source in JsonWebEncryptionTestGroup: required")
4093 }
4094 if _, ok := raw["tests"]; raw != nil && !ok {
4095 return fmt.Errorf("field tests in JsonWebEncryptionTestGroup: required")
4096 }
4097 type Plain JsonWebEncryptionTestGroup
4098 var plain Plain
4099 if err := json.Unmarshal(value, &plain); err != nil {
4100 return err
4101 }
4102 *j = JsonWebEncryptionTestGroup(plain)
4103 return nil
4104 }
4105
4106 type JsonWebEncryptionTestVector struct {
4107
4108 Comment string `json:"comment"`
4109
4110
4111 Enc string `json:"enc"`
4112
4113
4114 Flags []string `json:"flags"`
4115
4116
4117 Jwe string `json:"jwe"`
4118
4119
4120 Pt *string `json:"pt,omitempty,omitzero"`
4121
4122
4123 Result Result `json:"result"`
4124
4125
4126 TcId int `json:"tcId"`
4127 }
4128
4129
4130 func (j *JsonWebEncryptionTestVector) UnmarshalJSON(value []byte) error {
4131 var raw map[string]interface{}
4132 if err := json.Unmarshal(value, &raw); err != nil {
4133 return err
4134 }
4135 if _, ok := raw["comment"]; raw != nil && !ok {
4136 return fmt.Errorf("field comment in JsonWebEncryptionTestVector: required")
4137 }
4138 if _, ok := raw["enc"]; raw != nil && !ok {
4139 return fmt.Errorf("field enc in JsonWebEncryptionTestVector: required")
4140 }
4141 if _, ok := raw["flags"]; raw != nil && !ok {
4142 return fmt.Errorf("field flags in JsonWebEncryptionTestVector: required")
4143 }
4144 if _, ok := raw["jwe"]; raw != nil && !ok {
4145 return fmt.Errorf("field jwe in JsonWebEncryptionTestVector: required")
4146 }
4147 if _, ok := raw["result"]; raw != nil && !ok {
4148 return fmt.Errorf("field result in JsonWebEncryptionTestVector: required")
4149 }
4150 if _, ok := raw["tcId"]; raw != nil && !ok {
4151 return fmt.Errorf("field tcId in JsonWebEncryptionTestVector: required")
4152 }
4153 type Plain JsonWebEncryptionTestVector
4154 var plain Plain
4155 if err := json.Unmarshal(value, &plain); err != nil {
4156 return err
4157 }
4158 *j = JsonWebEncryptionTestVector(plain)
4159 return nil
4160 }
4161
4162
4163
4164 type JsonWebKey struct {
4165
4166 Alg *string `json:"alg,omitempty,omitzero"`
4167
4168
4169 Crv *JsonWebKeyCrv `json:"crv,omitempty,omitzero"`
4170
4171
4172 D *string `json:"d,omitempty,omitzero"`
4173
4174
4175 Dp *string `json:"dp,omitempty,omitzero"`
4176
4177
4178 Dq *string `json:"dq,omitempty,omitzero"`
4179
4180
4181 E *string `json:"e,omitempty,omitzero"`
4182
4183
4184 K *string `json:"k,omitempty,omitzero"`
4185
4186
4187 KeyOps []string `json:"key_ops,omitempty,omitzero"`
4188
4189
4190 Kid *string `json:"kid,omitempty,omitzero"`
4191
4192
4193 Kty *JsonWebKeyKty `json:"kty,omitempty,omitzero"`
4194
4195
4196 N *string `json:"n,omitempty,omitzero"`
4197
4198
4199 P *string `json:"p,omitempty,omitzero"`
4200
4201
4202 Q *string `json:"q,omitempty,omitzero"`
4203
4204
4205 Qi *string `json:"qi,omitempty,omitzero"`
4206
4207
4208 Use *JsonWebKeyUse `json:"use,omitempty,omitzero"`
4209
4210
4211 X *string `json:"x,omitempty,omitzero"`
4212
4213
4214 Y *string `json:"y,omitempty,omitzero"`
4215 }
4216
4217 type JsonWebKeyCrv string
4218
4219 const JsonWebKeyCrvEd25519 JsonWebKeyCrv = "Ed25519"
4220 const JsonWebKeyCrvEd448 JsonWebKeyCrv = "Ed448"
4221 const JsonWebKeyCrvP256 JsonWebKeyCrv = "P-256"
4222 const JsonWebKeyCrvP256K JsonWebKeyCrv = "P-256K"
4223 const JsonWebKeyCrvP384 JsonWebKeyCrv = "P-384"
4224 const JsonWebKeyCrvP521 JsonWebKeyCrv = "P-521"
4225 const JsonWebKeyCrvSecp256K1 JsonWebKeyCrv = "secp256k1"
4226 const JsonWebKeyCrvX25519 JsonWebKeyCrv = "X25519"
4227 const JsonWebKeyCrvX448 JsonWebKeyCrv = "X448"
4228
4229 var enumValues_JsonWebKeyCrv = []interface{}{
4230 "P-256",
4231 "P-256K",
4232 "P-384",
4233 "P-521",
4234 "secp256k1",
4235 "X448",
4236 "X25519",
4237 "Ed25519",
4238 "Ed448",
4239 }
4240
4241
4242 func (j *JsonWebKeyCrv) UnmarshalJSON(value []byte) error {
4243 var v string
4244 if err := json.Unmarshal(value, &v); err != nil {
4245 return err
4246 }
4247 var ok bool
4248 for _, expected := range enumValues_JsonWebKeyCrv {
4249 if reflect.DeepEqual(v, expected) {
4250 ok = true
4251 break
4252 }
4253 }
4254 if !ok {
4255 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebKeyCrv, v)
4256 }
4257 *j = JsonWebKeyCrv(v)
4258 return nil
4259 }
4260
4261 type JsonWebKeyKty string
4262
4263 const JsonWebKeyKtyBlank JsonWebKeyKty = ""
4264 const JsonWebKeyKtyEC JsonWebKeyKty = "EC"
4265 const JsonWebKeyKtyOKP JsonWebKeyKty = "OKP"
4266 const JsonWebKeyKtyOct JsonWebKeyKty = "oct"
4267 const JsonWebKeyKtyRSA JsonWebKeyKty = "RSA"
4268
4269 var enumValues_JsonWebKeyKty = []interface{}{
4270 "",
4271 "oct",
4272 "EC",
4273 "RSA",
4274 "OKP",
4275 }
4276
4277
4278 func (j *JsonWebKeyKty) UnmarshalJSON(value []byte) error {
4279 var v string
4280 if err := json.Unmarshal(value, &v); err != nil {
4281 return err
4282 }
4283 var ok bool
4284 for _, expected := range enumValues_JsonWebKeyKty {
4285 if reflect.DeepEqual(v, expected) {
4286 ok = true
4287 break
4288 }
4289 }
4290 if !ok {
4291 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebKeyKty, v)
4292 }
4293 *j = JsonWebKeyKty(v)
4294 return nil
4295 }
4296
4297 type JsonWebKeyOrKeyset interface{}
4298
4299 type JsonWebKeySchemaV1Json struct {
4300
4301 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
4302
4303
4304 Header []string `json:"header"`
4305
4306
4307 Notes Notes `json:"notes"`
4308
4309
4310 NumberOfTests int `json:"numberOfTests"`
4311
4312
4313 Schema JsonWebKeySchemaV1JsonSchema `json:"schema"`
4314
4315
4316 TestGroups []JsonWebKeyTestGroup `json:"testGroups"`
4317 }
4318
4319 type JsonWebKeySchemaV1JsonSchema string
4320
4321 const JsonWebKeySchemaV1JsonSchemaJsonWebKeySchemaV1Json JsonWebKeySchemaV1JsonSchema = "json_web_key_schema_v1.json"
4322
4323 var enumValues_JsonWebKeySchemaV1JsonSchema = []interface{}{
4324 "json_web_key_schema_v1.json",
4325 }
4326
4327
4328 func (j *JsonWebKeySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
4329 var v string
4330 if err := json.Unmarshal(value, &v); err != nil {
4331 return err
4332 }
4333 var ok bool
4334 for _, expected := range enumValues_JsonWebKeySchemaV1JsonSchema {
4335 if reflect.DeepEqual(v, expected) {
4336 ok = true
4337 break
4338 }
4339 }
4340 if !ok {
4341 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebKeySchemaV1JsonSchema, v)
4342 }
4343 *j = JsonWebKeySchemaV1JsonSchema(v)
4344 return nil
4345 }
4346
4347
4348 func (j *JsonWebKeySchemaV1Json) UnmarshalJSON(value []byte) error {
4349 var raw map[string]interface{}
4350 if err := json.Unmarshal(value, &raw); err != nil {
4351 return err
4352 }
4353 if _, ok := raw["header"]; raw != nil && !ok {
4354 return fmt.Errorf("field header in JsonWebKeySchemaV1Json: required")
4355 }
4356 if _, ok := raw["notes"]; raw != nil && !ok {
4357 return fmt.Errorf("field notes in JsonWebKeySchemaV1Json: required")
4358 }
4359 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
4360 return fmt.Errorf("field numberOfTests in JsonWebKeySchemaV1Json: required")
4361 }
4362 if _, ok := raw["schema"]; raw != nil && !ok {
4363 return fmt.Errorf("field schema in JsonWebKeySchemaV1Json: required")
4364 }
4365 if _, ok := raw["testGroups"]; raw != nil && !ok {
4366 return fmt.Errorf("field testGroups in JsonWebKeySchemaV1Json: required")
4367 }
4368 type Plain JsonWebKeySchemaV1Json
4369 var plain Plain
4370 if err := json.Unmarshal(value, &plain); err != nil {
4371 return err
4372 }
4373 *j = JsonWebKeySchemaV1Json(plain)
4374 return nil
4375 }
4376
4377 type JsonWebKeyTestGroup struct {
4378
4379 Comment *string `json:"comment,omitempty,omitzero"`
4380
4381
4382 Private *JsonWebKeyset `json:"private,omitempty,omitzero"`
4383
4384
4385 Public *JsonWebKeyset `json:"public,omitempty,omitzero"`
4386
4387
4388 Source Source `json:"source"`
4389
4390
4391 Tests []JsonWebKeyTestVector `json:"tests"`
4392
4393
4394 Type *JsonWebKeyTestGroupType `json:"type,omitempty,omitzero"`
4395 }
4396
4397 type JsonWebKeyTestGroupType string
4398
4399 const JsonWebKeyTestGroupTypeJsonWebKey JsonWebKeyTestGroupType = "JsonWebKey"
4400
4401 var enumValues_JsonWebKeyTestGroupType = []interface{}{
4402 "JsonWebKey",
4403 }
4404
4405
4406 func (j *JsonWebKeyTestGroupType) UnmarshalJSON(value []byte) error {
4407 var v string
4408 if err := json.Unmarshal(value, &v); err != nil {
4409 return err
4410 }
4411 var ok bool
4412 for _, expected := range enumValues_JsonWebKeyTestGroupType {
4413 if reflect.DeepEqual(v, expected) {
4414 ok = true
4415 break
4416 }
4417 }
4418 if !ok {
4419 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebKeyTestGroupType, v)
4420 }
4421 *j = JsonWebKeyTestGroupType(v)
4422 return nil
4423 }
4424
4425
4426 func (j *JsonWebKeyTestGroup) UnmarshalJSON(value []byte) error {
4427 var raw map[string]interface{}
4428 if err := json.Unmarshal(value, &raw); err != nil {
4429 return err
4430 }
4431 if _, ok := raw["source"]; raw != nil && !ok {
4432 return fmt.Errorf("field source in JsonWebKeyTestGroup: required")
4433 }
4434 if _, ok := raw["tests"]; raw != nil && !ok {
4435 return fmt.Errorf("field tests in JsonWebKeyTestGroup: required")
4436 }
4437 type Plain JsonWebKeyTestGroup
4438 var plain Plain
4439 if err := json.Unmarshal(value, &plain); err != nil {
4440 return err
4441 }
4442 *j = JsonWebKeyTestGroup(plain)
4443 return nil
4444 }
4445
4446 type JsonWebKeyTestVector struct {
4447
4448 Comment string `json:"comment"`
4449
4450
4451 Flags []string `json:"flags"`
4452
4453
4454 Jws string `json:"jws"`
4455
4456
4457 Result Result `json:"result"`
4458
4459
4460 TcId int `json:"tcId"`
4461 }
4462
4463
4464 func (j *JsonWebKeyTestVector) UnmarshalJSON(value []byte) error {
4465 var raw map[string]interface{}
4466 if err := json.Unmarshal(value, &raw); err != nil {
4467 return err
4468 }
4469 if _, ok := raw["comment"]; raw != nil && !ok {
4470 return fmt.Errorf("field comment in JsonWebKeyTestVector: required")
4471 }
4472 if _, ok := raw["flags"]; raw != nil && !ok {
4473 return fmt.Errorf("field flags in JsonWebKeyTestVector: required")
4474 }
4475 if _, ok := raw["jws"]; raw != nil && !ok {
4476 return fmt.Errorf("field jws in JsonWebKeyTestVector: required")
4477 }
4478 if _, ok := raw["result"]; raw != nil && !ok {
4479 return fmt.Errorf("field result in JsonWebKeyTestVector: required")
4480 }
4481 if _, ok := raw["tcId"]; raw != nil && !ok {
4482 return fmt.Errorf("field tcId in JsonWebKeyTestVector: required")
4483 }
4484 type Plain JsonWebKeyTestVector
4485 var plain Plain
4486 if err := json.Unmarshal(value, &plain); err != nil {
4487 return err
4488 }
4489 *j = JsonWebKeyTestVector(plain)
4490 return nil
4491 }
4492
4493 type JsonWebKeyUse string
4494
4495 const JsonWebKeyUseEnc JsonWebKeyUse = "enc"
4496 const JsonWebKeyUseSig JsonWebKeyUse = "sig"
4497
4498 var enumValues_JsonWebKeyUse = []interface{}{
4499 "sig",
4500 "enc",
4501 }
4502
4503
4504 func (j *JsonWebKeyUse) UnmarshalJSON(value []byte) error {
4505 var v string
4506 if err := json.Unmarshal(value, &v); err != nil {
4507 return err
4508 }
4509 var ok bool
4510 for _, expected := range enumValues_JsonWebKeyUse {
4511 if reflect.DeepEqual(v, expected) {
4512 ok = true
4513 break
4514 }
4515 }
4516 if !ok {
4517 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebKeyUse, v)
4518 }
4519 *j = JsonWebKeyUse(v)
4520 return nil
4521 }
4522
4523
4524 type JsonWebKeyset struct {
4525
4526 Keys []JsonWebKey `json:"keys,omitempty,omitzero"`
4527 }
4528
4529 type JsonWebSignatureSchemaV1Json struct {
4530
4531 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
4532
4533
4534 Header []string `json:"header"`
4535
4536
4537 Notes Notes `json:"notes"`
4538
4539
4540 NumberOfTests int `json:"numberOfTests"`
4541
4542
4543 Schema JsonWebSignatureSchemaV1JsonSchema `json:"schema"`
4544
4545
4546 TestGroups []JsonWebSignatureTestGroup `json:"testGroups"`
4547 }
4548
4549 type JsonWebSignatureSchemaV1JsonSchema string
4550
4551 const JsonWebSignatureSchemaV1JsonSchemaJsonWebSignatureSchemaV1Json JsonWebSignatureSchemaV1JsonSchema = "json_web_signature_schema_v1.json"
4552
4553 var enumValues_JsonWebSignatureSchemaV1JsonSchema = []interface{}{
4554 "json_web_signature_schema_v1.json",
4555 }
4556
4557
4558 func (j *JsonWebSignatureSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
4559 var v string
4560 if err := json.Unmarshal(value, &v); err != nil {
4561 return err
4562 }
4563 var ok bool
4564 for _, expected := range enumValues_JsonWebSignatureSchemaV1JsonSchema {
4565 if reflect.DeepEqual(v, expected) {
4566 ok = true
4567 break
4568 }
4569 }
4570 if !ok {
4571 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebSignatureSchemaV1JsonSchema, v)
4572 }
4573 *j = JsonWebSignatureSchemaV1JsonSchema(v)
4574 return nil
4575 }
4576
4577
4578 func (j *JsonWebSignatureSchemaV1Json) UnmarshalJSON(value []byte) error {
4579 var raw map[string]interface{}
4580 if err := json.Unmarshal(value, &raw); err != nil {
4581 return err
4582 }
4583 if _, ok := raw["header"]; raw != nil && !ok {
4584 return fmt.Errorf("field header in JsonWebSignatureSchemaV1Json: required")
4585 }
4586 if _, ok := raw["notes"]; raw != nil && !ok {
4587 return fmt.Errorf("field notes in JsonWebSignatureSchemaV1Json: required")
4588 }
4589 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
4590 return fmt.Errorf("field numberOfTests in JsonWebSignatureSchemaV1Json: required")
4591 }
4592 if _, ok := raw["schema"]; raw != nil && !ok {
4593 return fmt.Errorf("field schema in JsonWebSignatureSchemaV1Json: required")
4594 }
4595 if _, ok := raw["testGroups"]; raw != nil && !ok {
4596 return fmt.Errorf("field testGroups in JsonWebSignatureSchemaV1Json: required")
4597 }
4598 type Plain JsonWebSignatureSchemaV1Json
4599 var plain Plain
4600 if err := json.Unmarshal(value, &plain); err != nil {
4601 return err
4602 }
4603 *j = JsonWebSignatureSchemaV1Json(plain)
4604 return nil
4605 }
4606
4607 type JsonWebSignatureTestGroup struct {
4608
4609 Comment *string `json:"comment,omitempty,omitzero"`
4610
4611
4612 Private *JsonWebKey `json:"private,omitempty,omitzero"`
4613
4614
4615 Public *JsonWebKey `json:"public,omitempty,omitzero"`
4616
4617
4618 Source Source `json:"source"`
4619
4620
4621 Tests []JsonWebSignatureTestVector `json:"tests"`
4622
4623
4624 Type *JsonWebSignatureTestGroupType `json:"type,omitempty,omitzero"`
4625 }
4626
4627 type JsonWebSignatureTestGroupType string
4628
4629 const JsonWebSignatureTestGroupTypeJsonWebSignature JsonWebSignatureTestGroupType = "JsonWebSignature"
4630
4631 var enumValues_JsonWebSignatureTestGroupType = []interface{}{
4632 "JsonWebSignature",
4633 }
4634
4635
4636 func (j *JsonWebSignatureTestGroupType) UnmarshalJSON(value []byte) error {
4637 var v string
4638 if err := json.Unmarshal(value, &v); err != nil {
4639 return err
4640 }
4641 var ok bool
4642 for _, expected := range enumValues_JsonWebSignatureTestGroupType {
4643 if reflect.DeepEqual(v, expected) {
4644 ok = true
4645 break
4646 }
4647 }
4648 if !ok {
4649 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_JsonWebSignatureTestGroupType, v)
4650 }
4651 *j = JsonWebSignatureTestGroupType(v)
4652 return nil
4653 }
4654
4655
4656 func (j *JsonWebSignatureTestGroup) UnmarshalJSON(value []byte) error {
4657 var raw map[string]interface{}
4658 if err := json.Unmarshal(value, &raw); err != nil {
4659 return err
4660 }
4661 if _, ok := raw["source"]; raw != nil && !ok {
4662 return fmt.Errorf("field source in JsonWebSignatureTestGroup: required")
4663 }
4664 if _, ok := raw["tests"]; raw != nil && !ok {
4665 return fmt.Errorf("field tests in JsonWebSignatureTestGroup: required")
4666 }
4667 type Plain JsonWebSignatureTestGroup
4668 var plain Plain
4669 if err := json.Unmarshal(value, &plain); err != nil {
4670 return err
4671 }
4672 *j = JsonWebSignatureTestGroup(plain)
4673 return nil
4674 }
4675
4676 type JsonWebSignatureTestVector struct {
4677
4678 Comment string `json:"comment"`
4679
4680
4681 Flags []string `json:"flags"`
4682
4683
4684 Jws string `json:"jws"`
4685
4686
4687 Result Result `json:"result"`
4688
4689
4690 TcId int `json:"tcId"`
4691 }
4692
4693
4694 func (j *JsonWebSignatureTestVector) UnmarshalJSON(value []byte) error {
4695 var raw map[string]interface{}
4696 if err := json.Unmarshal(value, &raw); err != nil {
4697 return err
4698 }
4699 if _, ok := raw["comment"]; raw != nil && !ok {
4700 return fmt.Errorf("field comment in JsonWebSignatureTestVector: required")
4701 }
4702 if _, ok := raw["flags"]; raw != nil && !ok {
4703 return fmt.Errorf("field flags in JsonWebSignatureTestVector: required")
4704 }
4705 if _, ok := raw["jws"]; raw != nil && !ok {
4706 return fmt.Errorf("field jws in JsonWebSignatureTestVector: required")
4707 }
4708 if _, ok := raw["result"]; raw != nil && !ok {
4709 return fmt.Errorf("field result in JsonWebSignatureTestVector: required")
4710 }
4711 if _, ok := raw["tcId"]; raw != nil && !ok {
4712 return fmt.Errorf("field tcId in JsonWebSignatureTestVector: required")
4713 }
4714 type Plain JsonWebSignatureTestVector
4715 var plain Plain
4716 if err := json.Unmarshal(value, &plain); err != nil {
4717 return err
4718 }
4719 *j = JsonWebSignatureTestVector(plain)
4720 return nil
4721 }
4722
4723 type KeywrapTestGroup struct {
4724
4725 KeySize int `json:"keySize"`
4726
4727
4728 Source Source `json:"source"`
4729
4730
4731 Tests []KeywrapTestVector `json:"tests"`
4732
4733
4734 Type KeywrapTestGroupType `json:"type"`
4735 }
4736
4737 type KeywrapTestGroupType string
4738
4739 const KeywrapTestGroupTypeKeywrapTest KeywrapTestGroupType = "KeywrapTest"
4740
4741 var enumValues_KeywrapTestGroupType = []interface{}{
4742 "KeywrapTest",
4743 }
4744
4745
4746 func (j *KeywrapTestGroupType) UnmarshalJSON(value []byte) error {
4747 var v string
4748 if err := json.Unmarshal(value, &v); err != nil {
4749 return err
4750 }
4751 var ok bool
4752 for _, expected := range enumValues_KeywrapTestGroupType {
4753 if reflect.DeepEqual(v, expected) {
4754 ok = true
4755 break
4756 }
4757 }
4758 if !ok {
4759 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_KeywrapTestGroupType, v)
4760 }
4761 *j = KeywrapTestGroupType(v)
4762 return nil
4763 }
4764
4765
4766 func (j *KeywrapTestGroup) UnmarshalJSON(value []byte) error {
4767 var raw map[string]interface{}
4768 if err := json.Unmarshal(value, &raw); err != nil {
4769 return err
4770 }
4771 if _, ok := raw["keySize"]; raw != nil && !ok {
4772 return fmt.Errorf("field keySize in KeywrapTestGroup: required")
4773 }
4774 if _, ok := raw["source"]; raw != nil && !ok {
4775 return fmt.Errorf("field source in KeywrapTestGroup: required")
4776 }
4777 if _, ok := raw["tests"]; raw != nil && !ok {
4778 return fmt.Errorf("field tests in KeywrapTestGroup: required")
4779 }
4780 if _, ok := raw["type"]; raw != nil && !ok {
4781 return fmt.Errorf("field type in KeywrapTestGroup: required")
4782 }
4783 type Plain KeywrapTestGroup
4784 var plain Plain
4785 if err := json.Unmarshal(value, &plain); err != nil {
4786 return err
4787 }
4788 *j = KeywrapTestGroup(plain)
4789 return nil
4790 }
4791
4792 type KeywrapTestSchemaV1Json struct {
4793
4794 Algorithm string `json:"algorithm"`
4795
4796
4797 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
4798
4799
4800 Header []string `json:"header"`
4801
4802
4803 Notes Notes `json:"notes"`
4804
4805
4806 NumberOfTests int `json:"numberOfTests"`
4807
4808
4809 Schema KeywrapTestSchemaV1JsonSchema `json:"schema"`
4810
4811
4812 TestGroups []KeywrapTestGroup `json:"testGroups"`
4813 }
4814
4815 type KeywrapTestSchemaV1JsonSchema string
4816
4817 const KeywrapTestSchemaV1JsonSchemaKeywrapTestSchemaV1Json KeywrapTestSchemaV1JsonSchema = "keywrap_test_schema_v1.json"
4818
4819 var enumValues_KeywrapTestSchemaV1JsonSchema = []interface{}{
4820 "keywrap_test_schema_v1.json",
4821 }
4822
4823
4824 func (j *KeywrapTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
4825 var v string
4826 if err := json.Unmarshal(value, &v); err != nil {
4827 return err
4828 }
4829 var ok bool
4830 for _, expected := range enumValues_KeywrapTestSchemaV1JsonSchema {
4831 if reflect.DeepEqual(v, expected) {
4832 ok = true
4833 break
4834 }
4835 }
4836 if !ok {
4837 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_KeywrapTestSchemaV1JsonSchema, v)
4838 }
4839 *j = KeywrapTestSchemaV1JsonSchema(v)
4840 return nil
4841 }
4842
4843
4844 func (j *KeywrapTestSchemaV1Json) UnmarshalJSON(value []byte) error {
4845 var raw map[string]interface{}
4846 if err := json.Unmarshal(value, &raw); err != nil {
4847 return err
4848 }
4849 if _, ok := raw["algorithm"]; raw != nil && !ok {
4850 return fmt.Errorf("field algorithm in KeywrapTestSchemaV1Json: required")
4851 }
4852 if _, ok := raw["header"]; raw != nil && !ok {
4853 return fmt.Errorf("field header in KeywrapTestSchemaV1Json: required")
4854 }
4855 if _, ok := raw["notes"]; raw != nil && !ok {
4856 return fmt.Errorf("field notes in KeywrapTestSchemaV1Json: required")
4857 }
4858 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
4859 return fmt.Errorf("field numberOfTests in KeywrapTestSchemaV1Json: required")
4860 }
4861 if _, ok := raw["schema"]; raw != nil && !ok {
4862 return fmt.Errorf("field schema in KeywrapTestSchemaV1Json: required")
4863 }
4864 if _, ok := raw["testGroups"]; raw != nil && !ok {
4865 return fmt.Errorf("field testGroups in KeywrapTestSchemaV1Json: required")
4866 }
4867 type Plain KeywrapTestSchemaV1Json
4868 var plain Plain
4869 if err := json.Unmarshal(value, &plain); err != nil {
4870 return err
4871 }
4872 *j = KeywrapTestSchemaV1Json(plain)
4873 return nil
4874 }
4875
4876 type KeywrapTestVector struct {
4877
4878 Comment string `json:"comment"`
4879
4880
4881 Ct string `json:"ct"`
4882
4883
4884 Flags []string `json:"flags"`
4885
4886
4887 Key string `json:"key"`
4888
4889
4890 Msg string `json:"msg"`
4891
4892
4893 Result Result `json:"result"`
4894
4895
4896 TcId int `json:"tcId"`
4897 }
4898
4899
4900 func (j *KeywrapTestVector) UnmarshalJSON(value []byte) error {
4901 var raw map[string]interface{}
4902 if err := json.Unmarshal(value, &raw); err != nil {
4903 return err
4904 }
4905 if _, ok := raw["comment"]; raw != nil && !ok {
4906 return fmt.Errorf("field comment in KeywrapTestVector: required")
4907 }
4908 if _, ok := raw["ct"]; raw != nil && !ok {
4909 return fmt.Errorf("field ct in KeywrapTestVector: required")
4910 }
4911 if _, ok := raw["flags"]; raw != nil && !ok {
4912 return fmt.Errorf("field flags in KeywrapTestVector: required")
4913 }
4914 if _, ok := raw["key"]; raw != nil && !ok {
4915 return fmt.Errorf("field key in KeywrapTestVector: required")
4916 }
4917 if _, ok := raw["msg"]; raw != nil && !ok {
4918 return fmt.Errorf("field msg in KeywrapTestVector: required")
4919 }
4920 if _, ok := raw["result"]; raw != nil && !ok {
4921 return fmt.Errorf("field result in KeywrapTestVector: required")
4922 }
4923 if _, ok := raw["tcId"]; raw != nil && !ok {
4924 return fmt.Errorf("field tcId in KeywrapTestVector: required")
4925 }
4926 type Plain KeywrapTestVector
4927 var plain Plain
4928 if err := json.Unmarshal(value, &plain); err != nil {
4929 return err
4930 }
4931 *j = KeywrapTestVector(plain)
4932 return nil
4933 }
4934
4935
4936 type MLKEMDecapsTestGroup struct {
4937
4938 ParameterSet MLKEMDecapsTestGroupParameterSet `json:"parameterSet"`
4939
4940
4941 Source Source `json:"source"`
4942
4943
4944 Tests []MLKEMDecapsTestGroupTestsElem `json:"tests"`
4945
4946
4947 Type MLKEMDecapsTestGroupType `json:"type"`
4948 }
4949
4950 type MLKEMDecapsTestGroupParameterSet string
4951
4952 const MLKEMDecapsTestGroupParameterSetMLKEM1024 MLKEMDecapsTestGroupParameterSet = "ML-KEM-1024"
4953 const MLKEMDecapsTestGroupParameterSetMLKEM512 MLKEMDecapsTestGroupParameterSet = "ML-KEM-512"
4954 const MLKEMDecapsTestGroupParameterSetMLKEM768 MLKEMDecapsTestGroupParameterSet = "ML-KEM-768"
4955
4956 var enumValues_MLKEMDecapsTestGroupParameterSet = []interface{}{
4957 "ML-KEM-512",
4958 "ML-KEM-768",
4959 "ML-KEM-1024",
4960 }
4961
4962
4963 func (j *MLKEMDecapsTestGroupParameterSet) UnmarshalJSON(value []byte) error {
4964 var v string
4965 if err := json.Unmarshal(value, &v); err != nil {
4966 return err
4967 }
4968 var ok bool
4969 for _, expected := range enumValues_MLKEMDecapsTestGroupParameterSet {
4970 if reflect.DeepEqual(v, expected) {
4971 ok = true
4972 break
4973 }
4974 }
4975 if !ok {
4976 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMDecapsTestGroupParameterSet, v)
4977 }
4978 *j = MLKEMDecapsTestGroupParameterSet(v)
4979 return nil
4980 }
4981
4982 type MLKEMDecapsTestGroupTestsElem struct {
4983
4984
4985 K *string `json:"K,omitempty,omitzero"`
4986
4987
4988 C string `json:"c"`
4989
4990
4991 Comment *string `json:"comment,omitempty,omitzero"`
4992
4993
4994 Dk string `json:"dk"`
4995
4996
4997 Ek string `json:"ek"`
4998
4999
5000 Flags []string `json:"flags"`
5001
5002
5003 Result Result `json:"result"`
5004
5005
5006 TcId int `json:"tcId"`
5007 }
5008
5009
5010 func (j *MLKEMDecapsTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5011 var raw map[string]interface{}
5012 if err := json.Unmarshal(value, &raw); err != nil {
5013 return err
5014 }
5015 if _, ok := raw["c"]; raw != nil && !ok {
5016 return fmt.Errorf("field c in MLKEMDecapsTestGroupTestsElem: required")
5017 }
5018 if _, ok := raw["dk"]; raw != nil && !ok {
5019 return fmt.Errorf("field dk in MLKEMDecapsTestGroupTestsElem: required")
5020 }
5021 if _, ok := raw["ek"]; raw != nil && !ok {
5022 return fmt.Errorf("field ek in MLKEMDecapsTestGroupTestsElem: required")
5023 }
5024 if _, ok := raw["flags"]; raw != nil && !ok {
5025 return fmt.Errorf("field flags in MLKEMDecapsTestGroupTestsElem: required")
5026 }
5027 if _, ok := raw["result"]; raw != nil && !ok {
5028 return fmt.Errorf("field result in MLKEMDecapsTestGroupTestsElem: required")
5029 }
5030 if _, ok := raw["tcId"]; raw != nil && !ok {
5031 return fmt.Errorf("field tcId in MLKEMDecapsTestGroupTestsElem: required")
5032 }
5033 type Plain MLKEMDecapsTestGroupTestsElem
5034 var plain Plain
5035 if err := json.Unmarshal(value, &plain); err != nil {
5036 return err
5037 }
5038 *j = MLKEMDecapsTestGroupTestsElem(plain)
5039 return nil
5040 }
5041
5042 type MLKEMDecapsTestGroupType string
5043
5044 const MLKEMDecapsTestGroupTypeMLKEMDecapsValidationTest MLKEMDecapsTestGroupType = "MLKEMDecapsValidationTest"
5045
5046 var enumValues_MLKEMDecapsTestGroupType = []interface{}{
5047 "MLKEMDecapsValidationTest",
5048 }
5049
5050
5051 func (j *MLKEMDecapsTestGroupType) UnmarshalJSON(value []byte) error {
5052 var v string
5053 if err := json.Unmarshal(value, &v); err != nil {
5054 return err
5055 }
5056 var ok bool
5057 for _, expected := range enumValues_MLKEMDecapsTestGroupType {
5058 if reflect.DeepEqual(v, expected) {
5059 ok = true
5060 break
5061 }
5062 }
5063 if !ok {
5064 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMDecapsTestGroupType, v)
5065 }
5066 *j = MLKEMDecapsTestGroupType(v)
5067 return nil
5068 }
5069
5070
5071 func (j *MLKEMDecapsTestGroup) UnmarshalJSON(value []byte) error {
5072 var raw map[string]interface{}
5073 if err := json.Unmarshal(value, &raw); err != nil {
5074 return err
5075 }
5076 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5077 return fmt.Errorf("field parameterSet in MLKEMDecapsTestGroup: required")
5078 }
5079 if _, ok := raw["source"]; raw != nil && !ok {
5080 return fmt.Errorf("field source in MLKEMDecapsTestGroup: required")
5081 }
5082 if _, ok := raw["tests"]; raw != nil && !ok {
5083 return fmt.Errorf("field tests in MLKEMDecapsTestGroup: required")
5084 }
5085 if _, ok := raw["type"]; raw != nil && !ok {
5086 return fmt.Errorf("field type in MLKEMDecapsTestGroup: required")
5087 }
5088 type Plain MLKEMDecapsTestGroup
5089 var plain Plain
5090 if err := json.Unmarshal(value, &plain); err != nil {
5091 return err
5092 }
5093 *j = MLKEMDecapsTestGroup(plain)
5094 return nil
5095 }
5096
5097
5098 type MLKEMEncapsTestGroup struct {
5099
5100 ParameterSet MLKEMEncapsTestGroupParameterSet `json:"parameterSet"`
5101
5102
5103 Source Source `json:"source"`
5104
5105
5106 Tests []MLKEMEncapsTestGroupTestsElem `json:"tests"`
5107
5108
5109 Type *MLKEMEncapsTestGroupType `json:"type,omitempty,omitzero"`
5110 }
5111
5112 type MLKEMEncapsTestGroupParameterSet string
5113
5114 const MLKEMEncapsTestGroupParameterSetMLKEM1024 MLKEMEncapsTestGroupParameterSet = "ML-KEM-1024"
5115 const MLKEMEncapsTestGroupParameterSetMLKEM512 MLKEMEncapsTestGroupParameterSet = "ML-KEM-512"
5116 const MLKEMEncapsTestGroupParameterSetMLKEM768 MLKEMEncapsTestGroupParameterSet = "ML-KEM-768"
5117
5118 var enumValues_MLKEMEncapsTestGroupParameterSet = []interface{}{
5119 "ML-KEM-512",
5120 "ML-KEM-768",
5121 "ML-KEM-1024",
5122 }
5123
5124
5125 func (j *MLKEMEncapsTestGroupParameterSet) UnmarshalJSON(value []byte) error {
5126 var v string
5127 if err := json.Unmarshal(value, &v); err != nil {
5128 return err
5129 }
5130 var ok bool
5131 for _, expected := range enumValues_MLKEMEncapsTestGroupParameterSet {
5132 if reflect.DeepEqual(v, expected) {
5133 ok = true
5134 break
5135 }
5136 }
5137 if !ok {
5138 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMEncapsTestGroupParameterSet, v)
5139 }
5140 *j = MLKEMEncapsTestGroupParameterSet(v)
5141 return nil
5142 }
5143
5144 type MLKEMEncapsTestGroupTestsElem struct {
5145
5146 K string `json:"K"`
5147
5148
5149 C string `json:"c"`
5150
5151
5152 Comment *string `json:"comment,omitempty,omitzero"`
5153
5154
5155 Ek string `json:"ek"`
5156
5157
5158 Flags []string `json:"flags"`
5159
5160
5161 M string `json:"m"`
5162
5163
5164 Result Result `json:"result"`
5165
5166
5167 TcId int `json:"tcId"`
5168 }
5169
5170
5171 func (j *MLKEMEncapsTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5172 var raw map[string]interface{}
5173 if err := json.Unmarshal(value, &raw); err != nil {
5174 return err
5175 }
5176 if _, ok := raw["K"]; raw != nil && !ok {
5177 return fmt.Errorf("field K in MLKEMEncapsTestGroupTestsElem: required")
5178 }
5179 if _, ok := raw["c"]; raw != nil && !ok {
5180 return fmt.Errorf("field c in MLKEMEncapsTestGroupTestsElem: required")
5181 }
5182 if _, ok := raw["ek"]; raw != nil && !ok {
5183 return fmt.Errorf("field ek in MLKEMEncapsTestGroupTestsElem: required")
5184 }
5185 if _, ok := raw["flags"]; raw != nil && !ok {
5186 return fmt.Errorf("field flags in MLKEMEncapsTestGroupTestsElem: required")
5187 }
5188 if _, ok := raw["m"]; raw != nil && !ok {
5189 return fmt.Errorf("field m in MLKEMEncapsTestGroupTestsElem: required")
5190 }
5191 if _, ok := raw["result"]; raw != nil && !ok {
5192 return fmt.Errorf("field result in MLKEMEncapsTestGroupTestsElem: required")
5193 }
5194 if _, ok := raw["tcId"]; raw != nil && !ok {
5195 return fmt.Errorf("field tcId in MLKEMEncapsTestGroupTestsElem: required")
5196 }
5197 type Plain MLKEMEncapsTestGroupTestsElem
5198 var plain Plain
5199 if err := json.Unmarshal(value, &plain); err != nil {
5200 return err
5201 }
5202 if utf8.RuneCountInString(string(plain.M)) < 64 {
5203 return fmt.Errorf("field %s length: must be >= %d", "m", 64)
5204 }
5205 if utf8.RuneCountInString(string(plain.M)) > 64 {
5206 return fmt.Errorf("field %s length: must be <= %d", "m", 64)
5207 }
5208 *j = MLKEMEncapsTestGroupTestsElem(plain)
5209 return nil
5210 }
5211
5212 type MLKEMEncapsTestGroupType string
5213
5214 const MLKEMEncapsTestGroupTypeMLKEMEncapsTest MLKEMEncapsTestGroupType = "MLKEMEncapsTest"
5215
5216 var enumValues_MLKEMEncapsTestGroupType = []interface{}{
5217 "MLKEMEncapsTest",
5218 }
5219
5220
5221 func (j *MLKEMEncapsTestGroupType) UnmarshalJSON(value []byte) error {
5222 var v string
5223 if err := json.Unmarshal(value, &v); err != nil {
5224 return err
5225 }
5226 var ok bool
5227 for _, expected := range enumValues_MLKEMEncapsTestGroupType {
5228 if reflect.DeepEqual(v, expected) {
5229 ok = true
5230 break
5231 }
5232 }
5233 if !ok {
5234 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMEncapsTestGroupType, v)
5235 }
5236 *j = MLKEMEncapsTestGroupType(v)
5237 return nil
5238 }
5239
5240
5241 func (j *MLKEMEncapsTestGroup) UnmarshalJSON(value []byte) error {
5242 var raw map[string]interface{}
5243 if err := json.Unmarshal(value, &raw); err != nil {
5244 return err
5245 }
5246 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5247 return fmt.Errorf("field parameterSet in MLKEMEncapsTestGroup: required")
5248 }
5249 if _, ok := raw["source"]; raw != nil && !ok {
5250 return fmt.Errorf("field source in MLKEMEncapsTestGroup: required")
5251 }
5252 if _, ok := raw["tests"]; raw != nil && !ok {
5253 return fmt.Errorf("field tests in MLKEMEncapsTestGroup: required")
5254 }
5255 type Plain MLKEMEncapsTestGroup
5256 var plain Plain
5257 if err := json.Unmarshal(value, &plain); err != nil {
5258 return err
5259 }
5260 *j = MLKEMEncapsTestGroup(plain)
5261 return nil
5262 }
5263
5264
5265 type MLKEMKeyGenTestGroup struct {
5266
5267 ParameterSet MLKEMKeyGenTestGroupParameterSet `json:"parameterSet"`
5268
5269
5270 Source Source `json:"source"`
5271
5272
5273 Tests []MLKEMKeyGenTestGroupTestsElem `json:"tests"`
5274
5275
5276 Type MLKEMKeyGenTestGroupType `json:"type"`
5277 }
5278
5279 type MLKEMKeyGenTestGroupParameterSet string
5280
5281 const MLKEMKeyGenTestGroupParameterSetMLKEM1024 MLKEMKeyGenTestGroupParameterSet = "ML-KEM-1024"
5282 const MLKEMKeyGenTestGroupParameterSetMLKEM512 MLKEMKeyGenTestGroupParameterSet = "ML-KEM-512"
5283 const MLKEMKeyGenTestGroupParameterSetMLKEM768 MLKEMKeyGenTestGroupParameterSet = "ML-KEM-768"
5284
5285 var enumValues_MLKEMKeyGenTestGroupParameterSet = []interface{}{
5286 "ML-KEM-512",
5287 "ML-KEM-768",
5288 "ML-KEM-1024",
5289 }
5290
5291
5292 func (j *MLKEMKeyGenTestGroupParameterSet) UnmarshalJSON(value []byte) error {
5293 var v string
5294 if err := json.Unmarshal(value, &v); err != nil {
5295 return err
5296 }
5297 var ok bool
5298 for _, expected := range enumValues_MLKEMKeyGenTestGroupParameterSet {
5299 if reflect.DeepEqual(v, expected) {
5300 ok = true
5301 break
5302 }
5303 }
5304 if !ok {
5305 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMKeyGenTestGroupParameterSet, v)
5306 }
5307 *j = MLKEMKeyGenTestGroupParameterSet(v)
5308 return nil
5309 }
5310
5311 type MLKEMKeyGenTestGroupTestsElem struct {
5312
5313 Comment *string `json:"comment,omitempty,omitzero"`
5314
5315
5316 Dk string `json:"dk"`
5317
5318
5319 Ek string `json:"ek"`
5320
5321
5322 Flags []string `json:"flags,omitempty,omitzero"`
5323
5324
5325 Result Result `json:"result"`
5326
5327
5328 Seed string `json:"seed"`
5329
5330
5331 TcId int `json:"tcId"`
5332 }
5333
5334
5335 func (j *MLKEMKeyGenTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5336 var raw map[string]interface{}
5337 if err := json.Unmarshal(value, &raw); err != nil {
5338 return err
5339 }
5340 if _, ok := raw["dk"]; raw != nil && !ok {
5341 return fmt.Errorf("field dk in MLKEMKeyGenTestGroupTestsElem: required")
5342 }
5343 if _, ok := raw["ek"]; raw != nil && !ok {
5344 return fmt.Errorf("field ek in MLKEMKeyGenTestGroupTestsElem: required")
5345 }
5346 if _, ok := raw["result"]; raw != nil && !ok {
5347 return fmt.Errorf("field result in MLKEMKeyGenTestGroupTestsElem: required")
5348 }
5349 if _, ok := raw["seed"]; raw != nil && !ok {
5350 return fmt.Errorf("field seed in MLKEMKeyGenTestGroupTestsElem: required")
5351 }
5352 if _, ok := raw["tcId"]; raw != nil && !ok {
5353 return fmt.Errorf("field tcId in MLKEMKeyGenTestGroupTestsElem: required")
5354 }
5355 type Plain MLKEMKeyGenTestGroupTestsElem
5356 var plain Plain
5357 if err := json.Unmarshal(value, &plain); err != nil {
5358 return err
5359 }
5360 *j = MLKEMKeyGenTestGroupTestsElem(plain)
5361 return nil
5362 }
5363
5364 type MLKEMKeyGenTestGroupType string
5365
5366 const MLKEMKeyGenTestGroupTypeMLKEMKeyGen MLKEMKeyGenTestGroupType = "MLKEMKeyGen"
5367
5368 var enumValues_MLKEMKeyGenTestGroupType = []interface{}{
5369 "MLKEMKeyGen",
5370 }
5371
5372
5373 func (j *MLKEMKeyGenTestGroupType) UnmarshalJSON(value []byte) error {
5374 var v string
5375 if err := json.Unmarshal(value, &v); err != nil {
5376 return err
5377 }
5378 var ok bool
5379 for _, expected := range enumValues_MLKEMKeyGenTestGroupType {
5380 if reflect.DeepEqual(v, expected) {
5381 ok = true
5382 break
5383 }
5384 }
5385 if !ok {
5386 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMKeyGenTestGroupType, v)
5387 }
5388 *j = MLKEMKeyGenTestGroupType(v)
5389 return nil
5390 }
5391
5392
5393 func (j *MLKEMKeyGenTestGroup) UnmarshalJSON(value []byte) error {
5394 var raw map[string]interface{}
5395 if err := json.Unmarshal(value, &raw); err != nil {
5396 return err
5397 }
5398 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5399 return fmt.Errorf("field parameterSet in MLKEMKeyGenTestGroup: required")
5400 }
5401 if _, ok := raw["source"]; raw != nil && !ok {
5402 return fmt.Errorf("field source in MLKEMKeyGenTestGroup: required")
5403 }
5404 if _, ok := raw["tests"]; raw != nil && !ok {
5405 return fmt.Errorf("field tests in MLKEMKeyGenTestGroup: required")
5406 }
5407 if _, ok := raw["type"]; raw != nil && !ok {
5408 return fmt.Errorf("field type in MLKEMKeyGenTestGroup: required")
5409 }
5410 type Plain MLKEMKeyGenTestGroup
5411 var plain Plain
5412 if err := json.Unmarshal(value, &plain); err != nil {
5413 return err
5414 }
5415 *j = MLKEMKeyGenTestGroup(plain)
5416 return nil
5417 }
5418
5419
5420 type MLKEMTestGroup struct {
5421
5422 ParameterSet MLKEMTestGroupParameterSet `json:"parameterSet"`
5423
5424
5425 Source Source `json:"source"`
5426
5427
5428 Tests []MLKEMTestGroupTestsElem `json:"tests"`
5429
5430
5431 Type MLKEMTestGroupType `json:"type"`
5432 }
5433
5434 type MLKEMTestGroupParameterSet string
5435
5436 const MLKEMTestGroupParameterSetMLKEM1024 MLKEMTestGroupParameterSet = "ML-KEM-1024"
5437 const MLKEMTestGroupParameterSetMLKEM512 MLKEMTestGroupParameterSet = "ML-KEM-512"
5438 const MLKEMTestGroupParameterSetMLKEM768 MLKEMTestGroupParameterSet = "ML-KEM-768"
5439
5440 var enumValues_MLKEMTestGroupParameterSet = []interface{}{
5441 "ML-KEM-512",
5442 "ML-KEM-768",
5443 "ML-KEM-1024",
5444 }
5445
5446
5447 func (j *MLKEMTestGroupParameterSet) UnmarshalJSON(value []byte) error {
5448 var v string
5449 if err := json.Unmarshal(value, &v); err != nil {
5450 return err
5451 }
5452 var ok bool
5453 for _, expected := range enumValues_MLKEMTestGroupParameterSet {
5454 if reflect.DeepEqual(v, expected) {
5455 ok = true
5456 break
5457 }
5458 }
5459 if !ok {
5460 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMTestGroupParameterSet, v)
5461 }
5462 *j = MLKEMTestGroupParameterSet(v)
5463 return nil
5464 }
5465
5466 type MLKEMTestGroupTestsElem struct {
5467
5468 K string `json:"K"`
5469
5470
5471 C string `json:"c"`
5472
5473
5474 Comment *string `json:"comment,omitempty,omitzero"`
5475
5476
5477 Ek *string `json:"ek,omitempty,omitzero"`
5478
5479
5480 Flags []string `json:"flags"`
5481
5482
5483 Result Result `json:"result"`
5484
5485
5486 Seed string `json:"seed"`
5487
5488
5489 TcId int `json:"tcId"`
5490 }
5491
5492
5493 func (j *MLKEMTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5494 var raw map[string]interface{}
5495 if err := json.Unmarshal(value, &raw); err != nil {
5496 return err
5497 }
5498 if _, ok := raw["K"]; raw != nil && !ok {
5499 return fmt.Errorf("field K in MLKEMTestGroupTestsElem: required")
5500 }
5501 if _, ok := raw["c"]; raw != nil && !ok {
5502 return fmt.Errorf("field c in MLKEMTestGroupTestsElem: required")
5503 }
5504 if _, ok := raw["flags"]; raw != nil && !ok {
5505 return fmt.Errorf("field flags in MLKEMTestGroupTestsElem: required")
5506 }
5507 if _, ok := raw["result"]; raw != nil && !ok {
5508 return fmt.Errorf("field result in MLKEMTestGroupTestsElem: required")
5509 }
5510 if _, ok := raw["seed"]; raw != nil && !ok {
5511 return fmt.Errorf("field seed in MLKEMTestGroupTestsElem: required")
5512 }
5513 if _, ok := raw["tcId"]; raw != nil && !ok {
5514 return fmt.Errorf("field tcId in MLKEMTestGroupTestsElem: required")
5515 }
5516 type Plain MLKEMTestGroupTestsElem
5517 var plain Plain
5518 if err := json.Unmarshal(value, &plain); err != nil {
5519 return err
5520 }
5521 *j = MLKEMTestGroupTestsElem(plain)
5522 return nil
5523 }
5524
5525 type MLKEMTestGroupType string
5526
5527 const MLKEMTestGroupTypeMLKEMTest MLKEMTestGroupType = "MLKEMTest"
5528
5529 var enumValues_MLKEMTestGroupType = []interface{}{
5530 "MLKEMTest",
5531 }
5532
5533
5534 func (j *MLKEMTestGroupType) UnmarshalJSON(value []byte) error {
5535 var v string
5536 if err := json.Unmarshal(value, &v); err != nil {
5537 return err
5538 }
5539 var ok bool
5540 for _, expected := range enumValues_MLKEMTestGroupType {
5541 if reflect.DeepEqual(v, expected) {
5542 ok = true
5543 break
5544 }
5545 }
5546 if !ok {
5547 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMTestGroupType, v)
5548 }
5549 *j = MLKEMTestGroupType(v)
5550 return nil
5551 }
5552
5553
5554 func (j *MLKEMTestGroup) UnmarshalJSON(value []byte) error {
5555 var raw map[string]interface{}
5556 if err := json.Unmarshal(value, &raw); err != nil {
5557 return err
5558 }
5559 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5560 return fmt.Errorf("field parameterSet in MLKEMTestGroup: required")
5561 }
5562 if _, ok := raw["source"]; raw != nil && !ok {
5563 return fmt.Errorf("field source in MLKEMTestGroup: required")
5564 }
5565 if _, ok := raw["tests"]; raw != nil && !ok {
5566 return fmt.Errorf("field tests in MLKEMTestGroup: required")
5567 }
5568 if _, ok := raw["type"]; raw != nil && !ok {
5569 return fmt.Errorf("field type in MLKEMTestGroup: required")
5570 }
5571 type Plain MLKEMTestGroup
5572 var plain Plain
5573 if err := json.Unmarshal(value, &plain); err != nil {
5574 return err
5575 }
5576 *j = MLKEMTestGroup(plain)
5577 return nil
5578 }
5579
5580 type MacTestGroup struct {
5581
5582 KeySize int `json:"keySize"`
5583
5584
5585 Source Source `json:"source"`
5586
5587
5588 TagSize int `json:"tagSize"`
5589
5590
5591 Tests []MacTestVector `json:"tests"`
5592
5593
5594 Type MacTestGroupType `json:"type"`
5595 }
5596
5597 type MacTestGroupType string
5598
5599 const MacTestGroupTypeMacTest MacTestGroupType = "MacTest"
5600
5601 var enumValues_MacTestGroupType = []interface{}{
5602 "MacTest",
5603 }
5604
5605
5606 func (j *MacTestGroupType) UnmarshalJSON(value []byte) error {
5607 var v string
5608 if err := json.Unmarshal(value, &v); err != nil {
5609 return err
5610 }
5611 var ok bool
5612 for _, expected := range enumValues_MacTestGroupType {
5613 if reflect.DeepEqual(v, expected) {
5614 ok = true
5615 break
5616 }
5617 }
5618 if !ok {
5619 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacTestGroupType, v)
5620 }
5621 *j = MacTestGroupType(v)
5622 return nil
5623 }
5624
5625
5626 func (j *MacTestGroup) UnmarshalJSON(value []byte) error {
5627 var raw map[string]interface{}
5628 if err := json.Unmarshal(value, &raw); err != nil {
5629 return err
5630 }
5631 if _, ok := raw["keySize"]; raw != nil && !ok {
5632 return fmt.Errorf("field keySize in MacTestGroup: required")
5633 }
5634 if _, ok := raw["source"]; raw != nil && !ok {
5635 return fmt.Errorf("field source in MacTestGroup: required")
5636 }
5637 if _, ok := raw["tagSize"]; raw != nil && !ok {
5638 return fmt.Errorf("field tagSize in MacTestGroup: required")
5639 }
5640 if _, ok := raw["tests"]; raw != nil && !ok {
5641 return fmt.Errorf("field tests in MacTestGroup: required")
5642 }
5643 if _, ok := raw["type"]; raw != nil && !ok {
5644 return fmt.Errorf("field type in MacTestGroup: required")
5645 }
5646 type Plain MacTestGroup
5647 var plain Plain
5648 if err := json.Unmarshal(value, &plain); err != nil {
5649 return err
5650 }
5651 *j = MacTestGroup(plain)
5652 return nil
5653 }
5654
5655 type MacTestSchemaV1Json struct {
5656
5657 Algorithm string `json:"algorithm"`
5658
5659
5660 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
5661
5662
5663 Header []string `json:"header"`
5664
5665
5666 Notes Notes `json:"notes"`
5667
5668
5669 NumberOfTests int `json:"numberOfTests"`
5670
5671
5672 Schema MacTestSchemaV1JsonSchema `json:"schema"`
5673
5674
5675 TestGroups []MacTestGroup `json:"testGroups"`
5676 }
5677
5678 type MacTestSchemaV1JsonSchema string
5679
5680 const MacTestSchemaV1JsonSchemaMacTestSchemaV1Json MacTestSchemaV1JsonSchema = "mac_test_schema_v1.json"
5681
5682 var enumValues_MacTestSchemaV1JsonSchema = []interface{}{
5683 "mac_test_schema_v1.json",
5684 }
5685
5686
5687 func (j *MacTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
5688 var v string
5689 if err := json.Unmarshal(value, &v); err != nil {
5690 return err
5691 }
5692 var ok bool
5693 for _, expected := range enumValues_MacTestSchemaV1JsonSchema {
5694 if reflect.DeepEqual(v, expected) {
5695 ok = true
5696 break
5697 }
5698 }
5699 if !ok {
5700 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacTestSchemaV1JsonSchema, v)
5701 }
5702 *j = MacTestSchemaV1JsonSchema(v)
5703 return nil
5704 }
5705
5706
5707 func (j *MacTestSchemaV1Json) UnmarshalJSON(value []byte) error {
5708 var raw map[string]interface{}
5709 if err := json.Unmarshal(value, &raw); err != nil {
5710 return err
5711 }
5712 if _, ok := raw["algorithm"]; raw != nil && !ok {
5713 return fmt.Errorf("field algorithm in MacTestSchemaV1Json: required")
5714 }
5715 if _, ok := raw["header"]; raw != nil && !ok {
5716 return fmt.Errorf("field header in MacTestSchemaV1Json: required")
5717 }
5718 if _, ok := raw["notes"]; raw != nil && !ok {
5719 return fmt.Errorf("field notes in MacTestSchemaV1Json: required")
5720 }
5721 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
5722 return fmt.Errorf("field numberOfTests in MacTestSchemaV1Json: required")
5723 }
5724 if _, ok := raw["schema"]; raw != nil && !ok {
5725 return fmt.Errorf("field schema in MacTestSchemaV1Json: required")
5726 }
5727 if _, ok := raw["testGroups"]; raw != nil && !ok {
5728 return fmt.Errorf("field testGroups in MacTestSchemaV1Json: required")
5729 }
5730 type Plain MacTestSchemaV1Json
5731 var plain Plain
5732 if err := json.Unmarshal(value, &plain); err != nil {
5733 return err
5734 }
5735 *j = MacTestSchemaV1Json(plain)
5736 return nil
5737 }
5738
5739 type MacTestVector struct {
5740
5741 Comment string `json:"comment"`
5742
5743
5744 Flags []string `json:"flags"`
5745
5746
5747 Key string `json:"key"`
5748
5749
5750 Msg string `json:"msg"`
5751
5752
5753 Result Result `json:"result"`
5754
5755
5756 Tag string `json:"tag"`
5757
5758
5759 TcId int `json:"tcId"`
5760 }
5761
5762
5763 func (j *MacTestVector) UnmarshalJSON(value []byte) error {
5764 var raw map[string]interface{}
5765 if err := json.Unmarshal(value, &raw); err != nil {
5766 return err
5767 }
5768 if _, ok := raw["comment"]; raw != nil && !ok {
5769 return fmt.Errorf("field comment in MacTestVector: required")
5770 }
5771 if _, ok := raw["flags"]; raw != nil && !ok {
5772 return fmt.Errorf("field flags in MacTestVector: required")
5773 }
5774 if _, ok := raw["key"]; raw != nil && !ok {
5775 return fmt.Errorf("field key in MacTestVector: required")
5776 }
5777 if _, ok := raw["msg"]; raw != nil && !ok {
5778 return fmt.Errorf("field msg in MacTestVector: required")
5779 }
5780 if _, ok := raw["result"]; raw != nil && !ok {
5781 return fmt.Errorf("field result in MacTestVector: required")
5782 }
5783 if _, ok := raw["tag"]; raw != nil && !ok {
5784 return fmt.Errorf("field tag in MacTestVector: required")
5785 }
5786 if _, ok := raw["tcId"]; raw != nil && !ok {
5787 return fmt.Errorf("field tcId in MacTestVector: required")
5788 }
5789 type Plain MacTestVector
5790 var plain Plain
5791 if err := json.Unmarshal(value, &plain); err != nil {
5792 return err
5793 }
5794 *j = MacTestVector(plain)
5795 return nil
5796 }
5797
5798 type MacWithIvTestGroup struct {
5799
5800 IvSize int `json:"ivSize"`
5801
5802
5803 KeySize int `json:"keySize"`
5804
5805
5806 Source Source `json:"source"`
5807
5808
5809 TagSize int `json:"tagSize"`
5810
5811
5812 Tests []MacWithIvTestVector `json:"tests"`
5813
5814
5815 Type MacWithIvTestGroupType `json:"type"`
5816 }
5817
5818 type MacWithIvTestGroupType string
5819
5820 const MacWithIvTestGroupTypeMacWithIvTest MacWithIvTestGroupType = "MacWithIvTest"
5821
5822 var enumValues_MacWithIvTestGroupType = []interface{}{
5823 "MacWithIvTest",
5824 }
5825
5826
5827 func (j *MacWithIvTestGroupType) UnmarshalJSON(value []byte) error {
5828 var v string
5829 if err := json.Unmarshal(value, &v); err != nil {
5830 return err
5831 }
5832 var ok bool
5833 for _, expected := range enumValues_MacWithIvTestGroupType {
5834 if reflect.DeepEqual(v, expected) {
5835 ok = true
5836 break
5837 }
5838 }
5839 if !ok {
5840 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacWithIvTestGroupType, v)
5841 }
5842 *j = MacWithIvTestGroupType(v)
5843 return nil
5844 }
5845
5846
5847 func (j *MacWithIvTestGroup) UnmarshalJSON(value []byte) error {
5848 var raw map[string]interface{}
5849 if err := json.Unmarshal(value, &raw); err != nil {
5850 return err
5851 }
5852 if _, ok := raw["ivSize"]; raw != nil && !ok {
5853 return fmt.Errorf("field ivSize in MacWithIvTestGroup: required")
5854 }
5855 if _, ok := raw["keySize"]; raw != nil && !ok {
5856 return fmt.Errorf("field keySize in MacWithIvTestGroup: required")
5857 }
5858 if _, ok := raw["source"]; raw != nil && !ok {
5859 return fmt.Errorf("field source in MacWithIvTestGroup: required")
5860 }
5861 if _, ok := raw["tagSize"]; raw != nil && !ok {
5862 return fmt.Errorf("field tagSize in MacWithIvTestGroup: required")
5863 }
5864 if _, ok := raw["tests"]; raw != nil && !ok {
5865 return fmt.Errorf("field tests in MacWithIvTestGroup: required")
5866 }
5867 if _, ok := raw["type"]; raw != nil && !ok {
5868 return fmt.Errorf("field type in MacWithIvTestGroup: required")
5869 }
5870 type Plain MacWithIvTestGroup
5871 var plain Plain
5872 if err := json.Unmarshal(value, &plain); err != nil {
5873 return err
5874 }
5875 *j = MacWithIvTestGroup(plain)
5876 return nil
5877 }
5878
5879 type MacWithIvTestSchemaV1Json struct {
5880
5881 Algorithm string `json:"algorithm"`
5882
5883
5884 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
5885
5886
5887 Header []string `json:"header"`
5888
5889
5890 Notes Notes `json:"notes"`
5891
5892
5893 NumberOfTests int `json:"numberOfTests"`
5894
5895
5896 Schema MacWithIvTestSchemaV1JsonSchema `json:"schema"`
5897
5898
5899 TestGroups []MacWithIvTestGroup `json:"testGroups"`
5900 }
5901
5902 type MacWithIvTestSchemaV1JsonSchema string
5903
5904 const MacWithIvTestSchemaV1JsonSchemaMacWithIvTestSchemaV1Json MacWithIvTestSchemaV1JsonSchema = "mac_with_iv_test_schema_v1.json"
5905
5906 var enumValues_MacWithIvTestSchemaV1JsonSchema = []interface{}{
5907 "mac_with_iv_test_schema_v1.json",
5908 }
5909
5910
5911 func (j *MacWithIvTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
5912 var v string
5913 if err := json.Unmarshal(value, &v); err != nil {
5914 return err
5915 }
5916 var ok bool
5917 for _, expected := range enumValues_MacWithIvTestSchemaV1JsonSchema {
5918 if reflect.DeepEqual(v, expected) {
5919 ok = true
5920 break
5921 }
5922 }
5923 if !ok {
5924 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacWithIvTestSchemaV1JsonSchema, v)
5925 }
5926 *j = MacWithIvTestSchemaV1JsonSchema(v)
5927 return nil
5928 }
5929
5930
5931 func (j *MacWithIvTestSchemaV1Json) UnmarshalJSON(value []byte) error {
5932 var raw map[string]interface{}
5933 if err := json.Unmarshal(value, &raw); err != nil {
5934 return err
5935 }
5936 if _, ok := raw["algorithm"]; raw != nil && !ok {
5937 return fmt.Errorf("field algorithm in MacWithIvTestSchemaV1Json: required")
5938 }
5939 if _, ok := raw["header"]; raw != nil && !ok {
5940 return fmt.Errorf("field header in MacWithIvTestSchemaV1Json: required")
5941 }
5942 if _, ok := raw["notes"]; raw != nil && !ok {
5943 return fmt.Errorf("field notes in MacWithIvTestSchemaV1Json: required")
5944 }
5945 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
5946 return fmt.Errorf("field numberOfTests in MacWithIvTestSchemaV1Json: required")
5947 }
5948 if _, ok := raw["schema"]; raw != nil && !ok {
5949 return fmt.Errorf("field schema in MacWithIvTestSchemaV1Json: required")
5950 }
5951 if _, ok := raw["testGroups"]; raw != nil && !ok {
5952 return fmt.Errorf("field testGroups in MacWithIvTestSchemaV1Json: required")
5953 }
5954 type Plain MacWithIvTestSchemaV1Json
5955 var plain Plain
5956 if err := json.Unmarshal(value, &plain); err != nil {
5957 return err
5958 }
5959 *j = MacWithIvTestSchemaV1Json(plain)
5960 return nil
5961 }
5962
5963 type MacWithIvTestVector struct {
5964
5965 Comment string `json:"comment"`
5966
5967
5968 Flags []string `json:"flags"`
5969
5970
5971 Iv string `json:"iv"`
5972
5973
5974 Key string `json:"key"`
5975
5976
5977 Msg string `json:"msg"`
5978
5979
5980 Result Result `json:"result"`
5981
5982
5983 Tag string `json:"tag"`
5984
5985
5986 TcId int `json:"tcId"`
5987 }
5988
5989
5990 func (j *MacWithIvTestVector) UnmarshalJSON(value []byte) error {
5991 var raw map[string]interface{}
5992 if err := json.Unmarshal(value, &raw); err != nil {
5993 return err
5994 }
5995 if _, ok := raw["comment"]; raw != nil && !ok {
5996 return fmt.Errorf("field comment in MacWithIvTestVector: required")
5997 }
5998 if _, ok := raw["flags"]; raw != nil && !ok {
5999 return fmt.Errorf("field flags in MacWithIvTestVector: required")
6000 }
6001 if _, ok := raw["iv"]; raw != nil && !ok {
6002 return fmt.Errorf("field iv in MacWithIvTestVector: required")
6003 }
6004 if _, ok := raw["key"]; raw != nil && !ok {
6005 return fmt.Errorf("field key in MacWithIvTestVector: required")
6006 }
6007 if _, ok := raw["msg"]; raw != nil && !ok {
6008 return fmt.Errorf("field msg in MacWithIvTestVector: required")
6009 }
6010 if _, ok := raw["result"]; raw != nil && !ok {
6011 return fmt.Errorf("field result in MacWithIvTestVector: required")
6012 }
6013 if _, ok := raw["tag"]; raw != nil && !ok {
6014 return fmt.Errorf("field tag in MacWithIvTestVector: required")
6015 }
6016 if _, ok := raw["tcId"]; raw != nil && !ok {
6017 return fmt.Errorf("field tcId in MacWithIvTestVector: required")
6018 }
6019 type Plain MacWithIvTestVector
6020 var plain Plain
6021 if err := json.Unmarshal(value, &plain); err != nil {
6022 return err
6023 }
6024 *j = MacWithIvTestVector(plain)
6025 return nil
6026 }
6027
6028 type MlDsaSignNoSeedTestGroup struct {
6029
6030 PrivateKey string `json:"privateKey"`
6031
6032
6033
6034 PublicKey interface{} `json:"publicKey"`
6035
6036
6037 Source Source `json:"source"`
6038
6039
6040 Tests []MlDsaSignTestVector `json:"tests"`
6041
6042
6043 Type MlDsaSignNoSeedTestGroupType `json:"type"`
6044 }
6045
6046 type MlDsaSignNoSeedTestGroupType string
6047
6048 const MlDsaSignNoSeedTestGroupTypeMlDsaSign MlDsaSignNoSeedTestGroupType = "MlDsaSign"
6049
6050 var enumValues_MlDsaSignNoSeedTestGroupType = []interface{}{
6051 "MlDsaSign",
6052 }
6053
6054
6055 func (j *MlDsaSignNoSeedTestGroupType) UnmarshalJSON(value []byte) error {
6056 var v string
6057 if err := json.Unmarshal(value, &v); err != nil {
6058 return err
6059 }
6060 var ok bool
6061 for _, expected := range enumValues_MlDsaSignNoSeedTestGroupType {
6062 if reflect.DeepEqual(v, expected) {
6063 ok = true
6064 break
6065 }
6066 }
6067 if !ok {
6068 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlDsaSignNoSeedTestGroupType, v)
6069 }
6070 *j = MlDsaSignNoSeedTestGroupType(v)
6071 return nil
6072 }
6073
6074
6075 func (j *MlDsaSignNoSeedTestGroup) UnmarshalJSON(value []byte) error {
6076 var raw map[string]interface{}
6077 if err := json.Unmarshal(value, &raw); err != nil {
6078 return err
6079 }
6080 if _, ok := raw["privateKey"]; raw != nil && !ok {
6081 return fmt.Errorf("field privateKey in MlDsaSignNoSeedTestGroup: required")
6082 }
6083 if _, ok := raw["publicKey"]; raw != nil && !ok {
6084 return fmt.Errorf("field publicKey in MlDsaSignNoSeedTestGroup: required")
6085 }
6086 if _, ok := raw["source"]; raw != nil && !ok {
6087 return fmt.Errorf("field source in MlDsaSignNoSeedTestGroup: required")
6088 }
6089 if _, ok := raw["tests"]; raw != nil && !ok {
6090 return fmt.Errorf("field tests in MlDsaSignNoSeedTestGroup: required")
6091 }
6092 if _, ok := raw["type"]; raw != nil && !ok {
6093 return fmt.Errorf("field type in MlDsaSignNoSeedTestGroup: required")
6094 }
6095 type Plain MlDsaSignNoSeedTestGroup
6096 var plain Plain
6097 if err := json.Unmarshal(value, &plain); err != nil {
6098 return err
6099 }
6100 *j = MlDsaSignNoSeedTestGroup(plain)
6101 return nil
6102 }
6103
6104 type MlDsaSignTestGroup struct {
6105
6106 PrivateKeyPkcs8 *string `json:"privateKeyPkcs8,omitempty,omitzero"`
6107
6108
6109 PrivateSeed string `json:"privateSeed"`
6110
6111
6112
6113 PublicKey interface{} `json:"publicKey"`
6114
6115
6116 Source Source `json:"source"`
6117
6118
6119 Tests []MlDsaSignTestVector `json:"tests"`
6120
6121
6122 Type MlDsaSignTestGroupType `json:"type"`
6123 }
6124
6125 type MlDsaSignTestGroupType string
6126
6127 const MlDsaSignTestGroupTypeMlDsaSign MlDsaSignTestGroupType = "MlDsaSign"
6128
6129 var enumValues_MlDsaSignTestGroupType = []interface{}{
6130 "MlDsaSign",
6131 }
6132
6133
6134 func (j *MlDsaSignTestGroupType) UnmarshalJSON(value []byte) error {
6135 var v string
6136 if err := json.Unmarshal(value, &v); err != nil {
6137 return err
6138 }
6139 var ok bool
6140 for _, expected := range enumValues_MlDsaSignTestGroupType {
6141 if reflect.DeepEqual(v, expected) {
6142 ok = true
6143 break
6144 }
6145 }
6146 if !ok {
6147 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlDsaSignTestGroupType, v)
6148 }
6149 *j = MlDsaSignTestGroupType(v)
6150 return nil
6151 }
6152
6153
6154 func (j *MlDsaSignTestGroup) UnmarshalJSON(value []byte) error {
6155 var raw map[string]interface{}
6156 if err := json.Unmarshal(value, &raw); err != nil {
6157 return err
6158 }
6159 if _, ok := raw["privateSeed"]; raw != nil && !ok {
6160 return fmt.Errorf("field privateSeed in MlDsaSignTestGroup: required")
6161 }
6162 if _, ok := raw["publicKey"]; raw != nil && !ok {
6163 return fmt.Errorf("field publicKey in MlDsaSignTestGroup: required")
6164 }
6165 if _, ok := raw["source"]; raw != nil && !ok {
6166 return fmt.Errorf("field source in MlDsaSignTestGroup: required")
6167 }
6168 if _, ok := raw["tests"]; raw != nil && !ok {
6169 return fmt.Errorf("field tests in MlDsaSignTestGroup: required")
6170 }
6171 if _, ok := raw["type"]; raw != nil && !ok {
6172 return fmt.Errorf("field type in MlDsaSignTestGroup: required")
6173 }
6174 type Plain MlDsaSignTestGroup
6175 var plain Plain
6176 if err := json.Unmarshal(value, &plain); err != nil {
6177 return err
6178 }
6179 *j = MlDsaSignTestGroup(plain)
6180 return nil
6181 }
6182
6183 type MlDsaSignTestVector struct {
6184
6185 Comment string `json:"comment"`
6186
6187
6188
6189 Ctx *string `json:"ctx,omitempty,omitzero"`
6190
6191
6192 Flags []string `json:"flags"`
6193
6194
6195
6196 Msg *string `json:"msg,omitempty,omitzero"`
6197
6198
6199 Mu *string `json:"mu,omitempty,omitzero"`
6200
6201
6202 Result Result `json:"result"`
6203
6204
6205
6206 Rnd *string `json:"rnd,omitempty,omitzero"`
6207
6208
6209 Sig string `json:"sig"`
6210
6211
6212 TcId int `json:"tcId"`
6213 }
6214
6215
6216 func (j *MlDsaSignTestVector) UnmarshalJSON(value []byte) error {
6217 var raw map[string]interface{}
6218 if err := json.Unmarshal(value, &raw); err != nil {
6219 return err
6220 }
6221 if _, ok := raw["comment"]; raw != nil && !ok {
6222 return fmt.Errorf("field comment in MlDsaSignTestVector: required")
6223 }
6224 if _, ok := raw["flags"]; raw != nil && !ok {
6225 return fmt.Errorf("field flags in MlDsaSignTestVector: required")
6226 }
6227 if _, ok := raw["result"]; raw != nil && !ok {
6228 return fmt.Errorf("field result in MlDsaSignTestVector: required")
6229 }
6230 if _, ok := raw["sig"]; raw != nil && !ok {
6231 return fmt.Errorf("field sig in MlDsaSignTestVector: required")
6232 }
6233 if _, ok := raw["tcId"]; raw != nil && !ok {
6234 return fmt.Errorf("field tcId in MlDsaSignTestVector: required")
6235 }
6236 type Plain MlDsaSignTestVector
6237 var plain Plain
6238 if err := json.Unmarshal(value, &plain); err != nil {
6239 return err
6240 }
6241 *j = MlDsaSignTestVector(plain)
6242 return nil
6243 }
6244
6245 type MlDsaVerifyTestGroup struct {
6246
6247 PublicKey string `json:"publicKey"`
6248
6249
6250 PublicKeyDer string `json:"publicKeyDer"`
6251
6252
6253 Source *Source `json:"source,omitempty,omitzero"`
6254
6255
6256 Tests []MlDsaVerifyTestVector `json:"tests"`
6257
6258
6259 Type MlDsaVerifyTestGroupType `json:"type"`
6260 }
6261
6262 type MlDsaVerifyTestGroupType string
6263
6264 const MlDsaVerifyTestGroupTypeMlDsaVerify MlDsaVerifyTestGroupType = "MlDsaVerify"
6265
6266 var enumValues_MlDsaVerifyTestGroupType = []interface{}{
6267 "MlDsaVerify",
6268 }
6269
6270
6271 func (j *MlDsaVerifyTestGroupType) UnmarshalJSON(value []byte) error {
6272 var v string
6273 if err := json.Unmarshal(value, &v); err != nil {
6274 return err
6275 }
6276 var ok bool
6277 for _, expected := range enumValues_MlDsaVerifyTestGroupType {
6278 if reflect.DeepEqual(v, expected) {
6279 ok = true
6280 break
6281 }
6282 }
6283 if !ok {
6284 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlDsaVerifyTestGroupType, v)
6285 }
6286 *j = MlDsaVerifyTestGroupType(v)
6287 return nil
6288 }
6289
6290
6291 func (j *MlDsaVerifyTestGroup) UnmarshalJSON(value []byte) error {
6292 var raw map[string]interface{}
6293 if err := json.Unmarshal(value, &raw); err != nil {
6294 return err
6295 }
6296 if _, ok := raw["publicKey"]; raw != nil && !ok {
6297 return fmt.Errorf("field publicKey in MlDsaVerifyTestGroup: required")
6298 }
6299 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
6300 return fmt.Errorf("field publicKeyDer in MlDsaVerifyTestGroup: required")
6301 }
6302 if _, ok := raw["tests"]; raw != nil && !ok {
6303 return fmt.Errorf("field tests in MlDsaVerifyTestGroup: required")
6304 }
6305 if _, ok := raw["type"]; raw != nil && !ok {
6306 return fmt.Errorf("field type in MlDsaVerifyTestGroup: required")
6307 }
6308 type Plain MlDsaVerifyTestGroup
6309 var plain Plain
6310 if err := json.Unmarshal(value, &plain); err != nil {
6311 return err
6312 }
6313 *j = MlDsaVerifyTestGroup(plain)
6314 return nil
6315 }
6316
6317 type MlDsaVerifyTestVector struct {
6318
6319 Comment string `json:"comment"`
6320
6321
6322 Ctx *string `json:"ctx,omitempty,omitzero"`
6323
6324
6325 Flags []string `json:"flags"`
6326
6327
6328 Msg string `json:"msg"`
6329
6330
6331 Result Result `json:"result"`
6332
6333
6334 Sig string `json:"sig"`
6335
6336
6337 TcId int `json:"tcId"`
6338 }
6339
6340
6341 func (j *MlDsaVerifyTestVector) UnmarshalJSON(value []byte) error {
6342 var raw map[string]interface{}
6343 if err := json.Unmarshal(value, &raw); err != nil {
6344 return err
6345 }
6346 if _, ok := raw["comment"]; raw != nil && !ok {
6347 return fmt.Errorf("field comment in MlDsaVerifyTestVector: required")
6348 }
6349 if _, ok := raw["flags"]; raw != nil && !ok {
6350 return fmt.Errorf("field flags in MlDsaVerifyTestVector: required")
6351 }
6352 if _, ok := raw["msg"]; raw != nil && !ok {
6353 return fmt.Errorf("field msg in MlDsaVerifyTestVector: required")
6354 }
6355 if _, ok := raw["result"]; raw != nil && !ok {
6356 return fmt.Errorf("field result in MlDsaVerifyTestVector: required")
6357 }
6358 if _, ok := raw["sig"]; raw != nil && !ok {
6359 return fmt.Errorf("field sig in MlDsaVerifyTestVector: required")
6360 }
6361 if _, ok := raw["tcId"]; raw != nil && !ok {
6362 return fmt.Errorf("field tcId in MlDsaVerifyTestVector: required")
6363 }
6364 type Plain MlDsaVerifyTestVector
6365 var plain Plain
6366 if err := json.Unmarshal(value, &plain); err != nil {
6367 return err
6368 }
6369 *j = MlDsaVerifyTestVector(plain)
6370 return nil
6371 }
6372
6373 type MldsaSignNoseedSchemaJson struct {
6374
6375 Algorithm string `json:"algorithm"`
6376
6377
6378 Header []string `json:"header"`
6379
6380
6381 Notes Notes `json:"notes"`
6382
6383
6384 NumberOfTests int `json:"numberOfTests"`
6385
6386
6387 Schema MldsaSignNoseedSchemaJsonSchema `json:"schema"`
6388
6389
6390 TestGroups []MlDsaSignNoSeedTestGroup `json:"testGroups"`
6391 }
6392
6393 type MldsaSignNoseedSchemaJsonSchema string
6394
6395 const MldsaSignNoseedSchemaJsonSchemaMldsaSignNoseedSchemaJson MldsaSignNoseedSchemaJsonSchema = "mldsa_sign_noseed_schema.json"
6396
6397 var enumValues_MldsaSignNoseedSchemaJsonSchema = []interface{}{
6398 "mldsa_sign_noseed_schema.json",
6399 }
6400
6401
6402 func (j *MldsaSignNoseedSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6403 var v string
6404 if err := json.Unmarshal(value, &v); err != nil {
6405 return err
6406 }
6407 var ok bool
6408 for _, expected := range enumValues_MldsaSignNoseedSchemaJsonSchema {
6409 if reflect.DeepEqual(v, expected) {
6410 ok = true
6411 break
6412 }
6413 }
6414 if !ok {
6415 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MldsaSignNoseedSchemaJsonSchema, v)
6416 }
6417 *j = MldsaSignNoseedSchemaJsonSchema(v)
6418 return nil
6419 }
6420
6421
6422 func (j *MldsaSignNoseedSchemaJson) UnmarshalJSON(value []byte) error {
6423 var raw map[string]interface{}
6424 if err := json.Unmarshal(value, &raw); err != nil {
6425 return err
6426 }
6427 if _, ok := raw["algorithm"]; raw != nil && !ok {
6428 return fmt.Errorf("field algorithm in MldsaSignNoseedSchemaJson: required")
6429 }
6430 if _, ok := raw["header"]; raw != nil && !ok {
6431 return fmt.Errorf("field header in MldsaSignNoseedSchemaJson: required")
6432 }
6433 if _, ok := raw["notes"]; raw != nil && !ok {
6434 return fmt.Errorf("field notes in MldsaSignNoseedSchemaJson: required")
6435 }
6436 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6437 return fmt.Errorf("field numberOfTests in MldsaSignNoseedSchemaJson: required")
6438 }
6439 if _, ok := raw["schema"]; raw != nil && !ok {
6440 return fmt.Errorf("field schema in MldsaSignNoseedSchemaJson: required")
6441 }
6442 if _, ok := raw["testGroups"]; raw != nil && !ok {
6443 return fmt.Errorf("field testGroups in MldsaSignNoseedSchemaJson: required")
6444 }
6445 type Plain MldsaSignNoseedSchemaJson
6446 var plain Plain
6447 if err := json.Unmarshal(value, &plain); err != nil {
6448 return err
6449 }
6450 *j = MldsaSignNoseedSchemaJson(plain)
6451 return nil
6452 }
6453
6454 type MldsaSignSeedSchemaJson struct {
6455
6456 Algorithm string `json:"algorithm"`
6457
6458
6459 Header []string `json:"header"`
6460
6461
6462 Notes Notes `json:"notes"`
6463
6464
6465 NumberOfTests int `json:"numberOfTests"`
6466
6467
6468 Schema MldsaSignSeedSchemaJsonSchema `json:"schema"`
6469
6470
6471 TestGroups []MlDsaSignTestGroup `json:"testGroups"`
6472 }
6473
6474 type MldsaSignSeedSchemaJsonSchema string
6475
6476 const MldsaSignSeedSchemaJsonSchemaMldsaSignSeedSchemaJson MldsaSignSeedSchemaJsonSchema = "mldsa_sign_seed_schema.json"
6477
6478 var enumValues_MldsaSignSeedSchemaJsonSchema = []interface{}{
6479 "mldsa_sign_seed_schema.json",
6480 }
6481
6482
6483 func (j *MldsaSignSeedSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6484 var v string
6485 if err := json.Unmarshal(value, &v); err != nil {
6486 return err
6487 }
6488 var ok bool
6489 for _, expected := range enumValues_MldsaSignSeedSchemaJsonSchema {
6490 if reflect.DeepEqual(v, expected) {
6491 ok = true
6492 break
6493 }
6494 }
6495 if !ok {
6496 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MldsaSignSeedSchemaJsonSchema, v)
6497 }
6498 *j = MldsaSignSeedSchemaJsonSchema(v)
6499 return nil
6500 }
6501
6502
6503 func (j *MldsaSignSeedSchemaJson) UnmarshalJSON(value []byte) error {
6504 var raw map[string]interface{}
6505 if err := json.Unmarshal(value, &raw); err != nil {
6506 return err
6507 }
6508 if _, ok := raw["algorithm"]; raw != nil && !ok {
6509 return fmt.Errorf("field algorithm in MldsaSignSeedSchemaJson: required")
6510 }
6511 if _, ok := raw["header"]; raw != nil && !ok {
6512 return fmt.Errorf("field header in MldsaSignSeedSchemaJson: required")
6513 }
6514 if _, ok := raw["notes"]; raw != nil && !ok {
6515 return fmt.Errorf("field notes in MldsaSignSeedSchemaJson: required")
6516 }
6517 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6518 return fmt.Errorf("field numberOfTests in MldsaSignSeedSchemaJson: required")
6519 }
6520 if _, ok := raw["schema"]; raw != nil && !ok {
6521 return fmt.Errorf("field schema in MldsaSignSeedSchemaJson: required")
6522 }
6523 if _, ok := raw["testGroups"]; raw != nil && !ok {
6524 return fmt.Errorf("field testGroups in MldsaSignSeedSchemaJson: required")
6525 }
6526 type Plain MldsaSignSeedSchemaJson
6527 var plain Plain
6528 if err := json.Unmarshal(value, &plain); err != nil {
6529 return err
6530 }
6531 *j = MldsaSignSeedSchemaJson(plain)
6532 return nil
6533 }
6534
6535 type MldsaVerifySchemaJson struct {
6536
6537 Algorithm string `json:"algorithm"`
6538
6539
6540 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
6541
6542
6543 Header []string `json:"header"`
6544
6545
6546 Notes Notes `json:"notes"`
6547
6548
6549 NumberOfTests int `json:"numberOfTests"`
6550
6551
6552 Schema MldsaVerifySchemaJsonSchema `json:"schema"`
6553
6554
6555 TestGroups []MlDsaVerifyTestGroup `json:"testGroups"`
6556 }
6557
6558 type MldsaVerifySchemaJsonSchema string
6559
6560 const MldsaVerifySchemaJsonSchemaMldsaVerifySchemaJson MldsaVerifySchemaJsonSchema = "mldsa_verify_schema.json"
6561
6562 var enumValues_MldsaVerifySchemaJsonSchema = []interface{}{
6563 "mldsa_verify_schema.json",
6564 }
6565
6566
6567 func (j *MldsaVerifySchemaJsonSchema) UnmarshalJSON(value []byte) error {
6568 var v string
6569 if err := json.Unmarshal(value, &v); err != nil {
6570 return err
6571 }
6572 var ok bool
6573 for _, expected := range enumValues_MldsaVerifySchemaJsonSchema {
6574 if reflect.DeepEqual(v, expected) {
6575 ok = true
6576 break
6577 }
6578 }
6579 if !ok {
6580 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MldsaVerifySchemaJsonSchema, v)
6581 }
6582 *j = MldsaVerifySchemaJsonSchema(v)
6583 return nil
6584 }
6585
6586
6587 func (j *MldsaVerifySchemaJson) UnmarshalJSON(value []byte) error {
6588 var raw map[string]interface{}
6589 if err := json.Unmarshal(value, &raw); err != nil {
6590 return err
6591 }
6592 if _, ok := raw["algorithm"]; raw != nil && !ok {
6593 return fmt.Errorf("field algorithm in MldsaVerifySchemaJson: required")
6594 }
6595 if _, ok := raw["header"]; raw != nil && !ok {
6596 return fmt.Errorf("field header in MldsaVerifySchemaJson: required")
6597 }
6598 if _, ok := raw["notes"]; raw != nil && !ok {
6599 return fmt.Errorf("field notes in MldsaVerifySchemaJson: required")
6600 }
6601 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6602 return fmt.Errorf("field numberOfTests in MldsaVerifySchemaJson: required")
6603 }
6604 if _, ok := raw["schema"]; raw != nil && !ok {
6605 return fmt.Errorf("field schema in MldsaVerifySchemaJson: required")
6606 }
6607 if _, ok := raw["testGroups"]; raw != nil && !ok {
6608 return fmt.Errorf("field testGroups in MldsaVerifySchemaJson: required")
6609 }
6610 type Plain MldsaVerifySchemaJson
6611 var plain Plain
6612 if err := json.Unmarshal(value, &plain); err != nil {
6613 return err
6614 }
6615 *j = MldsaVerifySchemaJson(plain)
6616 return nil
6617 }
6618
6619 type MlkemEncapsTestSchemaJson struct {
6620
6621 Algorithm MlkemEncapsTestSchemaJsonAlgorithm `json:"algorithm"`
6622
6623
6624 Header []string `json:"header,omitempty,omitzero"`
6625
6626
6627 Notes Notes `json:"notes,omitempty,omitzero"`
6628
6629
6630 NumberOfTests int `json:"numberOfTests"`
6631
6632
6633 Schema MlkemEncapsTestSchemaJsonSchema `json:"schema"`
6634
6635
6636 TestGroups []MLKEMEncapsTestGroup `json:"testGroups"`
6637 }
6638
6639 type MlkemEncapsTestSchemaJsonAlgorithm string
6640
6641 const MlkemEncapsTestSchemaJsonAlgorithmMLKEM MlkemEncapsTestSchemaJsonAlgorithm = "ML-KEM"
6642
6643 var enumValues_MlkemEncapsTestSchemaJsonAlgorithm = []interface{}{
6644 "ML-KEM",
6645 }
6646
6647
6648 func (j *MlkemEncapsTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6649 var v string
6650 if err := json.Unmarshal(value, &v); err != nil {
6651 return err
6652 }
6653 var ok bool
6654 for _, expected := range enumValues_MlkemEncapsTestSchemaJsonAlgorithm {
6655 if reflect.DeepEqual(v, expected) {
6656 ok = true
6657 break
6658 }
6659 }
6660 if !ok {
6661 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemEncapsTestSchemaJsonAlgorithm, v)
6662 }
6663 *j = MlkemEncapsTestSchemaJsonAlgorithm(v)
6664 return nil
6665 }
6666
6667 type MlkemEncapsTestSchemaJsonSchema string
6668
6669 const MlkemEncapsTestSchemaJsonSchemaMlkemEncapsTestSchemaJson MlkemEncapsTestSchemaJsonSchema = "mlkem_encaps_test_schema.json"
6670
6671 var enumValues_MlkemEncapsTestSchemaJsonSchema = []interface{}{
6672 "mlkem_encaps_test_schema.json",
6673 }
6674
6675
6676 func (j *MlkemEncapsTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6677 var v string
6678 if err := json.Unmarshal(value, &v); err != nil {
6679 return err
6680 }
6681 var ok bool
6682 for _, expected := range enumValues_MlkemEncapsTestSchemaJsonSchema {
6683 if reflect.DeepEqual(v, expected) {
6684 ok = true
6685 break
6686 }
6687 }
6688 if !ok {
6689 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemEncapsTestSchemaJsonSchema, v)
6690 }
6691 *j = MlkemEncapsTestSchemaJsonSchema(v)
6692 return nil
6693 }
6694
6695
6696 func (j *MlkemEncapsTestSchemaJson) UnmarshalJSON(value []byte) error {
6697 var raw map[string]interface{}
6698 if err := json.Unmarshal(value, &raw); err != nil {
6699 return err
6700 }
6701 if _, ok := raw["algorithm"]; raw != nil && !ok {
6702 return fmt.Errorf("field algorithm in MlkemEncapsTestSchemaJson: required")
6703 }
6704 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6705 return fmt.Errorf("field numberOfTests in MlkemEncapsTestSchemaJson: required")
6706 }
6707 if _, ok := raw["schema"]; raw != nil && !ok {
6708 return fmt.Errorf("field schema in MlkemEncapsTestSchemaJson: required")
6709 }
6710 if _, ok := raw["testGroups"]; raw != nil && !ok {
6711 return fmt.Errorf("field testGroups in MlkemEncapsTestSchemaJson: required")
6712 }
6713 type Plain MlkemEncapsTestSchemaJson
6714 var plain Plain
6715 if err := json.Unmarshal(value, &plain); err != nil {
6716 return err
6717 }
6718 *j = MlkemEncapsTestSchemaJson(plain)
6719 return nil
6720 }
6721
6722 type MlkemKeygenSeedTestSchemaJson struct {
6723
6724 Algorithm MlkemKeygenSeedTestSchemaJsonAlgorithm `json:"algorithm"`
6725
6726
6727 Header []string `json:"header,omitempty,omitzero"`
6728
6729
6730 Notes Notes `json:"notes,omitempty,omitzero"`
6731
6732
6733 NumberOfTests int `json:"numberOfTests"`
6734
6735
6736 Schema MlkemKeygenSeedTestSchemaJsonSchema `json:"schema"`
6737
6738
6739 TestGroups []MLKEMKeyGenTestGroup `json:"testGroups"`
6740 }
6741
6742 type MlkemKeygenSeedTestSchemaJsonAlgorithm string
6743
6744 const MlkemKeygenSeedTestSchemaJsonAlgorithmMLKEM MlkemKeygenSeedTestSchemaJsonAlgorithm = "ML-KEM"
6745
6746 var enumValues_MlkemKeygenSeedTestSchemaJsonAlgorithm = []interface{}{
6747 "ML-KEM",
6748 }
6749
6750
6751 func (j *MlkemKeygenSeedTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6752 var v string
6753 if err := json.Unmarshal(value, &v); err != nil {
6754 return err
6755 }
6756 var ok bool
6757 for _, expected := range enumValues_MlkemKeygenSeedTestSchemaJsonAlgorithm {
6758 if reflect.DeepEqual(v, expected) {
6759 ok = true
6760 break
6761 }
6762 }
6763 if !ok {
6764 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemKeygenSeedTestSchemaJsonAlgorithm, v)
6765 }
6766 *j = MlkemKeygenSeedTestSchemaJsonAlgorithm(v)
6767 return nil
6768 }
6769
6770 type MlkemKeygenSeedTestSchemaJsonSchema string
6771
6772 const MlkemKeygenSeedTestSchemaJsonSchemaMlkemKeygenSeedTestSchemaJson MlkemKeygenSeedTestSchemaJsonSchema = "mlkem_keygen_seed_test_schema.json"
6773
6774 var enumValues_MlkemKeygenSeedTestSchemaJsonSchema = []interface{}{
6775 "mlkem_keygen_seed_test_schema.json",
6776 }
6777
6778
6779 func (j *MlkemKeygenSeedTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6780 var v string
6781 if err := json.Unmarshal(value, &v); err != nil {
6782 return err
6783 }
6784 var ok bool
6785 for _, expected := range enumValues_MlkemKeygenSeedTestSchemaJsonSchema {
6786 if reflect.DeepEqual(v, expected) {
6787 ok = true
6788 break
6789 }
6790 }
6791 if !ok {
6792 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemKeygenSeedTestSchemaJsonSchema, v)
6793 }
6794 *j = MlkemKeygenSeedTestSchemaJsonSchema(v)
6795 return nil
6796 }
6797
6798
6799 func (j *MlkemKeygenSeedTestSchemaJson) UnmarshalJSON(value []byte) error {
6800 var raw map[string]interface{}
6801 if err := json.Unmarshal(value, &raw); err != nil {
6802 return err
6803 }
6804 if _, ok := raw["algorithm"]; raw != nil && !ok {
6805 return fmt.Errorf("field algorithm in MlkemKeygenSeedTestSchemaJson: required")
6806 }
6807 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6808 return fmt.Errorf("field numberOfTests in MlkemKeygenSeedTestSchemaJson: required")
6809 }
6810 if _, ok := raw["schema"]; raw != nil && !ok {
6811 return fmt.Errorf("field schema in MlkemKeygenSeedTestSchemaJson: required")
6812 }
6813 if _, ok := raw["testGroups"]; raw != nil && !ok {
6814 return fmt.Errorf("field testGroups in MlkemKeygenSeedTestSchemaJson: required")
6815 }
6816 type Plain MlkemKeygenSeedTestSchemaJson
6817 var plain Plain
6818 if err := json.Unmarshal(value, &plain); err != nil {
6819 return err
6820 }
6821 *j = MlkemKeygenSeedTestSchemaJson(plain)
6822 return nil
6823 }
6824
6825 type MlkemSemiExpandedDecapsTestSchemaJson struct {
6826
6827 Algorithm MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm `json:"algorithm"`
6828
6829
6830 Header []string `json:"header,omitempty,omitzero"`
6831
6832
6833 Notes Notes `json:"notes,omitempty,omitzero"`
6834
6835
6836 NumberOfTests int `json:"numberOfTests"`
6837
6838
6839 Schema MlkemSemiExpandedDecapsTestSchemaJsonSchema `json:"schema"`
6840
6841
6842 TestGroups []MLKEMDecapsTestGroup `json:"testGroups"`
6843 }
6844
6845 type MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm string
6846
6847 const MlkemSemiExpandedDecapsTestSchemaJsonAlgorithmMLKEM MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm = "ML-KEM"
6848
6849 var enumValues_MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm = []interface{}{
6850 "ML-KEM",
6851 }
6852
6853
6854 func (j *MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6855 var v string
6856 if err := json.Unmarshal(value, &v); err != nil {
6857 return err
6858 }
6859 var ok bool
6860 for _, expected := range enumValues_MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm {
6861 if reflect.DeepEqual(v, expected) {
6862 ok = true
6863 break
6864 }
6865 }
6866 if !ok {
6867 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm, v)
6868 }
6869 *j = MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm(v)
6870 return nil
6871 }
6872
6873 type MlkemSemiExpandedDecapsTestSchemaJsonSchema string
6874
6875 const MlkemSemiExpandedDecapsTestSchemaJsonSchemaMlkemSemiExpandedDecapsTestSchemaJson MlkemSemiExpandedDecapsTestSchemaJsonSchema = "mlkem_semi_expanded_decaps_test_schema.json"
6876
6877 var enumValues_MlkemSemiExpandedDecapsTestSchemaJsonSchema = []interface{}{
6878 "mlkem_semi_expanded_decaps_test_schema.json",
6879 }
6880
6881
6882 func (j *MlkemSemiExpandedDecapsTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6883 var v string
6884 if err := json.Unmarshal(value, &v); err != nil {
6885 return err
6886 }
6887 var ok bool
6888 for _, expected := range enumValues_MlkemSemiExpandedDecapsTestSchemaJsonSchema {
6889 if reflect.DeepEqual(v, expected) {
6890 ok = true
6891 break
6892 }
6893 }
6894 if !ok {
6895 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemSemiExpandedDecapsTestSchemaJsonSchema, v)
6896 }
6897 *j = MlkemSemiExpandedDecapsTestSchemaJsonSchema(v)
6898 return nil
6899 }
6900
6901
6902 func (j *MlkemSemiExpandedDecapsTestSchemaJson) UnmarshalJSON(value []byte) error {
6903 var raw map[string]interface{}
6904 if err := json.Unmarshal(value, &raw); err != nil {
6905 return err
6906 }
6907 if _, ok := raw["algorithm"]; raw != nil && !ok {
6908 return fmt.Errorf("field algorithm in MlkemSemiExpandedDecapsTestSchemaJson: required")
6909 }
6910 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6911 return fmt.Errorf("field numberOfTests in MlkemSemiExpandedDecapsTestSchemaJson: required")
6912 }
6913 if _, ok := raw["schema"]; raw != nil && !ok {
6914 return fmt.Errorf("field schema in MlkemSemiExpandedDecapsTestSchemaJson: required")
6915 }
6916 if _, ok := raw["testGroups"]; raw != nil && !ok {
6917 return fmt.Errorf("field testGroups in MlkemSemiExpandedDecapsTestSchemaJson: required")
6918 }
6919 type Plain MlkemSemiExpandedDecapsTestSchemaJson
6920 var plain Plain
6921 if err := json.Unmarshal(value, &plain); err != nil {
6922 return err
6923 }
6924 *j = MlkemSemiExpandedDecapsTestSchemaJson(plain)
6925 return nil
6926 }
6927
6928 type MlkemTestSchemaJson struct {
6929
6930 Algorithm MlkemTestSchemaJsonAlgorithm `json:"algorithm"`
6931
6932
6933 Header []string `json:"header,omitempty,omitzero"`
6934
6935
6936 Notes Notes `json:"notes,omitempty,omitzero"`
6937
6938
6939 NumberOfTests int `json:"numberOfTests"`
6940
6941
6942 Schema MlkemTestSchemaJsonSchema `json:"schema"`
6943
6944
6945 TestGroups []MLKEMTestGroup `json:"testGroups"`
6946 }
6947
6948 type MlkemTestSchemaJsonAlgorithm string
6949
6950 const MlkemTestSchemaJsonAlgorithmMLKEM MlkemTestSchemaJsonAlgorithm = "ML-KEM"
6951
6952 var enumValues_MlkemTestSchemaJsonAlgorithm = []interface{}{
6953 "ML-KEM",
6954 }
6955
6956
6957 func (j *MlkemTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6958 var v string
6959 if err := json.Unmarshal(value, &v); err != nil {
6960 return err
6961 }
6962 var ok bool
6963 for _, expected := range enumValues_MlkemTestSchemaJsonAlgorithm {
6964 if reflect.DeepEqual(v, expected) {
6965 ok = true
6966 break
6967 }
6968 }
6969 if !ok {
6970 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemTestSchemaJsonAlgorithm, v)
6971 }
6972 *j = MlkemTestSchemaJsonAlgorithm(v)
6973 return nil
6974 }
6975
6976 type MlkemTestSchemaJsonSchema string
6977
6978 const MlkemTestSchemaJsonSchemaMlkemTestSchemaJson MlkemTestSchemaJsonSchema = "mlkem_test_schema.json"
6979
6980 var enumValues_MlkemTestSchemaJsonSchema = []interface{}{
6981 "mlkem_test_schema.json",
6982 }
6983
6984
6985 func (j *MlkemTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6986 var v string
6987 if err := json.Unmarshal(value, &v); err != nil {
6988 return err
6989 }
6990 var ok bool
6991 for _, expected := range enumValues_MlkemTestSchemaJsonSchema {
6992 if reflect.DeepEqual(v, expected) {
6993 ok = true
6994 break
6995 }
6996 }
6997 if !ok {
6998 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemTestSchemaJsonSchema, v)
6999 }
7000 *j = MlkemTestSchemaJsonSchema(v)
7001 return nil
7002 }
7003
7004
7005 func (j *MlkemTestSchemaJson) UnmarshalJSON(value []byte) error {
7006 var raw map[string]interface{}
7007 if err := json.Unmarshal(value, &raw); err != nil {
7008 return err
7009 }
7010 if _, ok := raw["algorithm"]; raw != nil && !ok {
7011 return fmt.Errorf("field algorithm in MlkemTestSchemaJson: required")
7012 }
7013 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7014 return fmt.Errorf("field numberOfTests in MlkemTestSchemaJson: required")
7015 }
7016 if _, ok := raw["schema"]; raw != nil && !ok {
7017 return fmt.Errorf("field schema in MlkemTestSchemaJson: required")
7018 }
7019 if _, ok := raw["testGroups"]; raw != nil && !ok {
7020 return fmt.Errorf("field testGroups in MlkemTestSchemaJson: required")
7021 }
7022 type Plain MlkemTestSchemaJson
7023 var plain Plain
7024 if err := json.Unmarshal(value, &plain); err != nil {
7025 return err
7026 }
7027 *j = MlkemTestSchemaJson(plain)
7028 return nil
7029 }
7030
7031 type NoteEntry struct {
7032
7033 BugType string `json:"bugType"`
7034
7035
7036 Cves []string `json:"cves,omitempty,omitzero"`
7037
7038
7039 Description *string `json:"description,omitempty,omitzero"`
7040
7041
7042 Effect *string `json:"effect,omitempty,omitzero"`
7043
7044
7045 Links []string `json:"links,omitempty,omitzero"`
7046 }
7047
7048
7049 func (j *NoteEntry) UnmarshalJSON(value []byte) error {
7050 var raw map[string]interface{}
7051 if err := json.Unmarshal(value, &raw); err != nil {
7052 return err
7053 }
7054 if _, ok := raw["bugType"]; raw != nil && !ok {
7055 return fmt.Errorf("field bugType in NoteEntry: required")
7056 }
7057 type Plain NoteEntry
7058 var plain Plain
7059 if err := json.Unmarshal(value, &plain); err != nil {
7060 return err
7061 }
7062 *j = NoteEntry(plain)
7063 return nil
7064 }
7065
7066 type Notes map[string]NoteEntry
7067
7068 type PbkdfTestGroup struct {
7069
7070 Source *Source `json:"source,omitempty,omitzero"`
7071
7072
7073 Tests []PbkdfTestVector `json:"tests"`
7074
7075
7076 Type PbkdfTestGroupType `json:"type"`
7077 }
7078
7079 type PbkdfTestGroupType string
7080
7081 const PbkdfTestGroupTypePbkdfTest PbkdfTestGroupType = "PbkdfTest"
7082
7083 var enumValues_PbkdfTestGroupType = []interface{}{
7084 "PbkdfTest",
7085 }
7086
7087
7088 func (j *PbkdfTestGroupType) UnmarshalJSON(value []byte) error {
7089 var v string
7090 if err := json.Unmarshal(value, &v); err != nil {
7091 return err
7092 }
7093 var ok bool
7094 for _, expected := range enumValues_PbkdfTestGroupType {
7095 if reflect.DeepEqual(v, expected) {
7096 ok = true
7097 break
7098 }
7099 }
7100 if !ok {
7101 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PbkdfTestGroupType, v)
7102 }
7103 *j = PbkdfTestGroupType(v)
7104 return nil
7105 }
7106
7107
7108 func (j *PbkdfTestGroup) UnmarshalJSON(value []byte) error {
7109 var raw map[string]interface{}
7110 if err := json.Unmarshal(value, &raw); err != nil {
7111 return err
7112 }
7113 if _, ok := raw["tests"]; raw != nil && !ok {
7114 return fmt.Errorf("field tests in PbkdfTestGroup: required")
7115 }
7116 if _, ok := raw["type"]; raw != nil && !ok {
7117 return fmt.Errorf("field type in PbkdfTestGroup: required")
7118 }
7119 type Plain PbkdfTestGroup
7120 var plain Plain
7121 if err := json.Unmarshal(value, &plain); err != nil {
7122 return err
7123 }
7124 *j = PbkdfTestGroup(plain)
7125 return nil
7126 }
7127
7128 type PbkdfTestSchemaJson struct {
7129
7130 Algorithm PbkdfTestSchemaJsonAlgorithm `json:"algorithm"`
7131
7132
7133 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
7134
7135
7136 Header []string `json:"header"`
7137
7138
7139 Notes Notes `json:"notes"`
7140
7141
7142 NumberOfTests int `json:"numberOfTests"`
7143
7144
7145 Schema PbkdfTestSchemaJsonSchema `json:"schema"`
7146
7147
7148 TestGroups []PbkdfTestGroup `json:"testGroups"`
7149 }
7150
7151 type PbkdfTestSchemaJsonAlgorithm string
7152
7153 const PbkdfTestSchemaJsonAlgorithmPBKDF2HMACSHA1 PbkdfTestSchemaJsonAlgorithm = "PBKDF2-HMACSHA1"
7154 const PbkdfTestSchemaJsonAlgorithmPBKDF2HMACSHA224 PbkdfTestSchemaJsonAlgorithm = "PBKDF2-HMACSHA224"
7155 const PbkdfTestSchemaJsonAlgorithmPBKDF2HMACSHA256 PbkdfTestSchemaJsonAlgorithm = "PBKDF2-HMACSHA256"
7156 const PbkdfTestSchemaJsonAlgorithmPBKDF2HMACSHA384 PbkdfTestSchemaJsonAlgorithm = "PBKDF2-HMACSHA384"
7157 const PbkdfTestSchemaJsonAlgorithmPBKDF2HMACSHA512 PbkdfTestSchemaJsonAlgorithm = "PBKDF2-HMACSHA512"
7158
7159 var enumValues_PbkdfTestSchemaJsonAlgorithm = []interface{}{
7160 "PBKDF2-HMACSHA1",
7161 "PBKDF2-HMACSHA224",
7162 "PBKDF2-HMACSHA256",
7163 "PBKDF2-HMACSHA384",
7164 "PBKDF2-HMACSHA512",
7165 }
7166
7167
7168 func (j *PbkdfTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
7169 var v string
7170 if err := json.Unmarshal(value, &v); err != nil {
7171 return err
7172 }
7173 var ok bool
7174 for _, expected := range enumValues_PbkdfTestSchemaJsonAlgorithm {
7175 if reflect.DeepEqual(v, expected) {
7176 ok = true
7177 break
7178 }
7179 }
7180 if !ok {
7181 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PbkdfTestSchemaJsonAlgorithm, v)
7182 }
7183 *j = PbkdfTestSchemaJsonAlgorithm(v)
7184 return nil
7185 }
7186
7187 type PbkdfTestSchemaJsonSchema string
7188
7189 const PbkdfTestSchemaJsonSchemaPbkdfTestSchemaJson PbkdfTestSchemaJsonSchema = "pbkdf_test_schema.json"
7190
7191 var enumValues_PbkdfTestSchemaJsonSchema = []interface{}{
7192 "pbkdf_test_schema.json",
7193 }
7194
7195
7196 func (j *PbkdfTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
7197 var v string
7198 if err := json.Unmarshal(value, &v); err != nil {
7199 return err
7200 }
7201 var ok bool
7202 for _, expected := range enumValues_PbkdfTestSchemaJsonSchema {
7203 if reflect.DeepEqual(v, expected) {
7204 ok = true
7205 break
7206 }
7207 }
7208 if !ok {
7209 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PbkdfTestSchemaJsonSchema, v)
7210 }
7211 *j = PbkdfTestSchemaJsonSchema(v)
7212 return nil
7213 }
7214
7215
7216 func (j *PbkdfTestSchemaJson) UnmarshalJSON(value []byte) error {
7217 var raw map[string]interface{}
7218 if err := json.Unmarshal(value, &raw); err != nil {
7219 return err
7220 }
7221 if _, ok := raw["algorithm"]; raw != nil && !ok {
7222 return fmt.Errorf("field algorithm in PbkdfTestSchemaJson: required")
7223 }
7224 if _, ok := raw["header"]; raw != nil && !ok {
7225 return fmt.Errorf("field header in PbkdfTestSchemaJson: required")
7226 }
7227 if _, ok := raw["notes"]; raw != nil && !ok {
7228 return fmt.Errorf("field notes in PbkdfTestSchemaJson: required")
7229 }
7230 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7231 return fmt.Errorf("field numberOfTests in PbkdfTestSchemaJson: required")
7232 }
7233 if _, ok := raw["schema"]; raw != nil && !ok {
7234 return fmt.Errorf("field schema in PbkdfTestSchemaJson: required")
7235 }
7236 if _, ok := raw["testGroups"]; raw != nil && !ok {
7237 return fmt.Errorf("field testGroups in PbkdfTestSchemaJson: required")
7238 }
7239 type Plain PbkdfTestSchemaJson
7240 var plain Plain
7241 if err := json.Unmarshal(value, &plain); err != nil {
7242 return err
7243 }
7244 *j = PbkdfTestSchemaJson(plain)
7245 return nil
7246 }
7247
7248 type PbkdfTestVector struct {
7249
7250 Comment string `json:"comment"`
7251
7252
7253 Dk string `json:"dk"`
7254
7255
7256 DkLen int `json:"dkLen"`
7257
7258
7259 Flags []string `json:"flags"`
7260
7261
7262 IterationCount int `json:"iterationCount"`
7263
7264
7265 Password string `json:"password"`
7266
7267
7268 Result Result `json:"result"`
7269
7270
7271 Salt string `json:"salt"`
7272
7273
7274 TcId int `json:"tcId"`
7275 }
7276
7277
7278 func (j *PbkdfTestVector) UnmarshalJSON(value []byte) error {
7279 var raw map[string]interface{}
7280 if err := json.Unmarshal(value, &raw); err != nil {
7281 return err
7282 }
7283 if _, ok := raw["comment"]; raw != nil && !ok {
7284 return fmt.Errorf("field comment in PbkdfTestVector: required")
7285 }
7286 if _, ok := raw["dk"]; raw != nil && !ok {
7287 return fmt.Errorf("field dk in PbkdfTestVector: required")
7288 }
7289 if _, ok := raw["dkLen"]; raw != nil && !ok {
7290 return fmt.Errorf("field dkLen in PbkdfTestVector: required")
7291 }
7292 if _, ok := raw["flags"]; raw != nil && !ok {
7293 return fmt.Errorf("field flags in PbkdfTestVector: required")
7294 }
7295 if _, ok := raw["iterationCount"]; raw != nil && !ok {
7296 return fmt.Errorf("field iterationCount in PbkdfTestVector: required")
7297 }
7298 if _, ok := raw["password"]; raw != nil && !ok {
7299 return fmt.Errorf("field password in PbkdfTestVector: required")
7300 }
7301 if _, ok := raw["result"]; raw != nil && !ok {
7302 return fmt.Errorf("field result in PbkdfTestVector: required")
7303 }
7304 if _, ok := raw["salt"]; raw != nil && !ok {
7305 return fmt.Errorf("field salt in PbkdfTestVector: required")
7306 }
7307 if _, ok := raw["tcId"]; raw != nil && !ok {
7308 return fmt.Errorf("field tcId in PbkdfTestVector: required")
7309 }
7310 type Plain PbkdfTestVector
7311 var plain Plain
7312 if err := json.Unmarshal(value, &plain); err != nil {
7313 return err
7314 }
7315 *j = PbkdfTestVector(plain)
7316 return nil
7317 }
7318
7319 type PrimalityTestGroup struct {
7320
7321 Source Source `json:"source"`
7322
7323
7324 Tests []PrimalityTestVector `json:"tests"`
7325
7326
7327 Type PrimalityTestGroupType `json:"type"`
7328 }
7329
7330 type PrimalityTestGroupType string
7331
7332 const PrimalityTestGroupTypePrimalityTest PrimalityTestGroupType = "PrimalityTest"
7333
7334 var enumValues_PrimalityTestGroupType = []interface{}{
7335 "PrimalityTest",
7336 }
7337
7338
7339 func (j *PrimalityTestGroupType) UnmarshalJSON(value []byte) error {
7340 var v string
7341 if err := json.Unmarshal(value, &v); err != nil {
7342 return err
7343 }
7344 var ok bool
7345 for _, expected := range enumValues_PrimalityTestGroupType {
7346 if reflect.DeepEqual(v, expected) {
7347 ok = true
7348 break
7349 }
7350 }
7351 if !ok {
7352 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PrimalityTestGroupType, v)
7353 }
7354 *j = PrimalityTestGroupType(v)
7355 return nil
7356 }
7357
7358
7359 func (j *PrimalityTestGroup) UnmarshalJSON(value []byte) error {
7360 var raw map[string]interface{}
7361 if err := json.Unmarshal(value, &raw); err != nil {
7362 return err
7363 }
7364 if _, ok := raw["source"]; raw != nil && !ok {
7365 return fmt.Errorf("field source in PrimalityTestGroup: required")
7366 }
7367 if _, ok := raw["tests"]; raw != nil && !ok {
7368 return fmt.Errorf("field tests in PrimalityTestGroup: required")
7369 }
7370 if _, ok := raw["type"]; raw != nil && !ok {
7371 return fmt.Errorf("field type in PrimalityTestGroup: required")
7372 }
7373 type Plain PrimalityTestGroup
7374 var plain Plain
7375 if err := json.Unmarshal(value, &plain); err != nil {
7376 return err
7377 }
7378 *j = PrimalityTestGroup(plain)
7379 return nil
7380 }
7381
7382 type PrimalityTestSchemaV1Json struct {
7383
7384 Algorithm string `json:"algorithm"`
7385
7386
7387 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
7388
7389
7390 Header []string `json:"header"`
7391
7392
7393 Notes Notes `json:"notes"`
7394
7395
7396 NumberOfTests int `json:"numberOfTests"`
7397
7398
7399 Schema PrimalityTestSchemaV1JsonSchema `json:"schema"`
7400
7401
7402 TestGroups []PrimalityTestGroup `json:"testGroups"`
7403 }
7404
7405 type PrimalityTestSchemaV1JsonSchema string
7406
7407 const PrimalityTestSchemaV1JsonSchemaPrimalityTestSchemaV1Json PrimalityTestSchemaV1JsonSchema = "primality_test_schema_v1.json"
7408
7409 var enumValues_PrimalityTestSchemaV1JsonSchema = []interface{}{
7410 "primality_test_schema_v1.json",
7411 }
7412
7413
7414 func (j *PrimalityTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7415 var v string
7416 if err := json.Unmarshal(value, &v); err != nil {
7417 return err
7418 }
7419 var ok bool
7420 for _, expected := range enumValues_PrimalityTestSchemaV1JsonSchema {
7421 if reflect.DeepEqual(v, expected) {
7422 ok = true
7423 break
7424 }
7425 }
7426 if !ok {
7427 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PrimalityTestSchemaV1JsonSchema, v)
7428 }
7429 *j = PrimalityTestSchemaV1JsonSchema(v)
7430 return nil
7431 }
7432
7433
7434 func (j *PrimalityTestSchemaV1Json) UnmarshalJSON(value []byte) error {
7435 var raw map[string]interface{}
7436 if err := json.Unmarshal(value, &raw); err != nil {
7437 return err
7438 }
7439 if _, ok := raw["algorithm"]; raw != nil && !ok {
7440 return fmt.Errorf("field algorithm in PrimalityTestSchemaV1Json: required")
7441 }
7442 if _, ok := raw["header"]; raw != nil && !ok {
7443 return fmt.Errorf("field header in PrimalityTestSchemaV1Json: required")
7444 }
7445 if _, ok := raw["notes"]; raw != nil && !ok {
7446 return fmt.Errorf("field notes in PrimalityTestSchemaV1Json: required")
7447 }
7448 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7449 return fmt.Errorf("field numberOfTests in PrimalityTestSchemaV1Json: required")
7450 }
7451 if _, ok := raw["schema"]; raw != nil && !ok {
7452 return fmt.Errorf("field schema in PrimalityTestSchemaV1Json: required")
7453 }
7454 if _, ok := raw["testGroups"]; raw != nil && !ok {
7455 return fmt.Errorf("field testGroups in PrimalityTestSchemaV1Json: required")
7456 }
7457 type Plain PrimalityTestSchemaV1Json
7458 var plain Plain
7459 if err := json.Unmarshal(value, &plain); err != nil {
7460 return err
7461 }
7462 *j = PrimalityTestSchemaV1Json(plain)
7463 return nil
7464 }
7465
7466 type PrimalityTestVector struct {
7467
7468 Comment string `json:"comment"`
7469
7470
7471 Flags []string `json:"flags"`
7472
7473
7474 Result Result `json:"result"`
7475
7476
7477 TcId int `json:"tcId"`
7478
7479
7480 Value string `json:"value"`
7481 }
7482
7483
7484 func (j *PrimalityTestVector) UnmarshalJSON(value []byte) error {
7485 var raw map[string]interface{}
7486 if err := json.Unmarshal(value, &raw); err != nil {
7487 return err
7488 }
7489 if _, ok := raw["comment"]; raw != nil && !ok {
7490 return fmt.Errorf("field comment in PrimalityTestVector: required")
7491 }
7492 if _, ok := raw["flags"]; raw != nil && !ok {
7493 return fmt.Errorf("field flags in PrimalityTestVector: required")
7494 }
7495 if _, ok := raw["result"]; raw != nil && !ok {
7496 return fmt.Errorf("field result in PrimalityTestVector: required")
7497 }
7498 if _, ok := raw["tcId"]; raw != nil && !ok {
7499 return fmt.Errorf("field tcId in PrimalityTestVector: required")
7500 }
7501 if _, ok := raw["value"]; raw != nil && !ok {
7502 return fmt.Errorf("field value in PrimalityTestVector: required")
7503 }
7504 type Plain PrimalityTestVector
7505 var plain Plain
7506 if err := json.Unmarshal(value, &plain); err != nil {
7507 return err
7508 }
7509 *j = PrimalityTestVector(plain)
7510 return nil
7511 }
7512
7513 type PrivateKey struct {
7514
7515 Coefficient *string `json:"coefficient,omitempty,omitzero"`
7516
7517
7518 Exponent1 *string `json:"exponent1,omitempty,omitzero"`
7519
7520
7521 Exponent2 *string `json:"exponent2,omitempty,omitzero"`
7522
7523
7524 Modulus string `json:"modulus"`
7525
7526
7527 OtherPrimeInfos [][]string `json:"otherPrimeInfos,omitempty,omitzero"`
7528
7529
7530 Prime1 *string `json:"prime1,omitempty,omitzero"`
7531
7532
7533 Prime2 *string `json:"prime2,omitempty,omitzero"`
7534
7535
7536 PrivateExponent string `json:"privateExponent"`
7537
7538
7539 PublicExponent string `json:"publicExponent"`
7540 }
7541
7542
7543 func (j *PrivateKey) UnmarshalJSON(value []byte) error {
7544 var raw map[string]interface{}
7545 if err := json.Unmarshal(value, &raw); err != nil {
7546 return err
7547 }
7548 if _, ok := raw["modulus"]; raw != nil && !ok {
7549 return fmt.Errorf("field modulus in PrivateKey: required")
7550 }
7551 if _, ok := raw["privateExponent"]; raw != nil && !ok {
7552 return fmt.Errorf("field privateExponent in PrivateKey: required")
7553 }
7554 if _, ok := raw["publicExponent"]; raw != nil && !ok {
7555 return fmt.Errorf("field publicExponent in PrivateKey: required")
7556 }
7557 type Plain PrivateKey
7558 var plain Plain
7559 if err := json.Unmarshal(value, &plain); err != nil {
7560 return err
7561 }
7562 *j = PrivateKey(plain)
7563 return nil
7564 }
7565
7566 type PublicKey struct {
7567
7568 Curve string `json:"curve"`
7569
7570
7571 KeySize int `json:"keySize"`
7572
7573
7574 Pk string `json:"pk"`
7575
7576
7577 Type PublicKeyType `json:"type"`
7578 }
7579
7580 type PublicKeyType string
7581
7582 const PublicKeyTypeECDSAPublicKey PublicKeyType = "ECDSAPublicKey"
7583 const PublicKeyTypeEDDSAPublicKey PublicKeyType = "EDDSAPublicKey"
7584
7585 var enumValues_PublicKeyType = []interface{}{
7586 "ECDSAPublicKey",
7587 "EDDSAPublicKey",
7588 }
7589
7590
7591 func (j *PublicKeyType) UnmarshalJSON(value []byte) error {
7592 var v string
7593 if err := json.Unmarshal(value, &v); err != nil {
7594 return err
7595 }
7596 var ok bool
7597 for _, expected := range enumValues_PublicKeyType {
7598 if reflect.DeepEqual(v, expected) {
7599 ok = true
7600 break
7601 }
7602 }
7603 if !ok {
7604 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PublicKeyType, v)
7605 }
7606 *j = PublicKeyType(v)
7607 return nil
7608 }
7609
7610
7611 func (j *PublicKey) UnmarshalJSON(value []byte) error {
7612 var raw map[string]interface{}
7613 if err := json.Unmarshal(value, &raw); err != nil {
7614 return err
7615 }
7616 if _, ok := raw["curve"]; raw != nil && !ok {
7617 return fmt.Errorf("field curve in PublicKey: required")
7618 }
7619 if _, ok := raw["keySize"]; raw != nil && !ok {
7620 return fmt.Errorf("field keySize in PublicKey: required")
7621 }
7622 if _, ok := raw["pk"]; raw != nil && !ok {
7623 return fmt.Errorf("field pk in PublicKey: required")
7624 }
7625 if _, ok := raw["type"]; raw != nil && !ok {
7626 return fmt.Errorf("field type in PublicKey: required")
7627 }
7628 type Plain PublicKey
7629 var plain Plain
7630 if err := json.Unmarshal(value, &plain); err != nil {
7631 return err
7632 }
7633 *j = PublicKey(plain)
7634 return nil
7635 }
7636
7637
7638 type Recipient struct {
7639
7640 EncryptedKey *string `json:"encrypted_key,omitempty,omitzero"`
7641
7642
7643 Header RecipientHeader `json:"header,omitempty,omitzero"`
7644 }
7645
7646
7647 type RecipientHeader map[string]interface{}
7648
7649 type Result string
7650
7651 const ResultAcceptable Result = "acceptable"
7652 const ResultInvalid Result = "invalid"
7653 const ResultValid Result = "valid"
7654
7655 var enumValues_Result = []interface{}{
7656 "valid",
7657 "invalid",
7658 "acceptable",
7659 }
7660
7661
7662 func (j *Result) UnmarshalJSON(value []byte) error {
7663 var v string
7664 if err := json.Unmarshal(value, &v); err != nil {
7665 return err
7666 }
7667 var ok bool
7668 for _, expected := range enumValues_Result {
7669 if reflect.DeepEqual(v, expected) {
7670 ok = true
7671 break
7672 }
7673 }
7674 if !ok {
7675 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_Result, v)
7676 }
7677 *j = Result(v)
7678 return nil
7679 }
7680
7681 type RsaesOaepDecryptSchemaV1Json struct {
7682
7683 Algorithm string `json:"algorithm"`
7684
7685
7686 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
7687
7688
7689 Header []string `json:"header"`
7690
7691
7692 Notes Notes `json:"notes"`
7693
7694
7695 NumberOfTests int `json:"numberOfTests"`
7696
7697
7698 Schema RsaesOaepDecryptSchemaV1JsonSchema `json:"schema"`
7699
7700
7701 TestGroups []RsaesOaepTestGroup `json:"testGroups"`
7702 }
7703
7704 type RsaesOaepDecryptSchemaV1JsonSchema string
7705
7706 const RsaesOaepDecryptSchemaV1JsonSchemaRsaesOaepDecryptSchemaV1Json RsaesOaepDecryptSchemaV1JsonSchema = "rsaes_oaep_decrypt_schema_v1.json"
7707
7708 var enumValues_RsaesOaepDecryptSchemaV1JsonSchema = []interface{}{
7709 "rsaes_oaep_decrypt_schema_v1.json",
7710 }
7711
7712
7713 func (j *RsaesOaepDecryptSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7714 var v string
7715 if err := json.Unmarshal(value, &v); err != nil {
7716 return err
7717 }
7718 var ok bool
7719 for _, expected := range enumValues_RsaesOaepDecryptSchemaV1JsonSchema {
7720 if reflect.DeepEqual(v, expected) {
7721 ok = true
7722 break
7723 }
7724 }
7725 if !ok {
7726 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesOaepDecryptSchemaV1JsonSchema, v)
7727 }
7728 *j = RsaesOaepDecryptSchemaV1JsonSchema(v)
7729 return nil
7730 }
7731
7732
7733 func (j *RsaesOaepDecryptSchemaV1Json) UnmarshalJSON(value []byte) error {
7734 var raw map[string]interface{}
7735 if err := json.Unmarshal(value, &raw); err != nil {
7736 return err
7737 }
7738 if _, ok := raw["algorithm"]; raw != nil && !ok {
7739 return fmt.Errorf("field algorithm in RsaesOaepDecryptSchemaV1Json: required")
7740 }
7741 if _, ok := raw["header"]; raw != nil && !ok {
7742 return fmt.Errorf("field header in RsaesOaepDecryptSchemaV1Json: required")
7743 }
7744 if _, ok := raw["notes"]; raw != nil && !ok {
7745 return fmt.Errorf("field notes in RsaesOaepDecryptSchemaV1Json: required")
7746 }
7747 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7748 return fmt.Errorf("field numberOfTests in RsaesOaepDecryptSchemaV1Json: required")
7749 }
7750 if _, ok := raw["schema"]; raw != nil && !ok {
7751 return fmt.Errorf("field schema in RsaesOaepDecryptSchemaV1Json: required")
7752 }
7753 if _, ok := raw["testGroups"]; raw != nil && !ok {
7754 return fmt.Errorf("field testGroups in RsaesOaepDecryptSchemaV1Json: required")
7755 }
7756 type Plain RsaesOaepDecryptSchemaV1Json
7757 var plain Plain
7758 if err := json.Unmarshal(value, &plain); err != nil {
7759 return err
7760 }
7761 *j = RsaesOaepDecryptSchemaV1Json(plain)
7762 return nil
7763 }
7764
7765 type RsaesOaepTestGroup struct {
7766
7767 KeySize int `json:"keySize"`
7768
7769
7770 Mgf string `json:"mgf"`
7771
7772
7773 MgfSha string `json:"mgfSha"`
7774
7775
7776 PrivateKey PrivateKey `json:"privateKey"`
7777
7778
7779 PrivateKeyJwk *JsonWebKey `json:"privateKeyJwk,omitempty,omitzero"`
7780
7781
7782 PrivateKeyPem string `json:"privateKeyPem"`
7783
7784
7785 PrivateKeyPkcs8 string `json:"privateKeyPkcs8"`
7786
7787
7788 Sha string `json:"sha"`
7789
7790
7791 Source Source `json:"source"`
7792
7793
7794 Tests []RsaesOaepTestVector `json:"tests"`
7795
7796
7797 Type RsaesOaepTestGroupType `json:"type"`
7798 }
7799
7800 type RsaesOaepTestGroupType string
7801
7802 const RsaesOaepTestGroupTypeRsaesOaepDecrypt RsaesOaepTestGroupType = "RsaesOaepDecrypt"
7803
7804 var enumValues_RsaesOaepTestGroupType = []interface{}{
7805 "RsaesOaepDecrypt",
7806 }
7807
7808
7809 func (j *RsaesOaepTestGroupType) UnmarshalJSON(value []byte) error {
7810 var v string
7811 if err := json.Unmarshal(value, &v); err != nil {
7812 return err
7813 }
7814 var ok bool
7815 for _, expected := range enumValues_RsaesOaepTestGroupType {
7816 if reflect.DeepEqual(v, expected) {
7817 ok = true
7818 break
7819 }
7820 }
7821 if !ok {
7822 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesOaepTestGroupType, v)
7823 }
7824 *j = RsaesOaepTestGroupType(v)
7825 return nil
7826 }
7827
7828
7829 func (j *RsaesOaepTestGroup) UnmarshalJSON(value []byte) error {
7830 var raw map[string]interface{}
7831 if err := json.Unmarshal(value, &raw); err != nil {
7832 return err
7833 }
7834 if _, ok := raw["keySize"]; raw != nil && !ok {
7835 return fmt.Errorf("field keySize in RsaesOaepTestGroup: required")
7836 }
7837 if _, ok := raw["mgf"]; raw != nil && !ok {
7838 return fmt.Errorf("field mgf in RsaesOaepTestGroup: required")
7839 }
7840 if _, ok := raw["mgfSha"]; raw != nil && !ok {
7841 return fmt.Errorf("field mgfSha in RsaesOaepTestGroup: required")
7842 }
7843 if _, ok := raw["privateKey"]; raw != nil && !ok {
7844 return fmt.Errorf("field privateKey in RsaesOaepTestGroup: required")
7845 }
7846 if _, ok := raw["privateKeyPem"]; raw != nil && !ok {
7847 return fmt.Errorf("field privateKeyPem in RsaesOaepTestGroup: required")
7848 }
7849 if _, ok := raw["privateKeyPkcs8"]; raw != nil && !ok {
7850 return fmt.Errorf("field privateKeyPkcs8 in RsaesOaepTestGroup: required")
7851 }
7852 if _, ok := raw["sha"]; raw != nil && !ok {
7853 return fmt.Errorf("field sha in RsaesOaepTestGroup: required")
7854 }
7855 if _, ok := raw["source"]; raw != nil && !ok {
7856 return fmt.Errorf("field source in RsaesOaepTestGroup: required")
7857 }
7858 if _, ok := raw["tests"]; raw != nil && !ok {
7859 return fmt.Errorf("field tests in RsaesOaepTestGroup: required")
7860 }
7861 if _, ok := raw["type"]; raw != nil && !ok {
7862 return fmt.Errorf("field type in RsaesOaepTestGroup: required")
7863 }
7864 type Plain RsaesOaepTestGroup
7865 var plain Plain
7866 if err := json.Unmarshal(value, &plain); err != nil {
7867 return err
7868 }
7869 *j = RsaesOaepTestGroup(plain)
7870 return nil
7871 }
7872
7873 type RsaesOaepTestVector struct {
7874
7875 Comment string `json:"comment"`
7876
7877
7878 Ct string `json:"ct"`
7879
7880
7881 Flags []string `json:"flags"`
7882
7883
7884 Label string `json:"label"`
7885
7886
7887 Msg string `json:"msg"`
7888
7889
7890 Result Result `json:"result"`
7891
7892
7893 TcId int `json:"tcId"`
7894 }
7895
7896
7897 func (j *RsaesOaepTestVector) UnmarshalJSON(value []byte) error {
7898 var raw map[string]interface{}
7899 if err := json.Unmarshal(value, &raw); err != nil {
7900 return err
7901 }
7902 if _, ok := raw["comment"]; raw != nil && !ok {
7903 return fmt.Errorf("field comment in RsaesOaepTestVector: required")
7904 }
7905 if _, ok := raw["ct"]; raw != nil && !ok {
7906 return fmt.Errorf("field ct in RsaesOaepTestVector: required")
7907 }
7908 if _, ok := raw["flags"]; raw != nil && !ok {
7909 return fmt.Errorf("field flags in RsaesOaepTestVector: required")
7910 }
7911 if _, ok := raw["label"]; raw != nil && !ok {
7912 return fmt.Errorf("field label in RsaesOaepTestVector: required")
7913 }
7914 if _, ok := raw["msg"]; raw != nil && !ok {
7915 return fmt.Errorf("field msg in RsaesOaepTestVector: required")
7916 }
7917 if _, ok := raw["result"]; raw != nil && !ok {
7918 return fmt.Errorf("field result in RsaesOaepTestVector: required")
7919 }
7920 if _, ok := raw["tcId"]; raw != nil && !ok {
7921 return fmt.Errorf("field tcId in RsaesOaepTestVector: required")
7922 }
7923 type Plain RsaesOaepTestVector
7924 var plain Plain
7925 if err := json.Unmarshal(value, &plain); err != nil {
7926 return err
7927 }
7928 *j = RsaesOaepTestVector(plain)
7929 return nil
7930 }
7931
7932 type RsaesPkcs1DecryptSchemaV1Json struct {
7933
7934 Algorithm string `json:"algorithm"`
7935
7936
7937 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
7938
7939
7940 Header []string `json:"header"`
7941
7942
7943 Notes Notes `json:"notes"`
7944
7945
7946 NumberOfTests int `json:"numberOfTests"`
7947
7948
7949 Schema RsaesPkcs1DecryptSchemaV1JsonSchema `json:"schema"`
7950
7951
7952 TestGroups []RsaesPkcs1TestGroup `json:"testGroups"`
7953 }
7954
7955 type RsaesPkcs1DecryptSchemaV1JsonSchema string
7956
7957 const RsaesPkcs1DecryptSchemaV1JsonSchemaRsaesPkcs1DecryptSchemaV1Json RsaesPkcs1DecryptSchemaV1JsonSchema = "rsaes_pkcs1_decrypt_schema_v1.json"
7958
7959 var enumValues_RsaesPkcs1DecryptSchemaV1JsonSchema = []interface{}{
7960 "rsaes_pkcs1_decrypt_schema_v1.json",
7961 }
7962
7963
7964 func (j *RsaesPkcs1DecryptSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7965 var v string
7966 if err := json.Unmarshal(value, &v); err != nil {
7967 return err
7968 }
7969 var ok bool
7970 for _, expected := range enumValues_RsaesPkcs1DecryptSchemaV1JsonSchema {
7971 if reflect.DeepEqual(v, expected) {
7972 ok = true
7973 break
7974 }
7975 }
7976 if !ok {
7977 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesPkcs1DecryptSchemaV1JsonSchema, v)
7978 }
7979 *j = RsaesPkcs1DecryptSchemaV1JsonSchema(v)
7980 return nil
7981 }
7982
7983
7984 func (j *RsaesPkcs1DecryptSchemaV1Json) UnmarshalJSON(value []byte) error {
7985 var raw map[string]interface{}
7986 if err := json.Unmarshal(value, &raw); err != nil {
7987 return err
7988 }
7989 if _, ok := raw["algorithm"]; raw != nil && !ok {
7990 return fmt.Errorf("field algorithm in RsaesPkcs1DecryptSchemaV1Json: required")
7991 }
7992 if _, ok := raw["header"]; raw != nil && !ok {
7993 return fmt.Errorf("field header in RsaesPkcs1DecryptSchemaV1Json: required")
7994 }
7995 if _, ok := raw["notes"]; raw != nil && !ok {
7996 return fmt.Errorf("field notes in RsaesPkcs1DecryptSchemaV1Json: required")
7997 }
7998 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7999 return fmt.Errorf("field numberOfTests in RsaesPkcs1DecryptSchemaV1Json: required")
8000 }
8001 if _, ok := raw["schema"]; raw != nil && !ok {
8002 return fmt.Errorf("field schema in RsaesPkcs1DecryptSchemaV1Json: required")
8003 }
8004 if _, ok := raw["testGroups"]; raw != nil && !ok {
8005 return fmt.Errorf("field testGroups in RsaesPkcs1DecryptSchemaV1Json: required")
8006 }
8007 type Plain RsaesPkcs1DecryptSchemaV1Json
8008 var plain Plain
8009 if err := json.Unmarshal(value, &plain); err != nil {
8010 return err
8011 }
8012 *j = RsaesPkcs1DecryptSchemaV1Json(plain)
8013 return nil
8014 }
8015
8016 type RsaesPkcs1TestGroup struct {
8017
8018 KeySize int `json:"keySize"`
8019
8020
8021 PrivateKey PrivateKey `json:"privateKey"`
8022
8023
8024 PrivateKeyJwk *JsonWebKey `json:"privateKeyJwk,omitempty,omitzero"`
8025
8026
8027 PrivateKeyPem string `json:"privateKeyPem"`
8028
8029
8030 PrivateKeyPkcs8 string `json:"privateKeyPkcs8"`
8031
8032
8033 Source Source `json:"source"`
8034
8035
8036 Tests []RsaesPkcs1TestVector `json:"tests"`
8037
8038
8039 Type RsaesPkcs1TestGroupType `json:"type"`
8040 }
8041
8042 type RsaesPkcs1TestGroupType string
8043
8044 const RsaesPkcs1TestGroupTypeRsaesPkcs1Decrypt RsaesPkcs1TestGroupType = "RsaesPkcs1Decrypt"
8045
8046 var enumValues_RsaesPkcs1TestGroupType = []interface{}{
8047 "RsaesPkcs1Decrypt",
8048 }
8049
8050
8051 func (j *RsaesPkcs1TestGroupType) UnmarshalJSON(value []byte) error {
8052 var v string
8053 if err := json.Unmarshal(value, &v); err != nil {
8054 return err
8055 }
8056 var ok bool
8057 for _, expected := range enumValues_RsaesPkcs1TestGroupType {
8058 if reflect.DeepEqual(v, expected) {
8059 ok = true
8060 break
8061 }
8062 }
8063 if !ok {
8064 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesPkcs1TestGroupType, v)
8065 }
8066 *j = RsaesPkcs1TestGroupType(v)
8067 return nil
8068 }
8069
8070
8071 func (j *RsaesPkcs1TestGroup) UnmarshalJSON(value []byte) error {
8072 var raw map[string]interface{}
8073 if err := json.Unmarshal(value, &raw); err != nil {
8074 return err
8075 }
8076 if _, ok := raw["keySize"]; raw != nil && !ok {
8077 return fmt.Errorf("field keySize in RsaesPkcs1TestGroup: required")
8078 }
8079 if _, ok := raw["privateKey"]; raw != nil && !ok {
8080 return fmt.Errorf("field privateKey in RsaesPkcs1TestGroup: required")
8081 }
8082 if _, ok := raw["privateKeyPem"]; raw != nil && !ok {
8083 return fmt.Errorf("field privateKeyPem in RsaesPkcs1TestGroup: required")
8084 }
8085 if _, ok := raw["privateKeyPkcs8"]; raw != nil && !ok {
8086 return fmt.Errorf("field privateKeyPkcs8 in RsaesPkcs1TestGroup: required")
8087 }
8088 if _, ok := raw["source"]; raw != nil && !ok {
8089 return fmt.Errorf("field source in RsaesPkcs1TestGroup: required")
8090 }
8091 if _, ok := raw["tests"]; raw != nil && !ok {
8092 return fmt.Errorf("field tests in RsaesPkcs1TestGroup: required")
8093 }
8094 if _, ok := raw["type"]; raw != nil && !ok {
8095 return fmt.Errorf("field type in RsaesPkcs1TestGroup: required")
8096 }
8097 type Plain RsaesPkcs1TestGroup
8098 var plain Plain
8099 if err := json.Unmarshal(value, &plain); err != nil {
8100 return err
8101 }
8102 *j = RsaesPkcs1TestGroup(plain)
8103 return nil
8104 }
8105
8106 type RsaesPkcs1TestVector struct {
8107
8108 Comment string `json:"comment"`
8109
8110
8111 Ct string `json:"ct"`
8112
8113
8114 Flags []string `json:"flags"`
8115
8116
8117 Msg string `json:"msg"`
8118
8119
8120 Result Result `json:"result"`
8121
8122
8123 TcId int `json:"tcId"`
8124 }
8125
8126
8127 func (j *RsaesPkcs1TestVector) UnmarshalJSON(value []byte) error {
8128 var raw map[string]interface{}
8129 if err := json.Unmarshal(value, &raw); err != nil {
8130 return err
8131 }
8132 if _, ok := raw["comment"]; raw != nil && !ok {
8133 return fmt.Errorf("field comment in RsaesPkcs1TestVector: required")
8134 }
8135 if _, ok := raw["ct"]; raw != nil && !ok {
8136 return fmt.Errorf("field ct in RsaesPkcs1TestVector: required")
8137 }
8138 if _, ok := raw["flags"]; raw != nil && !ok {
8139 return fmt.Errorf("field flags in RsaesPkcs1TestVector: required")
8140 }
8141 if _, ok := raw["msg"]; raw != nil && !ok {
8142 return fmt.Errorf("field msg in RsaesPkcs1TestVector: required")
8143 }
8144 if _, ok := raw["result"]; raw != nil && !ok {
8145 return fmt.Errorf("field result in RsaesPkcs1TestVector: required")
8146 }
8147 if _, ok := raw["tcId"]; raw != nil && !ok {
8148 return fmt.Errorf("field tcId in RsaesPkcs1TestVector: required")
8149 }
8150 type Plain RsaesPkcs1TestVector
8151 var plain Plain
8152 if err := json.Unmarshal(value, &plain); err != nil {
8153 return err
8154 }
8155 *j = RsaesPkcs1TestVector(plain)
8156 return nil
8157 }
8158
8159 type RsassaPkcs1GenTestGroup struct {
8160
8161 KeyAsn string `json:"keyAsn"`
8162
8163
8164 KeyDer string `json:"keyDer"`
8165
8166
8167 KeyJwk *JsonWebKey `json:"keyJwk,omitempty,omitzero"`
8168
8169
8170 KeyPem string `json:"keyPem"`
8171
8172
8173 KeySize int `json:"keySize"`
8174
8175
8176 PrivateKey PrivateKey `json:"privateKey"`
8177
8178
8179 PrivateKeyJwk *JsonWebKey `json:"privateKeyJwk,omitempty,omitzero"`
8180
8181
8182 PrivateKeyPem string `json:"privateKeyPem"`
8183
8184
8185 PrivateKeyPkcs8 string `json:"privateKeyPkcs8"`
8186
8187
8188 Sha string `json:"sha"`
8189
8190
8191 Source Source `json:"source"`
8192
8193
8194 Tests []SignatureTestVector `json:"tests"`
8195
8196
8197 Type RsassaPkcs1GenTestGroupType `json:"type"`
8198 }
8199
8200 type RsassaPkcs1GenTestGroupType string
8201
8202 const RsassaPkcs1GenTestGroupTypeRsassaPkcs1Generate RsassaPkcs1GenTestGroupType = "RsassaPkcs1Generate"
8203
8204 var enumValues_RsassaPkcs1GenTestGroupType = []interface{}{
8205 "RsassaPkcs1Generate",
8206 }
8207
8208
8209 func (j *RsassaPkcs1GenTestGroupType) UnmarshalJSON(value []byte) error {
8210 var v string
8211 if err := json.Unmarshal(value, &v); err != nil {
8212 return err
8213 }
8214 var ok bool
8215 for _, expected := range enumValues_RsassaPkcs1GenTestGroupType {
8216 if reflect.DeepEqual(v, expected) {
8217 ok = true
8218 break
8219 }
8220 }
8221 if !ok {
8222 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1GenTestGroupType, v)
8223 }
8224 *j = RsassaPkcs1GenTestGroupType(v)
8225 return nil
8226 }
8227
8228
8229 func (j *RsassaPkcs1GenTestGroup) UnmarshalJSON(value []byte) error {
8230 var raw map[string]interface{}
8231 if err := json.Unmarshal(value, &raw); err != nil {
8232 return err
8233 }
8234 if _, ok := raw["keyAsn"]; raw != nil && !ok {
8235 return fmt.Errorf("field keyAsn in RsassaPkcs1GenTestGroup: required")
8236 }
8237 if _, ok := raw["keyDer"]; raw != nil && !ok {
8238 return fmt.Errorf("field keyDer in RsassaPkcs1GenTestGroup: required")
8239 }
8240 if _, ok := raw["keyPem"]; raw != nil && !ok {
8241 return fmt.Errorf("field keyPem in RsassaPkcs1GenTestGroup: required")
8242 }
8243 if _, ok := raw["keySize"]; raw != nil && !ok {
8244 return fmt.Errorf("field keySize in RsassaPkcs1GenTestGroup: required")
8245 }
8246 if _, ok := raw["privateKey"]; raw != nil && !ok {
8247 return fmt.Errorf("field privateKey in RsassaPkcs1GenTestGroup: required")
8248 }
8249 if _, ok := raw["privateKeyPem"]; raw != nil && !ok {
8250 return fmt.Errorf("field privateKeyPem in RsassaPkcs1GenTestGroup: required")
8251 }
8252 if _, ok := raw["privateKeyPkcs8"]; raw != nil && !ok {
8253 return fmt.Errorf("field privateKeyPkcs8 in RsassaPkcs1GenTestGroup: required")
8254 }
8255 if _, ok := raw["sha"]; raw != nil && !ok {
8256 return fmt.Errorf("field sha in RsassaPkcs1GenTestGroup: required")
8257 }
8258 if _, ok := raw["source"]; raw != nil && !ok {
8259 return fmt.Errorf("field source in RsassaPkcs1GenTestGroup: required")
8260 }
8261 if _, ok := raw["tests"]; raw != nil && !ok {
8262 return fmt.Errorf("field tests in RsassaPkcs1GenTestGroup: required")
8263 }
8264 if _, ok := raw["type"]; raw != nil && !ok {
8265 return fmt.Errorf("field type in RsassaPkcs1GenTestGroup: required")
8266 }
8267 type Plain RsassaPkcs1GenTestGroup
8268 var plain Plain
8269 if err := json.Unmarshal(value, &plain); err != nil {
8270 return err
8271 }
8272 *j = RsassaPkcs1GenTestGroup(plain)
8273 return nil
8274 }
8275
8276 type RsassaPkcs1GenerateSchemaV1Json struct {
8277
8278 Algorithm string `json:"algorithm"`
8279
8280
8281 Header []string `json:"header"`
8282
8283
8284 Notes Notes `json:"notes"`
8285
8286
8287 NumberOfTests int `json:"numberOfTests"`
8288
8289
8290 Schema RsassaPkcs1GenerateSchemaV1JsonSchema `json:"schema"`
8291
8292
8293 TestGroups []RsassaPkcs1GenTestGroup `json:"testGroups"`
8294 }
8295
8296 type RsassaPkcs1GenerateSchemaV1JsonSchema string
8297
8298 const RsassaPkcs1GenerateSchemaV1JsonSchemaRsassaPkcs1GenerateSchemaV1Json RsassaPkcs1GenerateSchemaV1JsonSchema = "rsassa_pkcs1_generate_schema_v1.json"
8299
8300 var enumValues_RsassaPkcs1GenerateSchemaV1JsonSchema = []interface{}{
8301 "rsassa_pkcs1_generate_schema_v1.json",
8302 }
8303
8304
8305 func (j *RsassaPkcs1GenerateSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8306 var v string
8307 if err := json.Unmarshal(value, &v); err != nil {
8308 return err
8309 }
8310 var ok bool
8311 for _, expected := range enumValues_RsassaPkcs1GenerateSchemaV1JsonSchema {
8312 if reflect.DeepEqual(v, expected) {
8313 ok = true
8314 break
8315 }
8316 }
8317 if !ok {
8318 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1GenerateSchemaV1JsonSchema, v)
8319 }
8320 *j = RsassaPkcs1GenerateSchemaV1JsonSchema(v)
8321 return nil
8322 }
8323
8324
8325 func (j *RsassaPkcs1GenerateSchemaV1Json) UnmarshalJSON(value []byte) error {
8326 var raw map[string]interface{}
8327 if err := json.Unmarshal(value, &raw); err != nil {
8328 return err
8329 }
8330 if _, ok := raw["algorithm"]; raw != nil && !ok {
8331 return fmt.Errorf("field algorithm in RsassaPkcs1GenerateSchemaV1Json: required")
8332 }
8333 if _, ok := raw["header"]; raw != nil && !ok {
8334 return fmt.Errorf("field header in RsassaPkcs1GenerateSchemaV1Json: required")
8335 }
8336 if _, ok := raw["notes"]; raw != nil && !ok {
8337 return fmt.Errorf("field notes in RsassaPkcs1GenerateSchemaV1Json: required")
8338 }
8339 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8340 return fmt.Errorf("field numberOfTests in RsassaPkcs1GenerateSchemaV1Json: required")
8341 }
8342 if _, ok := raw["schema"]; raw != nil && !ok {
8343 return fmt.Errorf("field schema in RsassaPkcs1GenerateSchemaV1Json: required")
8344 }
8345 if _, ok := raw["testGroups"]; raw != nil && !ok {
8346 return fmt.Errorf("field testGroups in RsassaPkcs1GenerateSchemaV1Json: required")
8347 }
8348 type Plain RsassaPkcs1GenerateSchemaV1Json
8349 var plain Plain
8350 if err := json.Unmarshal(value, &plain); err != nil {
8351 return err
8352 }
8353 *j = RsassaPkcs1GenerateSchemaV1Json(plain)
8354 return nil
8355 }
8356
8357 type RsassaPkcs1TestGroup struct {
8358
8359 KeyJwk *JsonWebKey `json:"keyJwk,omitempty,omitzero"`
8360
8361
8362 KeySize int `json:"keySize"`
8363
8364
8365 PublicKey RsassaPkcs1TestGroupPublicKey `json:"publicKey"`
8366
8367
8368 PublicKeyAsn string `json:"publicKeyAsn"`
8369
8370
8371 PublicKeyDer string `json:"publicKeyDer"`
8372
8373
8374 PublicKeyPem string `json:"publicKeyPem"`
8375
8376
8377 Sha string `json:"sha"`
8378
8379
8380 Source Source `json:"source"`
8381
8382
8383 Tests []SignatureTestVector `json:"tests"`
8384
8385
8386 Type RsassaPkcs1TestGroupType `json:"type"`
8387 }
8388
8389 type RsassaPkcs1TestGroupPublicKey struct {
8390
8391 Modulus string `json:"modulus"`
8392
8393
8394 PublicExponent string `json:"publicExponent"`
8395 }
8396
8397
8398 func (j *RsassaPkcs1TestGroupPublicKey) UnmarshalJSON(value []byte) error {
8399 var raw map[string]interface{}
8400 if err := json.Unmarshal(value, &raw); err != nil {
8401 return err
8402 }
8403 if _, ok := raw["modulus"]; raw != nil && !ok {
8404 return fmt.Errorf("field modulus in RsassaPkcs1TestGroupPublicKey: required")
8405 }
8406 if _, ok := raw["publicExponent"]; raw != nil && !ok {
8407 return fmt.Errorf("field publicExponent in RsassaPkcs1TestGroupPublicKey: required")
8408 }
8409 type Plain RsassaPkcs1TestGroupPublicKey
8410 var plain Plain
8411 if err := json.Unmarshal(value, &plain); err != nil {
8412 return err
8413 }
8414 *j = RsassaPkcs1TestGroupPublicKey(plain)
8415 return nil
8416 }
8417
8418 type RsassaPkcs1TestGroupType string
8419
8420 const RsassaPkcs1TestGroupTypeRsassaPkcs1Verify RsassaPkcs1TestGroupType = "RsassaPkcs1Verify"
8421
8422 var enumValues_RsassaPkcs1TestGroupType = []interface{}{
8423 "RsassaPkcs1Verify",
8424 }
8425
8426
8427 func (j *RsassaPkcs1TestGroupType) UnmarshalJSON(value []byte) error {
8428 var v string
8429 if err := json.Unmarshal(value, &v); err != nil {
8430 return err
8431 }
8432 var ok bool
8433 for _, expected := range enumValues_RsassaPkcs1TestGroupType {
8434 if reflect.DeepEqual(v, expected) {
8435 ok = true
8436 break
8437 }
8438 }
8439 if !ok {
8440 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1TestGroupType, v)
8441 }
8442 *j = RsassaPkcs1TestGroupType(v)
8443 return nil
8444 }
8445
8446
8447 func (j *RsassaPkcs1TestGroup) UnmarshalJSON(value []byte) error {
8448 var raw map[string]interface{}
8449 if err := json.Unmarshal(value, &raw); err != nil {
8450 return err
8451 }
8452 if _, ok := raw["keySize"]; raw != nil && !ok {
8453 return fmt.Errorf("field keySize in RsassaPkcs1TestGroup: required")
8454 }
8455 if _, ok := raw["publicKey"]; raw != nil && !ok {
8456 return fmt.Errorf("field publicKey in RsassaPkcs1TestGroup: required")
8457 }
8458 if _, ok := raw["publicKeyAsn"]; raw != nil && !ok {
8459 return fmt.Errorf("field publicKeyAsn in RsassaPkcs1TestGroup: required")
8460 }
8461 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
8462 return fmt.Errorf("field publicKeyDer in RsassaPkcs1TestGroup: required")
8463 }
8464 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
8465 return fmt.Errorf("field publicKeyPem in RsassaPkcs1TestGroup: required")
8466 }
8467 if _, ok := raw["sha"]; raw != nil && !ok {
8468 return fmt.Errorf("field sha in RsassaPkcs1TestGroup: required")
8469 }
8470 if _, ok := raw["source"]; raw != nil && !ok {
8471 return fmt.Errorf("field source in RsassaPkcs1TestGroup: required")
8472 }
8473 if _, ok := raw["tests"]; raw != nil && !ok {
8474 return fmt.Errorf("field tests in RsassaPkcs1TestGroup: required")
8475 }
8476 if _, ok := raw["type"]; raw != nil && !ok {
8477 return fmt.Errorf("field type in RsassaPkcs1TestGroup: required")
8478 }
8479 type Plain RsassaPkcs1TestGroup
8480 var plain Plain
8481 if err := json.Unmarshal(value, &plain); err != nil {
8482 return err
8483 }
8484 *j = RsassaPkcs1TestGroup(plain)
8485 return nil
8486 }
8487
8488 type RsassaPkcs1VerifySchemaV1Json struct {
8489
8490 Algorithm string `json:"algorithm"`
8491
8492
8493 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
8494
8495
8496 Header []string `json:"header"`
8497
8498
8499 Notes Notes `json:"notes"`
8500
8501
8502 NumberOfTests int `json:"numberOfTests"`
8503
8504
8505 Schema RsassaPkcs1VerifySchemaV1JsonSchema `json:"schema"`
8506
8507
8508 TestGroups []RsassaPkcs1TestGroup `json:"testGroups"`
8509 }
8510
8511 type RsassaPkcs1VerifySchemaV1JsonSchema string
8512
8513 const RsassaPkcs1VerifySchemaV1JsonSchemaRsassaPkcs1VerifySchemaV1Json RsassaPkcs1VerifySchemaV1JsonSchema = "rsassa_pkcs1_verify_schema_v1.json"
8514
8515 var enumValues_RsassaPkcs1VerifySchemaV1JsonSchema = []interface{}{
8516 "rsassa_pkcs1_verify_schema_v1.json",
8517 }
8518
8519
8520 func (j *RsassaPkcs1VerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8521 var v string
8522 if err := json.Unmarshal(value, &v); err != nil {
8523 return err
8524 }
8525 var ok bool
8526 for _, expected := range enumValues_RsassaPkcs1VerifySchemaV1JsonSchema {
8527 if reflect.DeepEqual(v, expected) {
8528 ok = true
8529 break
8530 }
8531 }
8532 if !ok {
8533 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1VerifySchemaV1JsonSchema, v)
8534 }
8535 *j = RsassaPkcs1VerifySchemaV1JsonSchema(v)
8536 return nil
8537 }
8538
8539
8540 func (j *RsassaPkcs1VerifySchemaV1Json) UnmarshalJSON(value []byte) error {
8541 var raw map[string]interface{}
8542 if err := json.Unmarshal(value, &raw); err != nil {
8543 return err
8544 }
8545 if _, ok := raw["algorithm"]; raw != nil && !ok {
8546 return fmt.Errorf("field algorithm in RsassaPkcs1VerifySchemaV1Json: required")
8547 }
8548 if _, ok := raw["header"]; raw != nil && !ok {
8549 return fmt.Errorf("field header in RsassaPkcs1VerifySchemaV1Json: required")
8550 }
8551 if _, ok := raw["notes"]; raw != nil && !ok {
8552 return fmt.Errorf("field notes in RsassaPkcs1VerifySchemaV1Json: required")
8553 }
8554 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8555 return fmt.Errorf("field numberOfTests in RsassaPkcs1VerifySchemaV1Json: required")
8556 }
8557 if _, ok := raw["schema"]; raw != nil && !ok {
8558 return fmt.Errorf("field schema in RsassaPkcs1VerifySchemaV1Json: required")
8559 }
8560 if _, ok := raw["testGroups"]; raw != nil && !ok {
8561 return fmt.Errorf("field testGroups in RsassaPkcs1VerifySchemaV1Json: required")
8562 }
8563 type Plain RsassaPkcs1VerifySchemaV1Json
8564 var plain Plain
8565 if err := json.Unmarshal(value, &plain); err != nil {
8566 return err
8567 }
8568 *j = RsassaPkcs1VerifySchemaV1Json(plain)
8569 return nil
8570 }
8571
8572 type RsassaPssTestGroup struct {
8573
8574 KeySize int `json:"keySize"`
8575
8576
8577 Mgf string `json:"mgf"`
8578
8579
8580 MgfSha string `json:"mgfSha"`
8581
8582
8583 PublicKey RsassaPssTestGroupPublicKey `json:"publicKey"`
8584
8585
8586 PublicKeyAsn string `json:"publicKeyAsn"`
8587
8588
8589 PublicKeyDer string `json:"publicKeyDer"`
8590
8591
8592 PublicKeyJwk *JsonWebKey `json:"publicKeyJwk,omitempty,omitzero"`
8593
8594
8595 PublicKeyPem string `json:"publicKeyPem"`
8596
8597
8598 SLen int `json:"sLen"`
8599
8600
8601 Sha string `json:"sha"`
8602
8603
8604 Source Source `json:"source"`
8605
8606
8607 Tests []RsassaPssTestVector `json:"tests"`
8608
8609
8610 Type RsassaPssTestGroupType `json:"type"`
8611 }
8612
8613 type RsassaPssTestGroupPublicKey struct {
8614
8615 Modulus string `json:"modulus"`
8616
8617
8618 PublicExponent string `json:"publicExponent"`
8619 }
8620
8621
8622 func (j *RsassaPssTestGroupPublicKey) UnmarshalJSON(value []byte) error {
8623 var raw map[string]interface{}
8624 if err := json.Unmarshal(value, &raw); err != nil {
8625 return err
8626 }
8627 if _, ok := raw["modulus"]; raw != nil && !ok {
8628 return fmt.Errorf("field modulus in RsassaPssTestGroupPublicKey: required")
8629 }
8630 if _, ok := raw["publicExponent"]; raw != nil && !ok {
8631 return fmt.Errorf("field publicExponent in RsassaPssTestGroupPublicKey: required")
8632 }
8633 type Plain RsassaPssTestGroupPublicKey
8634 var plain Plain
8635 if err := json.Unmarshal(value, &plain); err != nil {
8636 return err
8637 }
8638 *j = RsassaPssTestGroupPublicKey(plain)
8639 return nil
8640 }
8641
8642 type RsassaPssTestGroupType string
8643
8644 const RsassaPssTestGroupTypeRsassaPssVerify RsassaPssTestGroupType = "RsassaPssVerify"
8645
8646 var enumValues_RsassaPssTestGroupType = []interface{}{
8647 "RsassaPssVerify",
8648 }
8649
8650
8651 func (j *RsassaPssTestGroupType) UnmarshalJSON(value []byte) error {
8652 var v string
8653 if err := json.Unmarshal(value, &v); err != nil {
8654 return err
8655 }
8656 var ok bool
8657 for _, expected := range enumValues_RsassaPssTestGroupType {
8658 if reflect.DeepEqual(v, expected) {
8659 ok = true
8660 break
8661 }
8662 }
8663 if !ok {
8664 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPssTestGroupType, v)
8665 }
8666 *j = RsassaPssTestGroupType(v)
8667 return nil
8668 }
8669
8670
8671 func (j *RsassaPssTestGroup) UnmarshalJSON(value []byte) error {
8672 var raw map[string]interface{}
8673 if err := json.Unmarshal(value, &raw); err != nil {
8674 return err
8675 }
8676 if _, ok := raw["keySize"]; raw != nil && !ok {
8677 return fmt.Errorf("field keySize in RsassaPssTestGroup: required")
8678 }
8679 if _, ok := raw["mgf"]; raw != nil && !ok {
8680 return fmt.Errorf("field mgf in RsassaPssTestGroup: required")
8681 }
8682 if _, ok := raw["mgfSha"]; raw != nil && !ok {
8683 return fmt.Errorf("field mgfSha in RsassaPssTestGroup: required")
8684 }
8685 if _, ok := raw["publicKey"]; raw != nil && !ok {
8686 return fmt.Errorf("field publicKey in RsassaPssTestGroup: required")
8687 }
8688 if _, ok := raw["publicKeyAsn"]; raw != nil && !ok {
8689 return fmt.Errorf("field publicKeyAsn in RsassaPssTestGroup: required")
8690 }
8691 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
8692 return fmt.Errorf("field publicKeyDer in RsassaPssTestGroup: required")
8693 }
8694 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
8695 return fmt.Errorf("field publicKeyPem in RsassaPssTestGroup: required")
8696 }
8697 if _, ok := raw["sLen"]; raw != nil && !ok {
8698 return fmt.Errorf("field sLen in RsassaPssTestGroup: required")
8699 }
8700 if _, ok := raw["sha"]; raw != nil && !ok {
8701 return fmt.Errorf("field sha in RsassaPssTestGroup: required")
8702 }
8703 if _, ok := raw["source"]; raw != nil && !ok {
8704 return fmt.Errorf("field source in RsassaPssTestGroup: required")
8705 }
8706 if _, ok := raw["tests"]; raw != nil && !ok {
8707 return fmt.Errorf("field tests in RsassaPssTestGroup: required")
8708 }
8709 if _, ok := raw["type"]; raw != nil && !ok {
8710 return fmt.Errorf("field type in RsassaPssTestGroup: required")
8711 }
8712 type Plain RsassaPssTestGroup
8713 var plain Plain
8714 if err := json.Unmarshal(value, &plain); err != nil {
8715 return err
8716 }
8717 *j = RsassaPssTestGroup(plain)
8718 return nil
8719 }
8720
8721 type RsassaPssTestVector struct {
8722
8723 Comment string `json:"comment"`
8724
8725
8726 Flags []string `json:"flags"`
8727
8728
8729 Msg string `json:"msg"`
8730
8731
8732 Result Result `json:"result"`
8733
8734
8735 Sig string `json:"sig"`
8736
8737
8738 TcId int `json:"tcId"`
8739 }
8740
8741
8742 func (j *RsassaPssTestVector) UnmarshalJSON(value []byte) error {
8743 var raw map[string]interface{}
8744 if err := json.Unmarshal(value, &raw); err != nil {
8745 return err
8746 }
8747 if _, ok := raw["comment"]; raw != nil && !ok {
8748 return fmt.Errorf("field comment in RsassaPssTestVector: required")
8749 }
8750 if _, ok := raw["flags"]; raw != nil && !ok {
8751 return fmt.Errorf("field flags in RsassaPssTestVector: required")
8752 }
8753 if _, ok := raw["msg"]; raw != nil && !ok {
8754 return fmt.Errorf("field msg in RsassaPssTestVector: required")
8755 }
8756 if _, ok := raw["result"]; raw != nil && !ok {
8757 return fmt.Errorf("field result in RsassaPssTestVector: required")
8758 }
8759 if _, ok := raw["sig"]; raw != nil && !ok {
8760 return fmt.Errorf("field sig in RsassaPssTestVector: required")
8761 }
8762 if _, ok := raw["tcId"]; raw != nil && !ok {
8763 return fmt.Errorf("field tcId in RsassaPssTestVector: required")
8764 }
8765 type Plain RsassaPssTestVector
8766 var plain Plain
8767 if err := json.Unmarshal(value, &plain); err != nil {
8768 return err
8769 }
8770 *j = RsassaPssTestVector(plain)
8771 return nil
8772 }
8773
8774 type RsassaPssVerifySchemaV1Json struct {
8775
8776 Algorithm string `json:"algorithm"`
8777
8778
8779 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
8780
8781
8782 Header []string `json:"header"`
8783
8784
8785 Notes Notes `json:"notes"`
8786
8787
8788 NumberOfTests int `json:"numberOfTests"`
8789
8790
8791 Schema RsassaPssVerifySchemaV1JsonSchema `json:"schema"`
8792
8793
8794 TestGroups []RsassaPssTestGroup `json:"testGroups"`
8795 }
8796
8797 type RsassaPssVerifySchemaV1JsonSchema string
8798
8799 const RsassaPssVerifySchemaV1JsonSchemaRsassaPssVerifySchemaV1Json RsassaPssVerifySchemaV1JsonSchema = "rsassa_pss_verify_schema_v1.json"
8800
8801 var enumValues_RsassaPssVerifySchemaV1JsonSchema = []interface{}{
8802 "rsassa_pss_verify_schema_v1.json",
8803 }
8804
8805
8806 func (j *RsassaPssVerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8807 var v string
8808 if err := json.Unmarshal(value, &v); err != nil {
8809 return err
8810 }
8811 var ok bool
8812 for _, expected := range enumValues_RsassaPssVerifySchemaV1JsonSchema {
8813 if reflect.DeepEqual(v, expected) {
8814 ok = true
8815 break
8816 }
8817 }
8818 if !ok {
8819 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPssVerifySchemaV1JsonSchema, v)
8820 }
8821 *j = RsassaPssVerifySchemaV1JsonSchema(v)
8822 return nil
8823 }
8824
8825
8826 func (j *RsassaPssVerifySchemaV1Json) UnmarshalJSON(value []byte) error {
8827 var raw map[string]interface{}
8828 if err := json.Unmarshal(value, &raw); err != nil {
8829 return err
8830 }
8831 if _, ok := raw["algorithm"]; raw != nil && !ok {
8832 return fmt.Errorf("field algorithm in RsassaPssVerifySchemaV1Json: required")
8833 }
8834 if _, ok := raw["header"]; raw != nil && !ok {
8835 return fmt.Errorf("field header in RsassaPssVerifySchemaV1Json: required")
8836 }
8837 if _, ok := raw["notes"]; raw != nil && !ok {
8838 return fmt.Errorf("field notes in RsassaPssVerifySchemaV1Json: required")
8839 }
8840 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8841 return fmt.Errorf("field numberOfTests in RsassaPssVerifySchemaV1Json: required")
8842 }
8843 if _, ok := raw["schema"]; raw != nil && !ok {
8844 return fmt.Errorf("field schema in RsassaPssVerifySchemaV1Json: required")
8845 }
8846 if _, ok := raw["testGroups"]; raw != nil && !ok {
8847 return fmt.Errorf("field testGroups in RsassaPssVerifySchemaV1Json: required")
8848 }
8849 type Plain RsassaPssVerifySchemaV1Json
8850 var plain Plain
8851 if err := json.Unmarshal(value, &plain); err != nil {
8852 return err
8853 }
8854 *j = RsassaPssVerifySchemaV1Json(plain)
8855 return nil
8856 }
8857
8858 type SignatureTestVector struct {
8859
8860 Comment string `json:"comment"`
8861
8862
8863 Flags []string `json:"flags"`
8864
8865
8866 Msg string `json:"msg"`
8867
8868
8869 Result Result `json:"result"`
8870
8871
8872 Sig string `json:"sig"`
8873
8874
8875 TcId int `json:"tcId"`
8876 }
8877
8878
8879 func (j *SignatureTestVector) UnmarshalJSON(value []byte) error {
8880 var raw map[string]interface{}
8881 if err := json.Unmarshal(value, &raw); err != nil {
8882 return err
8883 }
8884 if _, ok := raw["comment"]; raw != nil && !ok {
8885 return fmt.Errorf("field comment in SignatureTestVector: required")
8886 }
8887 if _, ok := raw["flags"]; raw != nil && !ok {
8888 return fmt.Errorf("field flags in SignatureTestVector: required")
8889 }
8890 if _, ok := raw["msg"]; raw != nil && !ok {
8891 return fmt.Errorf("field msg in SignatureTestVector: required")
8892 }
8893 if _, ok := raw["result"]; raw != nil && !ok {
8894 return fmt.Errorf("field result in SignatureTestVector: required")
8895 }
8896 if _, ok := raw["sig"]; raw != nil && !ok {
8897 return fmt.Errorf("field sig in SignatureTestVector: required")
8898 }
8899 if _, ok := raw["tcId"]; raw != nil && !ok {
8900 return fmt.Errorf("field tcId in SignatureTestVector: required")
8901 }
8902 type Plain SignatureTestVector
8903 var plain Plain
8904 if err := json.Unmarshal(value, &plain); err != nil {
8905 return err
8906 }
8907 *j = SignatureTestVector(plain)
8908 return nil
8909 }
8910
8911 type Source struct {
8912
8913 Name string `json:"name"`
8914
8915
8916 Version string `json:"version"`
8917 }
8918
8919
8920 func (j *Source) UnmarshalJSON(value []byte) error {
8921 var raw map[string]interface{}
8922 if err := json.Unmarshal(value, &raw); err != nil {
8923 return err
8924 }
8925 if _, ok := raw["name"]; raw != nil && !ok {
8926 return fmt.Errorf("field name in Source: required")
8927 }
8928 if _, ok := raw["version"]; raw != nil && !ok {
8929 return fmt.Errorf("field version in Source: required")
8930 }
8931 type Plain Source
8932 var plain Plain
8933 if err := json.Unmarshal(value, &plain); err != nil {
8934 return err
8935 }
8936 if utf8.RuneCountInString(string(plain.Name)) < 1 {
8937 return fmt.Errorf("field %s length: must be >= %d", "name", 1)
8938 }
8939 if utf8.RuneCountInString(string(plain.Version)) < 1 {
8940 return fmt.Errorf("field %s length: must be >= %d", "version", 1)
8941 }
8942 *j = Source(plain)
8943 return nil
8944 }
8945
8946 type XdhAsnCompSchemaV1Json struct {
8947
8948 Algorithm string `json:"algorithm"`
8949
8950
8951 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
8952
8953
8954 Header []string `json:"header"`
8955
8956
8957 Notes Notes `json:"notes"`
8958
8959
8960 NumberOfTests int `json:"numberOfTests"`
8961
8962
8963 Schema XdhAsnCompSchemaV1JsonSchema `json:"schema"`
8964
8965
8966 TestGroups []XdhAsnTestGroup `json:"testGroups"`
8967 }
8968
8969 type XdhAsnCompSchemaV1JsonSchema string
8970
8971 const XdhAsnCompSchemaV1JsonSchemaXdhAsnCompSchemaV1Json XdhAsnCompSchemaV1JsonSchema = "xdh_asn_comp_schema_v1.json"
8972
8973 var enumValues_XdhAsnCompSchemaV1JsonSchema = []interface{}{
8974 "xdh_asn_comp_schema_v1.json",
8975 }
8976
8977
8978 func (j *XdhAsnCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8979 var v string
8980 if err := json.Unmarshal(value, &v); err != nil {
8981 return err
8982 }
8983 var ok bool
8984 for _, expected := range enumValues_XdhAsnCompSchemaV1JsonSchema {
8985 if reflect.DeepEqual(v, expected) {
8986 ok = true
8987 break
8988 }
8989 }
8990 if !ok {
8991 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhAsnCompSchemaV1JsonSchema, v)
8992 }
8993 *j = XdhAsnCompSchemaV1JsonSchema(v)
8994 return nil
8995 }
8996
8997
8998 func (j *XdhAsnCompSchemaV1Json) UnmarshalJSON(value []byte) error {
8999 var raw map[string]interface{}
9000 if err := json.Unmarshal(value, &raw); err != nil {
9001 return err
9002 }
9003 if _, ok := raw["algorithm"]; raw != nil && !ok {
9004 return fmt.Errorf("field algorithm in XdhAsnCompSchemaV1Json: required")
9005 }
9006 if _, ok := raw["header"]; raw != nil && !ok {
9007 return fmt.Errorf("field header in XdhAsnCompSchemaV1Json: required")
9008 }
9009 if _, ok := raw["notes"]; raw != nil && !ok {
9010 return fmt.Errorf("field notes in XdhAsnCompSchemaV1Json: required")
9011 }
9012 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
9013 return fmt.Errorf("field numberOfTests in XdhAsnCompSchemaV1Json: required")
9014 }
9015 if _, ok := raw["schema"]; raw != nil && !ok {
9016 return fmt.Errorf("field schema in XdhAsnCompSchemaV1Json: required")
9017 }
9018 if _, ok := raw["testGroups"]; raw != nil && !ok {
9019 return fmt.Errorf("field testGroups in XdhAsnCompSchemaV1Json: required")
9020 }
9021 type Plain XdhAsnCompSchemaV1Json
9022 var plain Plain
9023 if err := json.Unmarshal(value, &plain); err != nil {
9024 return err
9025 }
9026 *j = XdhAsnCompSchemaV1Json(plain)
9027 return nil
9028 }
9029
9030 type XdhAsnTestGroup struct {
9031
9032 Curve string `json:"curve"`
9033
9034
9035 Source Source `json:"source"`
9036
9037
9038 Tests []XdhAsnTestVector `json:"tests"`
9039
9040
9041 Type XdhAsnTestGroupType `json:"type"`
9042 }
9043
9044 type XdhAsnTestGroupType string
9045
9046 const XdhAsnTestGroupTypeXdhAsnComp XdhAsnTestGroupType = "XdhAsnComp"
9047
9048 var enumValues_XdhAsnTestGroupType = []interface{}{
9049 "XdhAsnComp",
9050 }
9051
9052
9053 func (j *XdhAsnTestGroupType) UnmarshalJSON(value []byte) error {
9054 var v string
9055 if err := json.Unmarshal(value, &v); err != nil {
9056 return err
9057 }
9058 var ok bool
9059 for _, expected := range enumValues_XdhAsnTestGroupType {
9060 if reflect.DeepEqual(v, expected) {
9061 ok = true
9062 break
9063 }
9064 }
9065 if !ok {
9066 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhAsnTestGroupType, v)
9067 }
9068 *j = XdhAsnTestGroupType(v)
9069 return nil
9070 }
9071
9072
9073 func (j *XdhAsnTestGroup) UnmarshalJSON(value []byte) error {
9074 var raw map[string]interface{}
9075 if err := json.Unmarshal(value, &raw); err != nil {
9076 return err
9077 }
9078 if _, ok := raw["curve"]; raw != nil && !ok {
9079 return fmt.Errorf("field curve in XdhAsnTestGroup: required")
9080 }
9081 if _, ok := raw["source"]; raw != nil && !ok {
9082 return fmt.Errorf("field source in XdhAsnTestGroup: required")
9083 }
9084 if _, ok := raw["tests"]; raw != nil && !ok {
9085 return fmt.Errorf("field tests in XdhAsnTestGroup: required")
9086 }
9087 if _, ok := raw["type"]; raw != nil && !ok {
9088 return fmt.Errorf("field type in XdhAsnTestGroup: required")
9089 }
9090 type Plain XdhAsnTestGroup
9091 var plain Plain
9092 if err := json.Unmarshal(value, &plain); err != nil {
9093 return err
9094 }
9095 *j = XdhAsnTestGroup(plain)
9096 return nil
9097 }
9098
9099 type XdhAsnTestVector struct {
9100
9101 Comment string `json:"comment"`
9102
9103
9104 Flags []string `json:"flags"`
9105
9106
9107 Private string `json:"private"`
9108
9109
9110 Public string `json:"public"`
9111
9112
9113 Result Result `json:"result"`
9114
9115
9116 Shared string `json:"shared"`
9117
9118
9119 TcId int `json:"tcId"`
9120 }
9121
9122
9123 func (j *XdhAsnTestVector) UnmarshalJSON(value []byte) error {
9124 var raw map[string]interface{}
9125 if err := json.Unmarshal(value, &raw); err != nil {
9126 return err
9127 }
9128 if _, ok := raw["comment"]; raw != nil && !ok {
9129 return fmt.Errorf("field comment in XdhAsnTestVector: required")
9130 }
9131 if _, ok := raw["flags"]; raw != nil && !ok {
9132 return fmt.Errorf("field flags in XdhAsnTestVector: required")
9133 }
9134 if _, ok := raw["private"]; raw != nil && !ok {
9135 return fmt.Errorf("field private in XdhAsnTestVector: required")
9136 }
9137 if _, ok := raw["public"]; raw != nil && !ok {
9138 return fmt.Errorf("field public in XdhAsnTestVector: required")
9139 }
9140 if _, ok := raw["result"]; raw != nil && !ok {
9141 return fmt.Errorf("field result in XdhAsnTestVector: required")
9142 }
9143 if _, ok := raw["shared"]; raw != nil && !ok {
9144 return fmt.Errorf("field shared in XdhAsnTestVector: required")
9145 }
9146 if _, ok := raw["tcId"]; raw != nil && !ok {
9147 return fmt.Errorf("field tcId in XdhAsnTestVector: required")
9148 }
9149 type Plain XdhAsnTestVector
9150 var plain Plain
9151 if err := json.Unmarshal(value, &plain); err != nil {
9152 return err
9153 }
9154 *j = XdhAsnTestVector(plain)
9155 return nil
9156 }
9157
9158 type XdhCompSchemaV1Json struct {
9159
9160 Algorithm string `json:"algorithm"`
9161
9162
9163 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
9164
9165
9166 Header []string `json:"header"`
9167
9168
9169 Notes Notes `json:"notes"`
9170
9171
9172 NumberOfTests int `json:"numberOfTests"`
9173
9174
9175 Schema XdhCompSchemaV1JsonSchema `json:"schema"`
9176
9177
9178 TestGroups []XdhTestGroup `json:"testGroups"`
9179 }
9180
9181 type XdhCompSchemaV1JsonSchema string
9182
9183 const XdhCompSchemaV1JsonSchemaXdhCompSchemaV1Json XdhCompSchemaV1JsonSchema = "xdh_comp_schema_v1.json"
9184
9185 var enumValues_XdhCompSchemaV1JsonSchema = []interface{}{
9186 "xdh_comp_schema_v1.json",
9187 }
9188
9189
9190 func (j *XdhCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
9191 var v string
9192 if err := json.Unmarshal(value, &v); err != nil {
9193 return err
9194 }
9195 var ok bool
9196 for _, expected := range enumValues_XdhCompSchemaV1JsonSchema {
9197 if reflect.DeepEqual(v, expected) {
9198 ok = true
9199 break
9200 }
9201 }
9202 if !ok {
9203 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhCompSchemaV1JsonSchema, v)
9204 }
9205 *j = XdhCompSchemaV1JsonSchema(v)
9206 return nil
9207 }
9208
9209
9210 func (j *XdhCompSchemaV1Json) UnmarshalJSON(value []byte) error {
9211 var raw map[string]interface{}
9212 if err := json.Unmarshal(value, &raw); err != nil {
9213 return err
9214 }
9215 if _, ok := raw["algorithm"]; raw != nil && !ok {
9216 return fmt.Errorf("field algorithm in XdhCompSchemaV1Json: required")
9217 }
9218 if _, ok := raw["header"]; raw != nil && !ok {
9219 return fmt.Errorf("field header in XdhCompSchemaV1Json: required")
9220 }
9221 if _, ok := raw["notes"]; raw != nil && !ok {
9222 return fmt.Errorf("field notes in XdhCompSchemaV1Json: required")
9223 }
9224 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
9225 return fmt.Errorf("field numberOfTests in XdhCompSchemaV1Json: required")
9226 }
9227 if _, ok := raw["schema"]; raw != nil && !ok {
9228 return fmt.Errorf("field schema in XdhCompSchemaV1Json: required")
9229 }
9230 if _, ok := raw["testGroups"]; raw != nil && !ok {
9231 return fmt.Errorf("field testGroups in XdhCompSchemaV1Json: required")
9232 }
9233 type Plain XdhCompSchemaV1Json
9234 var plain Plain
9235 if err := json.Unmarshal(value, &plain); err != nil {
9236 return err
9237 }
9238 *j = XdhCompSchemaV1Json(plain)
9239 return nil
9240 }
9241
9242 type XdhJwkCompSchemaV1Json struct {
9243
9244 Algorithm string `json:"algorithm"`
9245
9246
9247 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
9248
9249
9250 Header []string `json:"header"`
9251
9252
9253 Notes Notes `json:"notes"`
9254
9255
9256 NumberOfTests int `json:"numberOfTests"`
9257
9258
9259 Schema XdhJwkCompSchemaV1JsonSchema `json:"schema"`
9260
9261
9262 TestGroups []XdhJwkTestGroup `json:"testGroups"`
9263 }
9264
9265 type XdhJwkCompSchemaV1JsonSchema string
9266
9267 const XdhJwkCompSchemaV1JsonSchemaXdhJwkCompSchemaV1Json XdhJwkCompSchemaV1JsonSchema = "xdh_jwk_comp_schema_v1.json"
9268
9269 var enumValues_XdhJwkCompSchemaV1JsonSchema = []interface{}{
9270 "xdh_jwk_comp_schema_v1.json",
9271 }
9272
9273
9274 func (j *XdhJwkCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
9275 var v string
9276 if err := json.Unmarshal(value, &v); err != nil {
9277 return err
9278 }
9279 var ok bool
9280 for _, expected := range enumValues_XdhJwkCompSchemaV1JsonSchema {
9281 if reflect.DeepEqual(v, expected) {
9282 ok = true
9283 break
9284 }
9285 }
9286 if !ok {
9287 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhJwkCompSchemaV1JsonSchema, v)
9288 }
9289 *j = XdhJwkCompSchemaV1JsonSchema(v)
9290 return nil
9291 }
9292
9293
9294 func (j *XdhJwkCompSchemaV1Json) UnmarshalJSON(value []byte) error {
9295 var raw map[string]interface{}
9296 if err := json.Unmarshal(value, &raw); err != nil {
9297 return err
9298 }
9299 if _, ok := raw["algorithm"]; raw != nil && !ok {
9300 return fmt.Errorf("field algorithm in XdhJwkCompSchemaV1Json: required")
9301 }
9302 if _, ok := raw["header"]; raw != nil && !ok {
9303 return fmt.Errorf("field header in XdhJwkCompSchemaV1Json: required")
9304 }
9305 if _, ok := raw["notes"]; raw != nil && !ok {
9306 return fmt.Errorf("field notes in XdhJwkCompSchemaV1Json: required")
9307 }
9308 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
9309 return fmt.Errorf("field numberOfTests in XdhJwkCompSchemaV1Json: required")
9310 }
9311 if _, ok := raw["schema"]; raw != nil && !ok {
9312 return fmt.Errorf("field schema in XdhJwkCompSchemaV1Json: required")
9313 }
9314 if _, ok := raw["testGroups"]; raw != nil && !ok {
9315 return fmt.Errorf("field testGroups in XdhJwkCompSchemaV1Json: required")
9316 }
9317 type Plain XdhJwkCompSchemaV1Json
9318 var plain Plain
9319 if err := json.Unmarshal(value, &plain); err != nil {
9320 return err
9321 }
9322 *j = XdhJwkCompSchemaV1Json(plain)
9323 return nil
9324 }
9325
9326 type XdhJwkTestGroup struct {
9327
9328 Curve string `json:"curve"`
9329
9330
9331 Source Source `json:"source"`
9332
9333
9334 Tests []XdhJwkTestVector `json:"tests"`
9335
9336
9337 Type XdhJwkTestGroupType `json:"type"`
9338 }
9339
9340 type XdhJwkTestGroupType string
9341
9342 const XdhJwkTestGroupTypeXdhJwkComp XdhJwkTestGroupType = "XdhJwkComp"
9343
9344 var enumValues_XdhJwkTestGroupType = []interface{}{
9345 "XdhJwkComp",
9346 }
9347
9348
9349 func (j *XdhJwkTestGroupType) UnmarshalJSON(value []byte) error {
9350 var v string
9351 if err := json.Unmarshal(value, &v); err != nil {
9352 return err
9353 }
9354 var ok bool
9355 for _, expected := range enumValues_XdhJwkTestGroupType {
9356 if reflect.DeepEqual(v, expected) {
9357 ok = true
9358 break
9359 }
9360 }
9361 if !ok {
9362 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhJwkTestGroupType, v)
9363 }
9364 *j = XdhJwkTestGroupType(v)
9365 return nil
9366 }
9367
9368
9369 func (j *XdhJwkTestGroup) UnmarshalJSON(value []byte) error {
9370 var raw map[string]interface{}
9371 if err := json.Unmarshal(value, &raw); err != nil {
9372 return err
9373 }
9374 if _, ok := raw["curve"]; raw != nil && !ok {
9375 return fmt.Errorf("field curve in XdhJwkTestGroup: required")
9376 }
9377 if _, ok := raw["source"]; raw != nil && !ok {
9378 return fmt.Errorf("field source in XdhJwkTestGroup: required")
9379 }
9380 if _, ok := raw["tests"]; raw != nil && !ok {
9381 return fmt.Errorf("field tests in XdhJwkTestGroup: required")
9382 }
9383 if _, ok := raw["type"]; raw != nil && !ok {
9384 return fmt.Errorf("field type in XdhJwkTestGroup: required")
9385 }
9386 type Plain XdhJwkTestGroup
9387 var plain Plain
9388 if err := json.Unmarshal(value, &plain); err != nil {
9389 return err
9390 }
9391 *j = XdhJwkTestGroup(plain)
9392 return nil
9393 }
9394
9395 type XdhJwkTestVector struct {
9396
9397 Comment string `json:"comment"`
9398
9399
9400 Flags []string `json:"flags"`
9401
9402
9403 Private JsonWebKey `json:"private"`
9404
9405
9406 Public JsonWebKey `json:"public"`
9407
9408
9409 Result Result `json:"result"`
9410
9411
9412 Shared string `json:"shared"`
9413
9414
9415 TcId int `json:"tcId"`
9416 }
9417
9418
9419 func (j *XdhJwkTestVector) UnmarshalJSON(value []byte) error {
9420 var raw map[string]interface{}
9421 if err := json.Unmarshal(value, &raw); err != nil {
9422 return err
9423 }
9424 if _, ok := raw["comment"]; raw != nil && !ok {
9425 return fmt.Errorf("field comment in XdhJwkTestVector: required")
9426 }
9427 if _, ok := raw["flags"]; raw != nil && !ok {
9428 return fmt.Errorf("field flags in XdhJwkTestVector: required")
9429 }
9430 if _, ok := raw["private"]; raw != nil && !ok {
9431 return fmt.Errorf("field private in XdhJwkTestVector: required")
9432 }
9433 if _, ok := raw["public"]; raw != nil && !ok {
9434 return fmt.Errorf("field public in XdhJwkTestVector: required")
9435 }
9436 if _, ok := raw["result"]; raw != nil && !ok {
9437 return fmt.Errorf("field result in XdhJwkTestVector: required")
9438 }
9439 if _, ok := raw["shared"]; raw != nil && !ok {
9440 return fmt.Errorf("field shared in XdhJwkTestVector: required")
9441 }
9442 if _, ok := raw["tcId"]; raw != nil && !ok {
9443 return fmt.Errorf("field tcId in XdhJwkTestVector: required")
9444 }
9445 type Plain XdhJwkTestVector
9446 var plain Plain
9447 if err := json.Unmarshal(value, &plain); err != nil {
9448 return err
9449 }
9450 *j = XdhJwkTestVector(plain)
9451 return nil
9452 }
9453
9454 type XdhPemCompSchemaV1Json struct {
9455
9456 Algorithm string `json:"algorithm"`
9457
9458
9459 GeneratorVersion *string `json:"generatorVersion,omitempty,omitzero"`
9460
9461
9462 Header []string `json:"header"`
9463
9464
9465 Notes Notes `json:"notes"`
9466
9467
9468 NumberOfTests int `json:"numberOfTests"`
9469
9470
9471 Schema XdhPemCompSchemaV1JsonSchema `json:"schema"`
9472
9473
9474 TestGroups []XdhPemTestGroup `json:"testGroups"`
9475 }
9476
9477 type XdhPemCompSchemaV1JsonSchema string
9478
9479 const XdhPemCompSchemaV1JsonSchemaXdhPemCompSchemaV1Json XdhPemCompSchemaV1JsonSchema = "xdh_pem_comp_schema_v1.json"
9480
9481 var enumValues_XdhPemCompSchemaV1JsonSchema = []interface{}{
9482 "xdh_pem_comp_schema_v1.json",
9483 }
9484
9485
9486 func (j *XdhPemCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
9487 var v string
9488 if err := json.Unmarshal(value, &v); err != nil {
9489 return err
9490 }
9491 var ok bool
9492 for _, expected := range enumValues_XdhPemCompSchemaV1JsonSchema {
9493 if reflect.DeepEqual(v, expected) {
9494 ok = true
9495 break
9496 }
9497 }
9498 if !ok {
9499 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhPemCompSchemaV1JsonSchema, v)
9500 }
9501 *j = XdhPemCompSchemaV1JsonSchema(v)
9502 return nil
9503 }
9504
9505
9506 func (j *XdhPemCompSchemaV1Json) UnmarshalJSON(value []byte) error {
9507 var raw map[string]interface{}
9508 if err := json.Unmarshal(value, &raw); err != nil {
9509 return err
9510 }
9511 if _, ok := raw["algorithm"]; raw != nil && !ok {
9512 return fmt.Errorf("field algorithm in XdhPemCompSchemaV1Json: required")
9513 }
9514 if _, ok := raw["header"]; raw != nil && !ok {
9515 return fmt.Errorf("field header in XdhPemCompSchemaV1Json: required")
9516 }
9517 if _, ok := raw["notes"]; raw != nil && !ok {
9518 return fmt.Errorf("field notes in XdhPemCompSchemaV1Json: required")
9519 }
9520 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
9521 return fmt.Errorf("field numberOfTests in XdhPemCompSchemaV1Json: required")
9522 }
9523 if _, ok := raw["schema"]; raw != nil && !ok {
9524 return fmt.Errorf("field schema in XdhPemCompSchemaV1Json: required")
9525 }
9526 if _, ok := raw["testGroups"]; raw != nil && !ok {
9527 return fmt.Errorf("field testGroups in XdhPemCompSchemaV1Json: required")
9528 }
9529 type Plain XdhPemCompSchemaV1Json
9530 var plain Plain
9531 if err := json.Unmarshal(value, &plain); err != nil {
9532 return err
9533 }
9534 *j = XdhPemCompSchemaV1Json(plain)
9535 return nil
9536 }
9537
9538 type XdhPemTestGroup struct {
9539
9540 Curve string `json:"curve"`
9541
9542
9543 Source Source `json:"source"`
9544
9545
9546 Tests []XdhPemTestVector `json:"tests"`
9547
9548
9549 Type XdhPemTestGroupType `json:"type"`
9550 }
9551
9552 type XdhPemTestGroupType string
9553
9554 const XdhPemTestGroupTypeXdhPemComp XdhPemTestGroupType = "XdhPemComp"
9555
9556 var enumValues_XdhPemTestGroupType = []interface{}{
9557 "XdhPemComp",
9558 }
9559
9560
9561 func (j *XdhPemTestGroupType) UnmarshalJSON(value []byte) error {
9562 var v string
9563 if err := json.Unmarshal(value, &v); err != nil {
9564 return err
9565 }
9566 var ok bool
9567 for _, expected := range enumValues_XdhPemTestGroupType {
9568 if reflect.DeepEqual(v, expected) {
9569 ok = true
9570 break
9571 }
9572 }
9573 if !ok {
9574 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhPemTestGroupType, v)
9575 }
9576 *j = XdhPemTestGroupType(v)
9577 return nil
9578 }
9579
9580
9581 func (j *XdhPemTestGroup) UnmarshalJSON(value []byte) error {
9582 var raw map[string]interface{}
9583 if err := json.Unmarshal(value, &raw); err != nil {
9584 return err
9585 }
9586 if _, ok := raw["curve"]; raw != nil && !ok {
9587 return fmt.Errorf("field curve in XdhPemTestGroup: required")
9588 }
9589 if _, ok := raw["source"]; raw != nil && !ok {
9590 return fmt.Errorf("field source in XdhPemTestGroup: required")
9591 }
9592 if _, ok := raw["tests"]; raw != nil && !ok {
9593 return fmt.Errorf("field tests in XdhPemTestGroup: required")
9594 }
9595 if _, ok := raw["type"]; raw != nil && !ok {
9596 return fmt.Errorf("field type in XdhPemTestGroup: required")
9597 }
9598 type Plain XdhPemTestGroup
9599 var plain Plain
9600 if err := json.Unmarshal(value, &plain); err != nil {
9601 return err
9602 }
9603 *j = XdhPemTestGroup(plain)
9604 return nil
9605 }
9606
9607 type XdhPemTestVector struct {
9608
9609 Comment string `json:"comment"`
9610
9611
9612 Flags []string `json:"flags"`
9613
9614
9615 Private string `json:"private"`
9616
9617
9618 Public string `json:"public"`
9619
9620
9621 Result Result `json:"result"`
9622
9623
9624 Shared string `json:"shared"`
9625
9626
9627 TcId int `json:"tcId"`
9628 }
9629
9630
9631 func (j *XdhPemTestVector) UnmarshalJSON(value []byte) error {
9632 var raw map[string]interface{}
9633 if err := json.Unmarshal(value, &raw); err != nil {
9634 return err
9635 }
9636 if _, ok := raw["comment"]; raw != nil && !ok {
9637 return fmt.Errorf("field comment in XdhPemTestVector: required")
9638 }
9639 if _, ok := raw["flags"]; raw != nil && !ok {
9640 return fmt.Errorf("field flags in XdhPemTestVector: required")
9641 }
9642 if _, ok := raw["private"]; raw != nil && !ok {
9643 return fmt.Errorf("field private in XdhPemTestVector: required")
9644 }
9645 if _, ok := raw["public"]; raw != nil && !ok {
9646 return fmt.Errorf("field public in XdhPemTestVector: required")
9647 }
9648 if _, ok := raw["result"]; raw != nil && !ok {
9649 return fmt.Errorf("field result in XdhPemTestVector: required")
9650 }
9651 if _, ok := raw["shared"]; raw != nil && !ok {
9652 return fmt.Errorf("field shared in XdhPemTestVector: required")
9653 }
9654 if _, ok := raw["tcId"]; raw != nil && !ok {
9655 return fmt.Errorf("field tcId in XdhPemTestVector: required")
9656 }
9657 type Plain XdhPemTestVector
9658 var plain Plain
9659 if err := json.Unmarshal(value, &plain); err != nil {
9660 return err
9661 }
9662 *j = XdhPemTestVector(plain)
9663 return nil
9664 }
9665
9666 type XdhTestGroup struct {
9667
9668 Curve string `json:"curve"`
9669
9670
9671 Source Source `json:"source"`
9672
9673
9674 Tests []XdhTestVector `json:"tests"`
9675
9676
9677 Type XdhTestGroupType `json:"type"`
9678 }
9679
9680 type XdhTestGroupType string
9681
9682 const XdhTestGroupTypeXdhComp XdhTestGroupType = "XdhComp"
9683
9684 var enumValues_XdhTestGroupType = []interface{}{
9685 "XdhComp",
9686 }
9687
9688
9689 func (j *XdhTestGroupType) UnmarshalJSON(value []byte) error {
9690 var v string
9691 if err := json.Unmarshal(value, &v); err != nil {
9692 return err
9693 }
9694 var ok bool
9695 for _, expected := range enumValues_XdhTestGroupType {
9696 if reflect.DeepEqual(v, expected) {
9697 ok = true
9698 break
9699 }
9700 }
9701 if !ok {
9702 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhTestGroupType, v)
9703 }
9704 *j = XdhTestGroupType(v)
9705 return nil
9706 }
9707
9708
9709 func (j *XdhTestGroup) UnmarshalJSON(value []byte) error {
9710 var raw map[string]interface{}
9711 if err := json.Unmarshal(value, &raw); err != nil {
9712 return err
9713 }
9714 if _, ok := raw["curve"]; raw != nil && !ok {
9715 return fmt.Errorf("field curve in XdhTestGroup: required")
9716 }
9717 if _, ok := raw["source"]; raw != nil && !ok {
9718 return fmt.Errorf("field source in XdhTestGroup: required")
9719 }
9720 if _, ok := raw["tests"]; raw != nil && !ok {
9721 return fmt.Errorf("field tests in XdhTestGroup: required")
9722 }
9723 if _, ok := raw["type"]; raw != nil && !ok {
9724 return fmt.Errorf("field type in XdhTestGroup: required")
9725 }
9726 type Plain XdhTestGroup
9727 var plain Plain
9728 if err := json.Unmarshal(value, &plain); err != nil {
9729 return err
9730 }
9731 *j = XdhTestGroup(plain)
9732 return nil
9733 }
9734
9735 type XdhTestVector struct {
9736
9737 Comment string `json:"comment"`
9738
9739
9740 Flags []string `json:"flags"`
9741
9742
9743 Private string `json:"private"`
9744
9745
9746 Public string `json:"public"`
9747
9748
9749 Result Result `json:"result"`
9750
9751
9752 Shared string `json:"shared"`
9753
9754
9755 TcId int `json:"tcId"`
9756 }
9757
9758
9759 func (j *XdhTestVector) UnmarshalJSON(value []byte) error {
9760 var raw map[string]interface{}
9761 if err := json.Unmarshal(value, &raw); err != nil {
9762 return err
9763 }
9764 if _, ok := raw["comment"]; raw != nil && !ok {
9765 return fmt.Errorf("field comment in XdhTestVector: required")
9766 }
9767 if _, ok := raw["flags"]; raw != nil && !ok {
9768 return fmt.Errorf("field flags in XdhTestVector: required")
9769 }
9770 if _, ok := raw["private"]; raw != nil && !ok {
9771 return fmt.Errorf("field private in XdhTestVector: required")
9772 }
9773 if _, ok := raw["public"]; raw != nil && !ok {
9774 return fmt.Errorf("field public in XdhTestVector: required")
9775 }
9776 if _, ok := raw["result"]; raw != nil && !ok {
9777 return fmt.Errorf("field result in XdhTestVector: required")
9778 }
9779 if _, ok := raw["shared"]; raw != nil && !ok {
9780 return fmt.Errorf("field shared in XdhTestVector: required")
9781 }
9782 if _, ok := raw["tcId"]; raw != nil && !ok {
9783 return fmt.Errorf("field tcId in XdhTestVector: required")
9784 }
9785 type Plain XdhTestVector
9786 var plain Plain
9787 if err := json.Unmarshal(value, &plain); err != nil {
9788 return err
9789 }
9790 *j = XdhTestVector(plain)
9791 return nil
9792 }
9793
View as plain text