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"`
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"`
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"`
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"`
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"`
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"`
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"`
1710
1711
1712 Flags []string `json:"flags,omitempty"`
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"`
1728
1729
1730 Oid string `json:"oid"`
1731
1732
1733 P string `json:"p"`
1734
1735
1736 Ref *string `json:"ref,omitempty"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
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"`
3843
3844
3845 Private JsonWebKeyOrKeyset `json:"private,omitempty"`
3846
3847
3848 Public JsonWebKeyOrKeyset `json:"public,omitempty"`
3849
3850
3851 Source Source `json:"source"`
3852
3853
3854 Tests []JsonWebCryptoTestVector `json:"tests"`
3855
3856
3857 Type *JsonWebCryptoTestGroupType `json:"type,omitempty"`
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"`
3918
3919
3920 Jws interface{} `json:"jws,omitempty"`
3921
3922
3923 Pt *string `json:"pt,omitempty"`
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"`
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"`
4040
4041
4042 Private *JsonWebKey `json:"private,omitempty"`
4043
4044
4045 Public *JsonWebKey `json:"public,omitempty"`
4046
4047
4048 Source Source `json:"source"`
4049
4050
4051 Tests []JsonWebEncryptionTestVector `json:"tests"`
4052
4053
4054 Type *JsonWebEncryptionTestGroupType `json:"type,omitempty"`
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"`
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"`
4167
4168
4169 Crv *JsonWebKeyCrv `json:"crv,omitempty"`
4170
4171
4172 D *string `json:"d,omitempty"`
4173
4174
4175 Dp *string `json:"dp,omitempty"`
4176
4177
4178 Dq *string `json:"dq,omitempty"`
4179
4180
4181 E *string `json:"e,omitempty"`
4182
4183
4184 K *string `json:"k,omitempty"`
4185
4186
4187 KeyOps []string `json:"key_ops,omitempty"`
4188
4189
4190 Kid *string `json:"kid,omitempty"`
4191
4192
4193 Kty *JsonWebKeyKty `json:"kty,omitempty"`
4194
4195
4196 N *string `json:"n,omitempty"`
4197
4198
4199 P *string `json:"p,omitempty"`
4200
4201
4202 Q *string `json:"q,omitempty"`
4203
4204
4205 Qi *string `json:"qi,omitempty"`
4206
4207
4208 Use *JsonWebKeyUse `json:"use,omitempty"`
4209
4210
4211 X *string `json:"x,omitempty"`
4212
4213
4214 Y *string `json:"y,omitempty"`
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"`
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"`
4380
4381
4382 Private *JsonWebKeyset `json:"private,omitempty"`
4383
4384
4385 Public *JsonWebKeyset `json:"public,omitempty"`
4386
4387
4388 Source Source `json:"source"`
4389
4390
4391 Tests []JsonWebKeyTestVector `json:"tests"`
4392
4393
4394 Type *JsonWebKeyTestGroupType `json:"type,omitempty"`
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"`
4527 }
4528
4529 type JsonWebSignatureSchemaV1Json struct {
4530
4531 GeneratorVersion *string `json:"generatorVersion,omitempty"`
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"`
4610
4611
4612 Private *JsonWebKey `json:"private,omitempty"`
4613
4614
4615 Public *JsonWebKey `json:"public,omitempty"`
4616
4617
4618 Source Source `json:"source"`
4619
4620
4621 Tests []JsonWebSignatureTestVector `json:"tests"`
4622
4623
4624 Type *JsonWebSignatureTestGroupType `json:"type,omitempty"`
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"`
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 C string `json:"c"`
4985
4986
4987 Comment *string `json:"comment,omitempty"`
4988
4989
4990 Dk string `json:"dk"`
4991
4992
4993 Flags []string `json:"flags"`
4994
4995
4996 Result Result `json:"result"`
4997
4998
4999 TcId int `json:"tcId"`
5000 }
5001
5002
5003 func (j *MLKEMDecapsTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5004 var raw map[string]interface{}
5005 if err := json.Unmarshal(value, &raw); err != nil {
5006 return err
5007 }
5008 if _, ok := raw["c"]; raw != nil && !ok {
5009 return fmt.Errorf("field c in MLKEMDecapsTestGroupTestsElem: required")
5010 }
5011 if _, ok := raw["dk"]; raw != nil && !ok {
5012 return fmt.Errorf("field dk in MLKEMDecapsTestGroupTestsElem: required")
5013 }
5014 if _, ok := raw["flags"]; raw != nil && !ok {
5015 return fmt.Errorf("field flags in MLKEMDecapsTestGroupTestsElem: required")
5016 }
5017 if _, ok := raw["result"]; raw != nil && !ok {
5018 return fmt.Errorf("field result in MLKEMDecapsTestGroupTestsElem: required")
5019 }
5020 if _, ok := raw["tcId"]; raw != nil && !ok {
5021 return fmt.Errorf("field tcId in MLKEMDecapsTestGroupTestsElem: required")
5022 }
5023 type Plain MLKEMDecapsTestGroupTestsElem
5024 var plain Plain
5025 if err := json.Unmarshal(value, &plain); err != nil {
5026 return err
5027 }
5028 *j = MLKEMDecapsTestGroupTestsElem(plain)
5029 return nil
5030 }
5031
5032 type MLKEMDecapsTestGroupType string
5033
5034 const MLKEMDecapsTestGroupTypeMLKEMDecapsValidationTest MLKEMDecapsTestGroupType = "MLKEMDecapsValidationTest"
5035
5036 var enumValues_MLKEMDecapsTestGroupType = []interface{}{
5037 "MLKEMDecapsValidationTest",
5038 }
5039
5040
5041 func (j *MLKEMDecapsTestGroupType) UnmarshalJSON(value []byte) error {
5042 var v string
5043 if err := json.Unmarshal(value, &v); err != nil {
5044 return err
5045 }
5046 var ok bool
5047 for _, expected := range enumValues_MLKEMDecapsTestGroupType {
5048 if reflect.DeepEqual(v, expected) {
5049 ok = true
5050 break
5051 }
5052 }
5053 if !ok {
5054 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMDecapsTestGroupType, v)
5055 }
5056 *j = MLKEMDecapsTestGroupType(v)
5057 return nil
5058 }
5059
5060
5061 func (j *MLKEMDecapsTestGroup) UnmarshalJSON(value []byte) error {
5062 var raw map[string]interface{}
5063 if err := json.Unmarshal(value, &raw); err != nil {
5064 return err
5065 }
5066 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5067 return fmt.Errorf("field parameterSet in MLKEMDecapsTestGroup: required")
5068 }
5069 if _, ok := raw["source"]; raw != nil && !ok {
5070 return fmt.Errorf("field source in MLKEMDecapsTestGroup: required")
5071 }
5072 if _, ok := raw["tests"]; raw != nil && !ok {
5073 return fmt.Errorf("field tests in MLKEMDecapsTestGroup: required")
5074 }
5075 if _, ok := raw["type"]; raw != nil && !ok {
5076 return fmt.Errorf("field type in MLKEMDecapsTestGroup: required")
5077 }
5078 type Plain MLKEMDecapsTestGroup
5079 var plain Plain
5080 if err := json.Unmarshal(value, &plain); err != nil {
5081 return err
5082 }
5083 *j = MLKEMDecapsTestGroup(plain)
5084 return nil
5085 }
5086
5087
5088 type MLKEMEncapsTestGroup struct {
5089
5090 ParameterSet MLKEMEncapsTestGroupParameterSet `json:"parameterSet"`
5091
5092
5093 Source Source `json:"source"`
5094
5095
5096 Tests []MLKEMEncapsTestGroupTestsElem `json:"tests"`
5097
5098
5099 Type *MLKEMEncapsTestGroupType `json:"type,omitempty"`
5100 }
5101
5102 type MLKEMEncapsTestGroupParameterSet string
5103
5104 const MLKEMEncapsTestGroupParameterSetMLKEM1024 MLKEMEncapsTestGroupParameterSet = "ML-KEM-1024"
5105 const MLKEMEncapsTestGroupParameterSetMLKEM512 MLKEMEncapsTestGroupParameterSet = "ML-KEM-512"
5106 const MLKEMEncapsTestGroupParameterSetMLKEM768 MLKEMEncapsTestGroupParameterSet = "ML-KEM-768"
5107
5108 var enumValues_MLKEMEncapsTestGroupParameterSet = []interface{}{
5109 "ML-KEM-512",
5110 "ML-KEM-768",
5111 "ML-KEM-1024",
5112 }
5113
5114
5115 func (j *MLKEMEncapsTestGroupParameterSet) UnmarshalJSON(value []byte) error {
5116 var v string
5117 if err := json.Unmarshal(value, &v); err != nil {
5118 return err
5119 }
5120 var ok bool
5121 for _, expected := range enumValues_MLKEMEncapsTestGroupParameterSet {
5122 if reflect.DeepEqual(v, expected) {
5123 ok = true
5124 break
5125 }
5126 }
5127 if !ok {
5128 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMEncapsTestGroupParameterSet, v)
5129 }
5130 *j = MLKEMEncapsTestGroupParameterSet(v)
5131 return nil
5132 }
5133
5134 type MLKEMEncapsTestGroupTestsElem struct {
5135
5136 K string `json:"K"`
5137
5138
5139 C string `json:"c"`
5140
5141
5142 Comment *string `json:"comment,omitempty"`
5143
5144
5145 Ek string `json:"ek"`
5146
5147
5148 Flags []string `json:"flags"`
5149
5150
5151 M string `json:"m"`
5152
5153
5154 Result Result `json:"result"`
5155
5156
5157 TcId int `json:"tcId"`
5158 }
5159
5160
5161 func (j *MLKEMEncapsTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5162 var raw map[string]interface{}
5163 if err := json.Unmarshal(value, &raw); err != nil {
5164 return err
5165 }
5166 if _, ok := raw["K"]; raw != nil && !ok {
5167 return fmt.Errorf("field K in MLKEMEncapsTestGroupTestsElem: required")
5168 }
5169 if _, ok := raw["c"]; raw != nil && !ok {
5170 return fmt.Errorf("field c in MLKEMEncapsTestGroupTestsElem: required")
5171 }
5172 if _, ok := raw["ek"]; raw != nil && !ok {
5173 return fmt.Errorf("field ek in MLKEMEncapsTestGroupTestsElem: required")
5174 }
5175 if _, ok := raw["flags"]; raw != nil && !ok {
5176 return fmt.Errorf("field flags in MLKEMEncapsTestGroupTestsElem: required")
5177 }
5178 if _, ok := raw["m"]; raw != nil && !ok {
5179 return fmt.Errorf("field m in MLKEMEncapsTestGroupTestsElem: required")
5180 }
5181 if _, ok := raw["result"]; raw != nil && !ok {
5182 return fmt.Errorf("field result in MLKEMEncapsTestGroupTestsElem: required")
5183 }
5184 if _, ok := raw["tcId"]; raw != nil && !ok {
5185 return fmt.Errorf("field tcId in MLKEMEncapsTestGroupTestsElem: required")
5186 }
5187 type Plain MLKEMEncapsTestGroupTestsElem
5188 var plain Plain
5189 if err := json.Unmarshal(value, &plain); err != nil {
5190 return err
5191 }
5192 *j = MLKEMEncapsTestGroupTestsElem(plain)
5193 return nil
5194 }
5195
5196 type MLKEMEncapsTestGroupType string
5197
5198 const MLKEMEncapsTestGroupTypeMLKEMEncapsTest MLKEMEncapsTestGroupType = "MLKEMEncapsTest"
5199
5200 var enumValues_MLKEMEncapsTestGroupType = []interface{}{
5201 "MLKEMEncapsTest",
5202 }
5203
5204
5205 func (j *MLKEMEncapsTestGroupType) UnmarshalJSON(value []byte) error {
5206 var v string
5207 if err := json.Unmarshal(value, &v); err != nil {
5208 return err
5209 }
5210 var ok bool
5211 for _, expected := range enumValues_MLKEMEncapsTestGroupType {
5212 if reflect.DeepEqual(v, expected) {
5213 ok = true
5214 break
5215 }
5216 }
5217 if !ok {
5218 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMEncapsTestGroupType, v)
5219 }
5220 *j = MLKEMEncapsTestGroupType(v)
5221 return nil
5222 }
5223
5224
5225 func (j *MLKEMEncapsTestGroup) UnmarshalJSON(value []byte) error {
5226 var raw map[string]interface{}
5227 if err := json.Unmarshal(value, &raw); err != nil {
5228 return err
5229 }
5230 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5231 return fmt.Errorf("field parameterSet in MLKEMEncapsTestGroup: required")
5232 }
5233 if _, ok := raw["source"]; raw != nil && !ok {
5234 return fmt.Errorf("field source in MLKEMEncapsTestGroup: required")
5235 }
5236 if _, ok := raw["tests"]; raw != nil && !ok {
5237 return fmt.Errorf("field tests in MLKEMEncapsTestGroup: required")
5238 }
5239 type Plain MLKEMEncapsTestGroup
5240 var plain Plain
5241 if err := json.Unmarshal(value, &plain); err != nil {
5242 return err
5243 }
5244 *j = MLKEMEncapsTestGroup(plain)
5245 return nil
5246 }
5247
5248
5249 type MLKEMKeyGenTestGroup struct {
5250
5251 ParameterSet MLKEMKeyGenTestGroupParameterSet `json:"parameterSet"`
5252
5253
5254 Source Source `json:"source"`
5255
5256
5257 Tests []MLKEMKeyGenTestGroupTestsElem `json:"tests"`
5258
5259
5260 Type MLKEMKeyGenTestGroupType `json:"type"`
5261 }
5262
5263 type MLKEMKeyGenTestGroupParameterSet string
5264
5265 const MLKEMKeyGenTestGroupParameterSetMLKEM1024 MLKEMKeyGenTestGroupParameterSet = "ML-KEM-1024"
5266 const MLKEMKeyGenTestGroupParameterSetMLKEM512 MLKEMKeyGenTestGroupParameterSet = "ML-KEM-512"
5267 const MLKEMKeyGenTestGroupParameterSetMLKEM768 MLKEMKeyGenTestGroupParameterSet = "ML-KEM-768"
5268
5269 var enumValues_MLKEMKeyGenTestGroupParameterSet = []interface{}{
5270 "ML-KEM-512",
5271 "ML-KEM-768",
5272 "ML-KEM-1024",
5273 }
5274
5275
5276 func (j *MLKEMKeyGenTestGroupParameterSet) UnmarshalJSON(value []byte) error {
5277 var v string
5278 if err := json.Unmarshal(value, &v); err != nil {
5279 return err
5280 }
5281 var ok bool
5282 for _, expected := range enumValues_MLKEMKeyGenTestGroupParameterSet {
5283 if reflect.DeepEqual(v, expected) {
5284 ok = true
5285 break
5286 }
5287 }
5288 if !ok {
5289 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMKeyGenTestGroupParameterSet, v)
5290 }
5291 *j = MLKEMKeyGenTestGroupParameterSet(v)
5292 return nil
5293 }
5294
5295 type MLKEMKeyGenTestGroupTestsElem struct {
5296
5297 Comment *string `json:"comment,omitempty"`
5298
5299
5300 Dk string `json:"dk"`
5301
5302
5303 Ek string `json:"ek"`
5304
5305
5306 Flags []string `json:"flags,omitempty"`
5307
5308
5309 Result Result `json:"result"`
5310
5311
5312 Seed string `json:"seed"`
5313
5314
5315 TcId int `json:"tcId"`
5316 }
5317
5318
5319 func (j *MLKEMKeyGenTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5320 var raw map[string]interface{}
5321 if err := json.Unmarshal(value, &raw); err != nil {
5322 return err
5323 }
5324 if _, ok := raw["dk"]; raw != nil && !ok {
5325 return fmt.Errorf("field dk in MLKEMKeyGenTestGroupTestsElem: required")
5326 }
5327 if _, ok := raw["ek"]; raw != nil && !ok {
5328 return fmt.Errorf("field ek in MLKEMKeyGenTestGroupTestsElem: required")
5329 }
5330 if _, ok := raw["result"]; raw != nil && !ok {
5331 return fmt.Errorf("field result in MLKEMKeyGenTestGroupTestsElem: required")
5332 }
5333 if _, ok := raw["seed"]; raw != nil && !ok {
5334 return fmt.Errorf("field seed in MLKEMKeyGenTestGroupTestsElem: required")
5335 }
5336 if _, ok := raw["tcId"]; raw != nil && !ok {
5337 return fmt.Errorf("field tcId in MLKEMKeyGenTestGroupTestsElem: required")
5338 }
5339 type Plain MLKEMKeyGenTestGroupTestsElem
5340 var plain Plain
5341 if err := json.Unmarshal(value, &plain); err != nil {
5342 return err
5343 }
5344 *j = MLKEMKeyGenTestGroupTestsElem(plain)
5345 return nil
5346 }
5347
5348 type MLKEMKeyGenTestGroupType string
5349
5350 const MLKEMKeyGenTestGroupTypeMLKEMKeyGen MLKEMKeyGenTestGroupType = "MLKEMKeyGen"
5351
5352 var enumValues_MLKEMKeyGenTestGroupType = []interface{}{
5353 "MLKEMKeyGen",
5354 }
5355
5356
5357 func (j *MLKEMKeyGenTestGroupType) UnmarshalJSON(value []byte) error {
5358 var v string
5359 if err := json.Unmarshal(value, &v); err != nil {
5360 return err
5361 }
5362 var ok bool
5363 for _, expected := range enumValues_MLKEMKeyGenTestGroupType {
5364 if reflect.DeepEqual(v, expected) {
5365 ok = true
5366 break
5367 }
5368 }
5369 if !ok {
5370 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMKeyGenTestGroupType, v)
5371 }
5372 *j = MLKEMKeyGenTestGroupType(v)
5373 return nil
5374 }
5375
5376
5377 func (j *MLKEMKeyGenTestGroup) UnmarshalJSON(value []byte) error {
5378 var raw map[string]interface{}
5379 if err := json.Unmarshal(value, &raw); err != nil {
5380 return err
5381 }
5382 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5383 return fmt.Errorf("field parameterSet in MLKEMKeyGenTestGroup: required")
5384 }
5385 if _, ok := raw["source"]; raw != nil && !ok {
5386 return fmt.Errorf("field source in MLKEMKeyGenTestGroup: required")
5387 }
5388 if _, ok := raw["tests"]; raw != nil && !ok {
5389 return fmt.Errorf("field tests in MLKEMKeyGenTestGroup: required")
5390 }
5391 if _, ok := raw["type"]; raw != nil && !ok {
5392 return fmt.Errorf("field type in MLKEMKeyGenTestGroup: required")
5393 }
5394 type Plain MLKEMKeyGenTestGroup
5395 var plain Plain
5396 if err := json.Unmarshal(value, &plain); err != nil {
5397 return err
5398 }
5399 *j = MLKEMKeyGenTestGroup(plain)
5400 return nil
5401 }
5402
5403
5404 type MLKEMTestGroup struct {
5405
5406 ParameterSet MLKEMTestGroupParameterSet `json:"parameterSet"`
5407
5408
5409 Source Source `json:"source"`
5410
5411
5412 Tests []MLKEMTestGroupTestsElem `json:"tests"`
5413
5414
5415 Type MLKEMTestGroupType `json:"type"`
5416 }
5417
5418 type MLKEMTestGroupParameterSet string
5419
5420 const MLKEMTestGroupParameterSetMLKEM1024 MLKEMTestGroupParameterSet = "ML-KEM-1024"
5421 const MLKEMTestGroupParameterSetMLKEM512 MLKEMTestGroupParameterSet = "ML-KEM-512"
5422 const MLKEMTestGroupParameterSetMLKEM768 MLKEMTestGroupParameterSet = "ML-KEM-768"
5423
5424 var enumValues_MLKEMTestGroupParameterSet = []interface{}{
5425 "ML-KEM-512",
5426 "ML-KEM-768",
5427 "ML-KEM-1024",
5428 }
5429
5430
5431 func (j *MLKEMTestGroupParameterSet) UnmarshalJSON(value []byte) error {
5432 var v string
5433 if err := json.Unmarshal(value, &v); err != nil {
5434 return err
5435 }
5436 var ok bool
5437 for _, expected := range enumValues_MLKEMTestGroupParameterSet {
5438 if reflect.DeepEqual(v, expected) {
5439 ok = true
5440 break
5441 }
5442 }
5443 if !ok {
5444 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMTestGroupParameterSet, v)
5445 }
5446 *j = MLKEMTestGroupParameterSet(v)
5447 return nil
5448 }
5449
5450 type MLKEMTestGroupTestsElem struct {
5451
5452 K string `json:"K"`
5453
5454
5455 C string `json:"c"`
5456
5457
5458 Comment *string `json:"comment,omitempty"`
5459
5460
5461 Ek *string `json:"ek,omitempty"`
5462
5463
5464 Flags []string `json:"flags"`
5465
5466
5467 Result Result `json:"result"`
5468
5469
5470 Seed string `json:"seed"`
5471
5472
5473 TcId int `json:"tcId"`
5474 }
5475
5476
5477 func (j *MLKEMTestGroupTestsElem) UnmarshalJSON(value []byte) error {
5478 var raw map[string]interface{}
5479 if err := json.Unmarshal(value, &raw); err != nil {
5480 return err
5481 }
5482 if _, ok := raw["K"]; raw != nil && !ok {
5483 return fmt.Errorf("field K in MLKEMTestGroupTestsElem: required")
5484 }
5485 if _, ok := raw["c"]; raw != nil && !ok {
5486 return fmt.Errorf("field c in MLKEMTestGroupTestsElem: required")
5487 }
5488 if _, ok := raw["flags"]; raw != nil && !ok {
5489 return fmt.Errorf("field flags in MLKEMTestGroupTestsElem: required")
5490 }
5491 if _, ok := raw["result"]; raw != nil && !ok {
5492 return fmt.Errorf("field result in MLKEMTestGroupTestsElem: required")
5493 }
5494 if _, ok := raw["seed"]; raw != nil && !ok {
5495 return fmt.Errorf("field seed in MLKEMTestGroupTestsElem: required")
5496 }
5497 if _, ok := raw["tcId"]; raw != nil && !ok {
5498 return fmt.Errorf("field tcId in MLKEMTestGroupTestsElem: required")
5499 }
5500 type Plain MLKEMTestGroupTestsElem
5501 var plain Plain
5502 if err := json.Unmarshal(value, &plain); err != nil {
5503 return err
5504 }
5505 *j = MLKEMTestGroupTestsElem(plain)
5506 return nil
5507 }
5508
5509 type MLKEMTestGroupType string
5510
5511 const MLKEMTestGroupTypeMLKEMTest MLKEMTestGroupType = "MLKEMTest"
5512
5513 var enumValues_MLKEMTestGroupType = []interface{}{
5514 "MLKEMTest",
5515 }
5516
5517
5518 func (j *MLKEMTestGroupType) UnmarshalJSON(value []byte) error {
5519 var v string
5520 if err := json.Unmarshal(value, &v); err != nil {
5521 return err
5522 }
5523 var ok bool
5524 for _, expected := range enumValues_MLKEMTestGroupType {
5525 if reflect.DeepEqual(v, expected) {
5526 ok = true
5527 break
5528 }
5529 }
5530 if !ok {
5531 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MLKEMTestGroupType, v)
5532 }
5533 *j = MLKEMTestGroupType(v)
5534 return nil
5535 }
5536
5537
5538 func (j *MLKEMTestGroup) UnmarshalJSON(value []byte) error {
5539 var raw map[string]interface{}
5540 if err := json.Unmarshal(value, &raw); err != nil {
5541 return err
5542 }
5543 if _, ok := raw["parameterSet"]; raw != nil && !ok {
5544 return fmt.Errorf("field parameterSet in MLKEMTestGroup: required")
5545 }
5546 if _, ok := raw["source"]; raw != nil && !ok {
5547 return fmt.Errorf("field source in MLKEMTestGroup: required")
5548 }
5549 if _, ok := raw["tests"]; raw != nil && !ok {
5550 return fmt.Errorf("field tests in MLKEMTestGroup: required")
5551 }
5552 if _, ok := raw["type"]; raw != nil && !ok {
5553 return fmt.Errorf("field type in MLKEMTestGroup: required")
5554 }
5555 type Plain MLKEMTestGroup
5556 var plain Plain
5557 if err := json.Unmarshal(value, &plain); err != nil {
5558 return err
5559 }
5560 *j = MLKEMTestGroup(plain)
5561 return nil
5562 }
5563
5564 type MacTestGroup struct {
5565
5566 KeySize int `json:"keySize"`
5567
5568
5569 Source Source `json:"source"`
5570
5571
5572 TagSize int `json:"tagSize"`
5573
5574
5575 Tests []MacTestVector `json:"tests"`
5576
5577
5578 Type MacTestGroupType `json:"type"`
5579 }
5580
5581 type MacTestGroupType string
5582
5583 const MacTestGroupTypeMacTest MacTestGroupType = "MacTest"
5584
5585 var enumValues_MacTestGroupType = []interface{}{
5586 "MacTest",
5587 }
5588
5589
5590 func (j *MacTestGroupType) UnmarshalJSON(value []byte) error {
5591 var v string
5592 if err := json.Unmarshal(value, &v); err != nil {
5593 return err
5594 }
5595 var ok bool
5596 for _, expected := range enumValues_MacTestGroupType {
5597 if reflect.DeepEqual(v, expected) {
5598 ok = true
5599 break
5600 }
5601 }
5602 if !ok {
5603 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacTestGroupType, v)
5604 }
5605 *j = MacTestGroupType(v)
5606 return nil
5607 }
5608
5609
5610 func (j *MacTestGroup) UnmarshalJSON(value []byte) error {
5611 var raw map[string]interface{}
5612 if err := json.Unmarshal(value, &raw); err != nil {
5613 return err
5614 }
5615 if _, ok := raw["keySize"]; raw != nil && !ok {
5616 return fmt.Errorf("field keySize in MacTestGroup: required")
5617 }
5618 if _, ok := raw["source"]; raw != nil && !ok {
5619 return fmt.Errorf("field source in MacTestGroup: required")
5620 }
5621 if _, ok := raw["tagSize"]; raw != nil && !ok {
5622 return fmt.Errorf("field tagSize in MacTestGroup: required")
5623 }
5624 if _, ok := raw["tests"]; raw != nil && !ok {
5625 return fmt.Errorf("field tests in MacTestGroup: required")
5626 }
5627 if _, ok := raw["type"]; raw != nil && !ok {
5628 return fmt.Errorf("field type in MacTestGroup: required")
5629 }
5630 type Plain MacTestGroup
5631 var plain Plain
5632 if err := json.Unmarshal(value, &plain); err != nil {
5633 return err
5634 }
5635 *j = MacTestGroup(plain)
5636 return nil
5637 }
5638
5639 type MacTestSchemaV1Json struct {
5640
5641 Algorithm string `json:"algorithm"`
5642
5643
5644 GeneratorVersion *string `json:"generatorVersion,omitempty"`
5645
5646
5647 Header []string `json:"header"`
5648
5649
5650 Notes Notes `json:"notes"`
5651
5652
5653 NumberOfTests int `json:"numberOfTests"`
5654
5655
5656 Schema MacTestSchemaV1JsonSchema `json:"schema"`
5657
5658
5659 TestGroups []MacTestGroup `json:"testGroups"`
5660 }
5661
5662 type MacTestSchemaV1JsonSchema string
5663
5664 const MacTestSchemaV1JsonSchemaMacTestSchemaV1Json MacTestSchemaV1JsonSchema = "mac_test_schema_v1.json"
5665
5666 var enumValues_MacTestSchemaV1JsonSchema = []interface{}{
5667 "mac_test_schema_v1.json",
5668 }
5669
5670
5671 func (j *MacTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
5672 var v string
5673 if err := json.Unmarshal(value, &v); err != nil {
5674 return err
5675 }
5676 var ok bool
5677 for _, expected := range enumValues_MacTestSchemaV1JsonSchema {
5678 if reflect.DeepEqual(v, expected) {
5679 ok = true
5680 break
5681 }
5682 }
5683 if !ok {
5684 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacTestSchemaV1JsonSchema, v)
5685 }
5686 *j = MacTestSchemaV1JsonSchema(v)
5687 return nil
5688 }
5689
5690
5691 func (j *MacTestSchemaV1Json) UnmarshalJSON(value []byte) error {
5692 var raw map[string]interface{}
5693 if err := json.Unmarshal(value, &raw); err != nil {
5694 return err
5695 }
5696 if _, ok := raw["algorithm"]; raw != nil && !ok {
5697 return fmt.Errorf("field algorithm in MacTestSchemaV1Json: required")
5698 }
5699 if _, ok := raw["header"]; raw != nil && !ok {
5700 return fmt.Errorf("field header in MacTestSchemaV1Json: required")
5701 }
5702 if _, ok := raw["notes"]; raw != nil && !ok {
5703 return fmt.Errorf("field notes in MacTestSchemaV1Json: required")
5704 }
5705 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
5706 return fmt.Errorf("field numberOfTests in MacTestSchemaV1Json: required")
5707 }
5708 if _, ok := raw["schema"]; raw != nil && !ok {
5709 return fmt.Errorf("field schema in MacTestSchemaV1Json: required")
5710 }
5711 if _, ok := raw["testGroups"]; raw != nil && !ok {
5712 return fmt.Errorf("field testGroups in MacTestSchemaV1Json: required")
5713 }
5714 type Plain MacTestSchemaV1Json
5715 var plain Plain
5716 if err := json.Unmarshal(value, &plain); err != nil {
5717 return err
5718 }
5719 *j = MacTestSchemaV1Json(plain)
5720 return nil
5721 }
5722
5723 type MacTestVector struct {
5724
5725 Comment string `json:"comment"`
5726
5727
5728 Flags []string `json:"flags"`
5729
5730
5731 Key string `json:"key"`
5732
5733
5734 Msg string `json:"msg"`
5735
5736
5737 Result Result `json:"result"`
5738
5739
5740 Tag string `json:"tag"`
5741
5742
5743 TcId int `json:"tcId"`
5744 }
5745
5746
5747 func (j *MacTestVector) UnmarshalJSON(value []byte) error {
5748 var raw map[string]interface{}
5749 if err := json.Unmarshal(value, &raw); err != nil {
5750 return err
5751 }
5752 if _, ok := raw["comment"]; raw != nil && !ok {
5753 return fmt.Errorf("field comment in MacTestVector: required")
5754 }
5755 if _, ok := raw["flags"]; raw != nil && !ok {
5756 return fmt.Errorf("field flags in MacTestVector: required")
5757 }
5758 if _, ok := raw["key"]; raw != nil && !ok {
5759 return fmt.Errorf("field key in MacTestVector: required")
5760 }
5761 if _, ok := raw["msg"]; raw != nil && !ok {
5762 return fmt.Errorf("field msg in MacTestVector: required")
5763 }
5764 if _, ok := raw["result"]; raw != nil && !ok {
5765 return fmt.Errorf("field result in MacTestVector: required")
5766 }
5767 if _, ok := raw["tag"]; raw != nil && !ok {
5768 return fmt.Errorf("field tag in MacTestVector: required")
5769 }
5770 if _, ok := raw["tcId"]; raw != nil && !ok {
5771 return fmt.Errorf("field tcId in MacTestVector: required")
5772 }
5773 type Plain MacTestVector
5774 var plain Plain
5775 if err := json.Unmarshal(value, &plain); err != nil {
5776 return err
5777 }
5778 *j = MacTestVector(plain)
5779 return nil
5780 }
5781
5782 type MacWithIvTestGroup struct {
5783
5784 IvSize int `json:"ivSize"`
5785
5786
5787 KeySize int `json:"keySize"`
5788
5789
5790 Source Source `json:"source"`
5791
5792
5793 TagSize int `json:"tagSize"`
5794
5795
5796 Tests []MacWithIvTestVector `json:"tests"`
5797
5798
5799 Type MacWithIvTestGroupType `json:"type"`
5800 }
5801
5802 type MacWithIvTestGroupType string
5803
5804 const MacWithIvTestGroupTypeMacWithIvTest MacWithIvTestGroupType = "MacWithIvTest"
5805
5806 var enumValues_MacWithIvTestGroupType = []interface{}{
5807 "MacWithIvTest",
5808 }
5809
5810
5811 func (j *MacWithIvTestGroupType) UnmarshalJSON(value []byte) error {
5812 var v string
5813 if err := json.Unmarshal(value, &v); err != nil {
5814 return err
5815 }
5816 var ok bool
5817 for _, expected := range enumValues_MacWithIvTestGroupType {
5818 if reflect.DeepEqual(v, expected) {
5819 ok = true
5820 break
5821 }
5822 }
5823 if !ok {
5824 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacWithIvTestGroupType, v)
5825 }
5826 *j = MacWithIvTestGroupType(v)
5827 return nil
5828 }
5829
5830
5831 func (j *MacWithIvTestGroup) UnmarshalJSON(value []byte) error {
5832 var raw map[string]interface{}
5833 if err := json.Unmarshal(value, &raw); err != nil {
5834 return err
5835 }
5836 if _, ok := raw["ivSize"]; raw != nil && !ok {
5837 return fmt.Errorf("field ivSize in MacWithIvTestGroup: required")
5838 }
5839 if _, ok := raw["keySize"]; raw != nil && !ok {
5840 return fmt.Errorf("field keySize in MacWithIvTestGroup: required")
5841 }
5842 if _, ok := raw["source"]; raw != nil && !ok {
5843 return fmt.Errorf("field source in MacWithIvTestGroup: required")
5844 }
5845 if _, ok := raw["tagSize"]; raw != nil && !ok {
5846 return fmt.Errorf("field tagSize in MacWithIvTestGroup: required")
5847 }
5848 if _, ok := raw["tests"]; raw != nil && !ok {
5849 return fmt.Errorf("field tests in MacWithIvTestGroup: required")
5850 }
5851 if _, ok := raw["type"]; raw != nil && !ok {
5852 return fmt.Errorf("field type in MacWithIvTestGroup: required")
5853 }
5854 type Plain MacWithIvTestGroup
5855 var plain Plain
5856 if err := json.Unmarshal(value, &plain); err != nil {
5857 return err
5858 }
5859 *j = MacWithIvTestGroup(plain)
5860 return nil
5861 }
5862
5863 type MacWithIvTestSchemaV1Json struct {
5864
5865 Algorithm string `json:"algorithm"`
5866
5867
5868 GeneratorVersion *string `json:"generatorVersion,omitempty"`
5869
5870
5871 Header []string `json:"header"`
5872
5873
5874 Notes Notes `json:"notes"`
5875
5876
5877 NumberOfTests int `json:"numberOfTests"`
5878
5879
5880 Schema MacWithIvTestSchemaV1JsonSchema `json:"schema"`
5881
5882
5883 TestGroups []MacWithIvTestGroup `json:"testGroups"`
5884 }
5885
5886 type MacWithIvTestSchemaV1JsonSchema string
5887
5888 const MacWithIvTestSchemaV1JsonSchemaMacWithIvTestSchemaV1Json MacWithIvTestSchemaV1JsonSchema = "mac_with_iv_test_schema_v1.json"
5889
5890 var enumValues_MacWithIvTestSchemaV1JsonSchema = []interface{}{
5891 "mac_with_iv_test_schema_v1.json",
5892 }
5893
5894
5895 func (j *MacWithIvTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
5896 var v string
5897 if err := json.Unmarshal(value, &v); err != nil {
5898 return err
5899 }
5900 var ok bool
5901 for _, expected := range enumValues_MacWithIvTestSchemaV1JsonSchema {
5902 if reflect.DeepEqual(v, expected) {
5903 ok = true
5904 break
5905 }
5906 }
5907 if !ok {
5908 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MacWithIvTestSchemaV1JsonSchema, v)
5909 }
5910 *j = MacWithIvTestSchemaV1JsonSchema(v)
5911 return nil
5912 }
5913
5914
5915 func (j *MacWithIvTestSchemaV1Json) UnmarshalJSON(value []byte) error {
5916 var raw map[string]interface{}
5917 if err := json.Unmarshal(value, &raw); err != nil {
5918 return err
5919 }
5920 if _, ok := raw["algorithm"]; raw != nil && !ok {
5921 return fmt.Errorf("field algorithm in MacWithIvTestSchemaV1Json: required")
5922 }
5923 if _, ok := raw["header"]; raw != nil && !ok {
5924 return fmt.Errorf("field header in MacWithIvTestSchemaV1Json: required")
5925 }
5926 if _, ok := raw["notes"]; raw != nil && !ok {
5927 return fmt.Errorf("field notes in MacWithIvTestSchemaV1Json: required")
5928 }
5929 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
5930 return fmt.Errorf("field numberOfTests in MacWithIvTestSchemaV1Json: required")
5931 }
5932 if _, ok := raw["schema"]; raw != nil && !ok {
5933 return fmt.Errorf("field schema in MacWithIvTestSchemaV1Json: required")
5934 }
5935 if _, ok := raw["testGroups"]; raw != nil && !ok {
5936 return fmt.Errorf("field testGroups in MacWithIvTestSchemaV1Json: required")
5937 }
5938 type Plain MacWithIvTestSchemaV1Json
5939 var plain Plain
5940 if err := json.Unmarshal(value, &plain); err != nil {
5941 return err
5942 }
5943 *j = MacWithIvTestSchemaV1Json(plain)
5944 return nil
5945 }
5946
5947 type MacWithIvTestVector struct {
5948
5949 Comment string `json:"comment"`
5950
5951
5952 Flags []string `json:"flags"`
5953
5954
5955 Iv string `json:"iv"`
5956
5957
5958 Key string `json:"key"`
5959
5960
5961 Msg string `json:"msg"`
5962
5963
5964 Result Result `json:"result"`
5965
5966
5967 Tag string `json:"tag"`
5968
5969
5970 TcId int `json:"tcId"`
5971 }
5972
5973
5974 func (j *MacWithIvTestVector) UnmarshalJSON(value []byte) error {
5975 var raw map[string]interface{}
5976 if err := json.Unmarshal(value, &raw); err != nil {
5977 return err
5978 }
5979 if _, ok := raw["comment"]; raw != nil && !ok {
5980 return fmt.Errorf("field comment in MacWithIvTestVector: required")
5981 }
5982 if _, ok := raw["flags"]; raw != nil && !ok {
5983 return fmt.Errorf("field flags in MacWithIvTestVector: required")
5984 }
5985 if _, ok := raw["iv"]; raw != nil && !ok {
5986 return fmt.Errorf("field iv in MacWithIvTestVector: required")
5987 }
5988 if _, ok := raw["key"]; raw != nil && !ok {
5989 return fmt.Errorf("field key in MacWithIvTestVector: required")
5990 }
5991 if _, ok := raw["msg"]; raw != nil && !ok {
5992 return fmt.Errorf("field msg in MacWithIvTestVector: required")
5993 }
5994 if _, ok := raw["result"]; raw != nil && !ok {
5995 return fmt.Errorf("field result in MacWithIvTestVector: required")
5996 }
5997 if _, ok := raw["tag"]; raw != nil && !ok {
5998 return fmt.Errorf("field tag in MacWithIvTestVector: required")
5999 }
6000 if _, ok := raw["tcId"]; raw != nil && !ok {
6001 return fmt.Errorf("field tcId in MacWithIvTestVector: required")
6002 }
6003 type Plain MacWithIvTestVector
6004 var plain Plain
6005 if err := json.Unmarshal(value, &plain); err != nil {
6006 return err
6007 }
6008 *j = MacWithIvTestVector(plain)
6009 return nil
6010 }
6011
6012 type MlDsaSignNoSeedTestGroup struct {
6013
6014 PrivateKey string `json:"privateKey"`
6015
6016
6017
6018 PublicKey interface{} `json:"publicKey"`
6019
6020
6021 Source Source `json:"source"`
6022
6023
6024 Tests []MlDsaSignTestVector `json:"tests"`
6025
6026
6027 Type MlDsaSignNoSeedTestGroupType `json:"type"`
6028 }
6029
6030 type MlDsaSignNoSeedTestGroupType string
6031
6032 const MlDsaSignNoSeedTestGroupTypeMlDsaSign MlDsaSignNoSeedTestGroupType = "MlDsaSign"
6033
6034 var enumValues_MlDsaSignNoSeedTestGroupType = []interface{}{
6035 "MlDsaSign",
6036 }
6037
6038
6039 func (j *MlDsaSignNoSeedTestGroupType) UnmarshalJSON(value []byte) error {
6040 var v string
6041 if err := json.Unmarshal(value, &v); err != nil {
6042 return err
6043 }
6044 var ok bool
6045 for _, expected := range enumValues_MlDsaSignNoSeedTestGroupType {
6046 if reflect.DeepEqual(v, expected) {
6047 ok = true
6048 break
6049 }
6050 }
6051 if !ok {
6052 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlDsaSignNoSeedTestGroupType, v)
6053 }
6054 *j = MlDsaSignNoSeedTestGroupType(v)
6055 return nil
6056 }
6057
6058
6059 func (j *MlDsaSignNoSeedTestGroup) UnmarshalJSON(value []byte) error {
6060 var raw map[string]interface{}
6061 if err := json.Unmarshal(value, &raw); err != nil {
6062 return err
6063 }
6064 if _, ok := raw["privateKey"]; raw != nil && !ok {
6065 return fmt.Errorf("field privateKey in MlDsaSignNoSeedTestGroup: required")
6066 }
6067 if _, ok := raw["publicKey"]; raw != nil && !ok {
6068 return fmt.Errorf("field publicKey in MlDsaSignNoSeedTestGroup: required")
6069 }
6070 if _, ok := raw["source"]; raw != nil && !ok {
6071 return fmt.Errorf("field source in MlDsaSignNoSeedTestGroup: required")
6072 }
6073 if _, ok := raw["tests"]; raw != nil && !ok {
6074 return fmt.Errorf("field tests in MlDsaSignNoSeedTestGroup: required")
6075 }
6076 if _, ok := raw["type"]; raw != nil && !ok {
6077 return fmt.Errorf("field type in MlDsaSignNoSeedTestGroup: required")
6078 }
6079 type Plain MlDsaSignNoSeedTestGroup
6080 var plain Plain
6081 if err := json.Unmarshal(value, &plain); err != nil {
6082 return err
6083 }
6084 *j = MlDsaSignNoSeedTestGroup(plain)
6085 return nil
6086 }
6087
6088 type MlDsaSignTestGroup struct {
6089
6090 PrivateKeyPkcs8 *string `json:"privateKeyPkcs8,omitempty"`
6091
6092
6093 PrivateSeed string `json:"privateSeed"`
6094
6095
6096
6097 PublicKey interface{} `json:"publicKey"`
6098
6099
6100 Source Source `json:"source"`
6101
6102
6103 Tests []MlDsaSignTestVector `json:"tests"`
6104
6105
6106 Type MlDsaSignTestGroupType `json:"type"`
6107 }
6108
6109 type MlDsaSignTestGroupType string
6110
6111 const MlDsaSignTestGroupTypeMlDsaSign MlDsaSignTestGroupType = "MlDsaSign"
6112
6113 var enumValues_MlDsaSignTestGroupType = []interface{}{
6114 "MlDsaSign",
6115 }
6116
6117
6118 func (j *MlDsaSignTestGroupType) UnmarshalJSON(value []byte) error {
6119 var v string
6120 if err := json.Unmarshal(value, &v); err != nil {
6121 return err
6122 }
6123 var ok bool
6124 for _, expected := range enumValues_MlDsaSignTestGroupType {
6125 if reflect.DeepEqual(v, expected) {
6126 ok = true
6127 break
6128 }
6129 }
6130 if !ok {
6131 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlDsaSignTestGroupType, v)
6132 }
6133 *j = MlDsaSignTestGroupType(v)
6134 return nil
6135 }
6136
6137
6138 func (j *MlDsaSignTestGroup) UnmarshalJSON(value []byte) error {
6139 var raw map[string]interface{}
6140 if err := json.Unmarshal(value, &raw); err != nil {
6141 return err
6142 }
6143 if _, ok := raw["privateSeed"]; raw != nil && !ok {
6144 return fmt.Errorf("field privateSeed in MlDsaSignTestGroup: required")
6145 }
6146 if _, ok := raw["publicKey"]; raw != nil && !ok {
6147 return fmt.Errorf("field publicKey in MlDsaSignTestGroup: required")
6148 }
6149 if _, ok := raw["source"]; raw != nil && !ok {
6150 return fmt.Errorf("field source in MlDsaSignTestGroup: required")
6151 }
6152 if _, ok := raw["tests"]; raw != nil && !ok {
6153 return fmt.Errorf("field tests in MlDsaSignTestGroup: required")
6154 }
6155 if _, ok := raw["type"]; raw != nil && !ok {
6156 return fmt.Errorf("field type in MlDsaSignTestGroup: required")
6157 }
6158 type Plain MlDsaSignTestGroup
6159 var plain Plain
6160 if err := json.Unmarshal(value, &plain); err != nil {
6161 return err
6162 }
6163 *j = MlDsaSignTestGroup(plain)
6164 return nil
6165 }
6166
6167 type MlDsaSignTestVector interface{}
6168
6169 type MlDsaVerifyTestGroup struct {
6170
6171 PublicKey string `json:"publicKey"`
6172
6173
6174 PublicKeyDer string `json:"publicKeyDer"`
6175
6176
6177 Source *Source `json:"source,omitempty"`
6178
6179
6180 Tests []MlDsaVerifyTestVector `json:"tests"`
6181
6182
6183 Type MlDsaVerifyTestGroupType `json:"type"`
6184 }
6185
6186 type MlDsaVerifyTestGroupType string
6187
6188 const MlDsaVerifyTestGroupTypeMlDsaVerify MlDsaVerifyTestGroupType = "MlDsaVerify"
6189
6190 var enumValues_MlDsaVerifyTestGroupType = []interface{}{
6191 "MlDsaVerify",
6192 }
6193
6194
6195 func (j *MlDsaVerifyTestGroupType) UnmarshalJSON(value []byte) error {
6196 var v string
6197 if err := json.Unmarshal(value, &v); err != nil {
6198 return err
6199 }
6200 var ok bool
6201 for _, expected := range enumValues_MlDsaVerifyTestGroupType {
6202 if reflect.DeepEqual(v, expected) {
6203 ok = true
6204 break
6205 }
6206 }
6207 if !ok {
6208 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlDsaVerifyTestGroupType, v)
6209 }
6210 *j = MlDsaVerifyTestGroupType(v)
6211 return nil
6212 }
6213
6214
6215 func (j *MlDsaVerifyTestGroup) UnmarshalJSON(value []byte) error {
6216 var raw map[string]interface{}
6217 if err := json.Unmarshal(value, &raw); err != nil {
6218 return err
6219 }
6220 if _, ok := raw["publicKey"]; raw != nil && !ok {
6221 return fmt.Errorf("field publicKey in MlDsaVerifyTestGroup: required")
6222 }
6223 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
6224 return fmt.Errorf("field publicKeyDer in MlDsaVerifyTestGroup: required")
6225 }
6226 if _, ok := raw["tests"]; raw != nil && !ok {
6227 return fmt.Errorf("field tests in MlDsaVerifyTestGroup: required")
6228 }
6229 if _, ok := raw["type"]; raw != nil && !ok {
6230 return fmt.Errorf("field type in MlDsaVerifyTestGroup: required")
6231 }
6232 type Plain MlDsaVerifyTestGroup
6233 var plain Plain
6234 if err := json.Unmarshal(value, &plain); err != nil {
6235 return err
6236 }
6237 *j = MlDsaVerifyTestGroup(plain)
6238 return nil
6239 }
6240
6241 type MlDsaVerifyTestVector struct {
6242
6243 Comment string `json:"comment"`
6244
6245
6246 Ctx *string `json:"ctx,omitempty"`
6247
6248
6249 Flags []string `json:"flags"`
6250
6251
6252 Msg string `json:"msg"`
6253
6254
6255 Result Result `json:"result"`
6256
6257
6258 Sig string `json:"sig"`
6259
6260
6261 TcId int `json:"tcId"`
6262 }
6263
6264
6265 func (j *MlDsaVerifyTestVector) UnmarshalJSON(value []byte) error {
6266 var raw map[string]interface{}
6267 if err := json.Unmarshal(value, &raw); err != nil {
6268 return err
6269 }
6270 if _, ok := raw["comment"]; raw != nil && !ok {
6271 return fmt.Errorf("field comment in MlDsaVerifyTestVector: required")
6272 }
6273 if _, ok := raw["flags"]; raw != nil && !ok {
6274 return fmt.Errorf("field flags in MlDsaVerifyTestVector: required")
6275 }
6276 if _, ok := raw["msg"]; raw != nil && !ok {
6277 return fmt.Errorf("field msg in MlDsaVerifyTestVector: required")
6278 }
6279 if _, ok := raw["result"]; raw != nil && !ok {
6280 return fmt.Errorf("field result in MlDsaVerifyTestVector: required")
6281 }
6282 if _, ok := raw["sig"]; raw != nil && !ok {
6283 return fmt.Errorf("field sig in MlDsaVerifyTestVector: required")
6284 }
6285 if _, ok := raw["tcId"]; raw != nil && !ok {
6286 return fmt.Errorf("field tcId in MlDsaVerifyTestVector: required")
6287 }
6288 type Plain MlDsaVerifyTestVector
6289 var plain Plain
6290 if err := json.Unmarshal(value, &plain); err != nil {
6291 return err
6292 }
6293 *j = MlDsaVerifyTestVector(plain)
6294 return nil
6295 }
6296
6297 type MldsaSignNoseedSchemaJson struct {
6298
6299 Algorithm string `json:"algorithm"`
6300
6301
6302 Header []string `json:"header"`
6303
6304
6305 Notes Notes `json:"notes"`
6306
6307
6308 NumberOfTests int `json:"numberOfTests"`
6309
6310
6311 Schema MldsaSignNoseedSchemaJsonSchema `json:"schema"`
6312
6313
6314 TestGroups []MlDsaSignNoSeedTestGroup `json:"testGroups"`
6315 }
6316
6317 type MldsaSignNoseedSchemaJsonSchema string
6318
6319 const MldsaSignNoseedSchemaJsonSchemaMldsaSignNoseedSchemaJson MldsaSignNoseedSchemaJsonSchema = "mldsa_sign_noseed_schema.json"
6320
6321 var enumValues_MldsaSignNoseedSchemaJsonSchema = []interface{}{
6322 "mldsa_sign_noseed_schema.json",
6323 }
6324
6325
6326 func (j *MldsaSignNoseedSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6327 var v string
6328 if err := json.Unmarshal(value, &v); err != nil {
6329 return err
6330 }
6331 var ok bool
6332 for _, expected := range enumValues_MldsaSignNoseedSchemaJsonSchema {
6333 if reflect.DeepEqual(v, expected) {
6334 ok = true
6335 break
6336 }
6337 }
6338 if !ok {
6339 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MldsaSignNoseedSchemaJsonSchema, v)
6340 }
6341 *j = MldsaSignNoseedSchemaJsonSchema(v)
6342 return nil
6343 }
6344
6345
6346 func (j *MldsaSignNoseedSchemaJson) UnmarshalJSON(value []byte) error {
6347 var raw map[string]interface{}
6348 if err := json.Unmarshal(value, &raw); err != nil {
6349 return err
6350 }
6351 if _, ok := raw["algorithm"]; raw != nil && !ok {
6352 return fmt.Errorf("field algorithm in MldsaSignNoseedSchemaJson: required")
6353 }
6354 if _, ok := raw["header"]; raw != nil && !ok {
6355 return fmt.Errorf("field header in MldsaSignNoseedSchemaJson: required")
6356 }
6357 if _, ok := raw["notes"]; raw != nil && !ok {
6358 return fmt.Errorf("field notes in MldsaSignNoseedSchemaJson: required")
6359 }
6360 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6361 return fmt.Errorf("field numberOfTests in MldsaSignNoseedSchemaJson: required")
6362 }
6363 if _, ok := raw["schema"]; raw != nil && !ok {
6364 return fmt.Errorf("field schema in MldsaSignNoseedSchemaJson: required")
6365 }
6366 if _, ok := raw["testGroups"]; raw != nil && !ok {
6367 return fmt.Errorf("field testGroups in MldsaSignNoseedSchemaJson: required")
6368 }
6369 type Plain MldsaSignNoseedSchemaJson
6370 var plain Plain
6371 if err := json.Unmarshal(value, &plain); err != nil {
6372 return err
6373 }
6374 *j = MldsaSignNoseedSchemaJson(plain)
6375 return nil
6376 }
6377
6378 type MldsaSignSeedSchemaJson struct {
6379
6380 Algorithm string `json:"algorithm"`
6381
6382
6383 Header []string `json:"header"`
6384
6385
6386 Notes Notes `json:"notes"`
6387
6388
6389 NumberOfTests int `json:"numberOfTests"`
6390
6391
6392 Schema MldsaSignSeedSchemaJsonSchema `json:"schema"`
6393
6394
6395 TestGroups []MlDsaSignTestGroup `json:"testGroups"`
6396 }
6397
6398 type MldsaSignSeedSchemaJsonSchema string
6399
6400 const MldsaSignSeedSchemaJsonSchemaMldsaSignSeedSchemaJson MldsaSignSeedSchemaJsonSchema = "mldsa_sign_seed_schema.json"
6401
6402 var enumValues_MldsaSignSeedSchemaJsonSchema = []interface{}{
6403 "mldsa_sign_seed_schema.json",
6404 }
6405
6406
6407 func (j *MldsaSignSeedSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6408 var v string
6409 if err := json.Unmarshal(value, &v); err != nil {
6410 return err
6411 }
6412 var ok bool
6413 for _, expected := range enumValues_MldsaSignSeedSchemaJsonSchema {
6414 if reflect.DeepEqual(v, expected) {
6415 ok = true
6416 break
6417 }
6418 }
6419 if !ok {
6420 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MldsaSignSeedSchemaJsonSchema, v)
6421 }
6422 *j = MldsaSignSeedSchemaJsonSchema(v)
6423 return nil
6424 }
6425
6426
6427 func (j *MldsaSignSeedSchemaJson) UnmarshalJSON(value []byte) error {
6428 var raw map[string]interface{}
6429 if err := json.Unmarshal(value, &raw); err != nil {
6430 return err
6431 }
6432 if _, ok := raw["algorithm"]; raw != nil && !ok {
6433 return fmt.Errorf("field algorithm in MldsaSignSeedSchemaJson: required")
6434 }
6435 if _, ok := raw["header"]; raw != nil && !ok {
6436 return fmt.Errorf("field header in MldsaSignSeedSchemaJson: required")
6437 }
6438 if _, ok := raw["notes"]; raw != nil && !ok {
6439 return fmt.Errorf("field notes in MldsaSignSeedSchemaJson: required")
6440 }
6441 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6442 return fmt.Errorf("field numberOfTests in MldsaSignSeedSchemaJson: required")
6443 }
6444 if _, ok := raw["schema"]; raw != nil && !ok {
6445 return fmt.Errorf("field schema in MldsaSignSeedSchemaJson: required")
6446 }
6447 if _, ok := raw["testGroups"]; raw != nil && !ok {
6448 return fmt.Errorf("field testGroups in MldsaSignSeedSchemaJson: required")
6449 }
6450 type Plain MldsaSignSeedSchemaJson
6451 var plain Plain
6452 if err := json.Unmarshal(value, &plain); err != nil {
6453 return err
6454 }
6455 *j = MldsaSignSeedSchemaJson(plain)
6456 return nil
6457 }
6458
6459 type MldsaVerifySchemaJson struct {
6460
6461 Algorithm string `json:"algorithm"`
6462
6463
6464 GeneratorVersion *string `json:"generatorVersion,omitempty"`
6465
6466
6467 Header []string `json:"header"`
6468
6469
6470 Notes Notes `json:"notes"`
6471
6472
6473 NumberOfTests int `json:"numberOfTests"`
6474
6475
6476 Schema MldsaVerifySchemaJsonSchema `json:"schema"`
6477
6478
6479 TestGroups []MlDsaVerifyTestGroup `json:"testGroups"`
6480 }
6481
6482 type MldsaVerifySchemaJsonSchema string
6483
6484 const MldsaVerifySchemaJsonSchemaMldsaVerifySchemaJson MldsaVerifySchemaJsonSchema = "mldsa_verify_schema.json"
6485
6486 var enumValues_MldsaVerifySchemaJsonSchema = []interface{}{
6487 "mldsa_verify_schema.json",
6488 }
6489
6490
6491 func (j *MldsaVerifySchemaJsonSchema) UnmarshalJSON(value []byte) error {
6492 var v string
6493 if err := json.Unmarshal(value, &v); err != nil {
6494 return err
6495 }
6496 var ok bool
6497 for _, expected := range enumValues_MldsaVerifySchemaJsonSchema {
6498 if reflect.DeepEqual(v, expected) {
6499 ok = true
6500 break
6501 }
6502 }
6503 if !ok {
6504 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MldsaVerifySchemaJsonSchema, v)
6505 }
6506 *j = MldsaVerifySchemaJsonSchema(v)
6507 return nil
6508 }
6509
6510
6511 func (j *MldsaVerifySchemaJson) UnmarshalJSON(value []byte) error {
6512 var raw map[string]interface{}
6513 if err := json.Unmarshal(value, &raw); err != nil {
6514 return err
6515 }
6516 if _, ok := raw["algorithm"]; raw != nil && !ok {
6517 return fmt.Errorf("field algorithm in MldsaVerifySchemaJson: required")
6518 }
6519 if _, ok := raw["header"]; raw != nil && !ok {
6520 return fmt.Errorf("field header in MldsaVerifySchemaJson: required")
6521 }
6522 if _, ok := raw["notes"]; raw != nil && !ok {
6523 return fmt.Errorf("field notes in MldsaVerifySchemaJson: required")
6524 }
6525 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6526 return fmt.Errorf("field numberOfTests in MldsaVerifySchemaJson: required")
6527 }
6528 if _, ok := raw["schema"]; raw != nil && !ok {
6529 return fmt.Errorf("field schema in MldsaVerifySchemaJson: required")
6530 }
6531 if _, ok := raw["testGroups"]; raw != nil && !ok {
6532 return fmt.Errorf("field testGroups in MldsaVerifySchemaJson: required")
6533 }
6534 type Plain MldsaVerifySchemaJson
6535 var plain Plain
6536 if err := json.Unmarshal(value, &plain); err != nil {
6537 return err
6538 }
6539 *j = MldsaVerifySchemaJson(plain)
6540 return nil
6541 }
6542
6543 type MlkemEncapsTestSchemaJson struct {
6544
6545 Algorithm MlkemEncapsTestSchemaJsonAlgorithm `json:"algorithm"`
6546
6547
6548 Header []string `json:"header,omitempty"`
6549
6550
6551 Notes Notes `json:"notes,omitempty"`
6552
6553
6554 NumberOfTests int `json:"numberOfTests"`
6555
6556
6557 Schema MlkemEncapsTestSchemaJsonSchema `json:"schema"`
6558
6559
6560 TestGroups []MLKEMEncapsTestGroup `json:"testGroups"`
6561 }
6562
6563 type MlkemEncapsTestSchemaJsonAlgorithm string
6564
6565 const MlkemEncapsTestSchemaJsonAlgorithmMLKEM MlkemEncapsTestSchemaJsonAlgorithm = "ML-KEM"
6566
6567 var enumValues_MlkemEncapsTestSchemaJsonAlgorithm = []interface{}{
6568 "ML-KEM",
6569 }
6570
6571
6572 func (j *MlkemEncapsTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6573 var v string
6574 if err := json.Unmarshal(value, &v); err != nil {
6575 return err
6576 }
6577 var ok bool
6578 for _, expected := range enumValues_MlkemEncapsTestSchemaJsonAlgorithm {
6579 if reflect.DeepEqual(v, expected) {
6580 ok = true
6581 break
6582 }
6583 }
6584 if !ok {
6585 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemEncapsTestSchemaJsonAlgorithm, v)
6586 }
6587 *j = MlkemEncapsTestSchemaJsonAlgorithm(v)
6588 return nil
6589 }
6590
6591 type MlkemEncapsTestSchemaJsonSchema string
6592
6593 const MlkemEncapsTestSchemaJsonSchemaMlkemEncapsTestSchemaJson MlkemEncapsTestSchemaJsonSchema = "mlkem_encaps_test_schema.json"
6594
6595 var enumValues_MlkemEncapsTestSchemaJsonSchema = []interface{}{
6596 "mlkem_encaps_test_schema.json",
6597 }
6598
6599
6600 func (j *MlkemEncapsTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6601 var v string
6602 if err := json.Unmarshal(value, &v); err != nil {
6603 return err
6604 }
6605 var ok bool
6606 for _, expected := range enumValues_MlkemEncapsTestSchemaJsonSchema {
6607 if reflect.DeepEqual(v, expected) {
6608 ok = true
6609 break
6610 }
6611 }
6612 if !ok {
6613 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemEncapsTestSchemaJsonSchema, v)
6614 }
6615 *j = MlkemEncapsTestSchemaJsonSchema(v)
6616 return nil
6617 }
6618
6619
6620 func (j *MlkemEncapsTestSchemaJson) UnmarshalJSON(value []byte) error {
6621 var raw map[string]interface{}
6622 if err := json.Unmarshal(value, &raw); err != nil {
6623 return err
6624 }
6625 if _, ok := raw["algorithm"]; raw != nil && !ok {
6626 return fmt.Errorf("field algorithm in MlkemEncapsTestSchemaJson: required")
6627 }
6628 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6629 return fmt.Errorf("field numberOfTests in MlkemEncapsTestSchemaJson: required")
6630 }
6631 if _, ok := raw["schema"]; raw != nil && !ok {
6632 return fmt.Errorf("field schema in MlkemEncapsTestSchemaJson: required")
6633 }
6634 if _, ok := raw["testGroups"]; raw != nil && !ok {
6635 return fmt.Errorf("field testGroups in MlkemEncapsTestSchemaJson: required")
6636 }
6637 type Plain MlkemEncapsTestSchemaJson
6638 var plain Plain
6639 if err := json.Unmarshal(value, &plain); err != nil {
6640 return err
6641 }
6642 *j = MlkemEncapsTestSchemaJson(plain)
6643 return nil
6644 }
6645
6646 type MlkemKeygenSeedTestSchemaJson struct {
6647
6648 Algorithm MlkemKeygenSeedTestSchemaJsonAlgorithm `json:"algorithm"`
6649
6650
6651 Header []string `json:"header,omitempty"`
6652
6653
6654 Notes Notes `json:"notes,omitempty"`
6655
6656
6657 NumberOfTests int `json:"numberOfTests"`
6658
6659
6660 Schema MlkemKeygenSeedTestSchemaJsonSchema `json:"schema"`
6661
6662
6663 TestGroups []MLKEMKeyGenTestGroup `json:"testGroups"`
6664 }
6665
6666 type MlkemKeygenSeedTestSchemaJsonAlgorithm string
6667
6668 const MlkemKeygenSeedTestSchemaJsonAlgorithmMLKEM MlkemKeygenSeedTestSchemaJsonAlgorithm = "ML-KEM"
6669
6670 var enumValues_MlkemKeygenSeedTestSchemaJsonAlgorithm = []interface{}{
6671 "ML-KEM",
6672 }
6673
6674
6675 func (j *MlkemKeygenSeedTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6676 var v string
6677 if err := json.Unmarshal(value, &v); err != nil {
6678 return err
6679 }
6680 var ok bool
6681 for _, expected := range enumValues_MlkemKeygenSeedTestSchemaJsonAlgorithm {
6682 if reflect.DeepEqual(v, expected) {
6683 ok = true
6684 break
6685 }
6686 }
6687 if !ok {
6688 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemKeygenSeedTestSchemaJsonAlgorithm, v)
6689 }
6690 *j = MlkemKeygenSeedTestSchemaJsonAlgorithm(v)
6691 return nil
6692 }
6693
6694 type MlkemKeygenSeedTestSchemaJsonSchema string
6695
6696 const MlkemKeygenSeedTestSchemaJsonSchemaMlkemKeygenSeedTestSchemaJson MlkemKeygenSeedTestSchemaJsonSchema = "mlkem_keygen_seed_test_schema.json"
6697
6698 var enumValues_MlkemKeygenSeedTestSchemaJsonSchema = []interface{}{
6699 "mlkem_keygen_seed_test_schema.json",
6700 }
6701
6702
6703 func (j *MlkemKeygenSeedTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6704 var v string
6705 if err := json.Unmarshal(value, &v); err != nil {
6706 return err
6707 }
6708 var ok bool
6709 for _, expected := range enumValues_MlkemKeygenSeedTestSchemaJsonSchema {
6710 if reflect.DeepEqual(v, expected) {
6711 ok = true
6712 break
6713 }
6714 }
6715 if !ok {
6716 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemKeygenSeedTestSchemaJsonSchema, v)
6717 }
6718 *j = MlkemKeygenSeedTestSchemaJsonSchema(v)
6719 return nil
6720 }
6721
6722
6723 func (j *MlkemKeygenSeedTestSchemaJson) UnmarshalJSON(value []byte) error {
6724 var raw map[string]interface{}
6725 if err := json.Unmarshal(value, &raw); err != nil {
6726 return err
6727 }
6728 if _, ok := raw["algorithm"]; raw != nil && !ok {
6729 return fmt.Errorf("field algorithm in MlkemKeygenSeedTestSchemaJson: required")
6730 }
6731 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6732 return fmt.Errorf("field numberOfTests in MlkemKeygenSeedTestSchemaJson: required")
6733 }
6734 if _, ok := raw["schema"]; raw != nil && !ok {
6735 return fmt.Errorf("field schema in MlkemKeygenSeedTestSchemaJson: required")
6736 }
6737 if _, ok := raw["testGroups"]; raw != nil && !ok {
6738 return fmt.Errorf("field testGroups in MlkemKeygenSeedTestSchemaJson: required")
6739 }
6740 type Plain MlkemKeygenSeedTestSchemaJson
6741 var plain Plain
6742 if err := json.Unmarshal(value, &plain); err != nil {
6743 return err
6744 }
6745 *j = MlkemKeygenSeedTestSchemaJson(plain)
6746 return nil
6747 }
6748
6749 type MlkemSemiExpandedDecapsTestSchemaJson struct {
6750
6751 Algorithm MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm `json:"algorithm"`
6752
6753
6754 Header []string `json:"header,omitempty"`
6755
6756
6757 Notes Notes `json:"notes,omitempty"`
6758
6759
6760 NumberOfTests int `json:"numberOfTests"`
6761
6762
6763 Schema MlkemSemiExpandedDecapsTestSchemaJsonSchema `json:"schema"`
6764
6765
6766 TestGroups []MLKEMDecapsTestGroup `json:"testGroups"`
6767 }
6768
6769 type MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm string
6770
6771 const MlkemSemiExpandedDecapsTestSchemaJsonAlgorithmMLKEM MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm = "ML-KEM"
6772
6773 var enumValues_MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm = []interface{}{
6774 "ML-KEM",
6775 }
6776
6777
6778 func (j *MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6779 var v string
6780 if err := json.Unmarshal(value, &v); err != nil {
6781 return err
6782 }
6783 var ok bool
6784 for _, expected := range enumValues_MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm {
6785 if reflect.DeepEqual(v, expected) {
6786 ok = true
6787 break
6788 }
6789 }
6790 if !ok {
6791 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm, v)
6792 }
6793 *j = MlkemSemiExpandedDecapsTestSchemaJsonAlgorithm(v)
6794 return nil
6795 }
6796
6797 type MlkemSemiExpandedDecapsTestSchemaJsonSchema string
6798
6799 const MlkemSemiExpandedDecapsTestSchemaJsonSchemaMlkemSemiExpandedDecapsTestSchemaJson MlkemSemiExpandedDecapsTestSchemaJsonSchema = "mlkem_semi_expanded_decaps_test_schema.json"
6800
6801 var enumValues_MlkemSemiExpandedDecapsTestSchemaJsonSchema = []interface{}{
6802 "mlkem_semi_expanded_decaps_test_schema.json",
6803 }
6804
6805
6806 func (j *MlkemSemiExpandedDecapsTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6807 var v string
6808 if err := json.Unmarshal(value, &v); err != nil {
6809 return err
6810 }
6811 var ok bool
6812 for _, expected := range enumValues_MlkemSemiExpandedDecapsTestSchemaJsonSchema {
6813 if reflect.DeepEqual(v, expected) {
6814 ok = true
6815 break
6816 }
6817 }
6818 if !ok {
6819 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemSemiExpandedDecapsTestSchemaJsonSchema, v)
6820 }
6821 *j = MlkemSemiExpandedDecapsTestSchemaJsonSchema(v)
6822 return nil
6823 }
6824
6825
6826 func (j *MlkemSemiExpandedDecapsTestSchemaJson) UnmarshalJSON(value []byte) error {
6827 var raw map[string]interface{}
6828 if err := json.Unmarshal(value, &raw); err != nil {
6829 return err
6830 }
6831 if _, ok := raw["algorithm"]; raw != nil && !ok {
6832 return fmt.Errorf("field algorithm in MlkemSemiExpandedDecapsTestSchemaJson: required")
6833 }
6834 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6835 return fmt.Errorf("field numberOfTests in MlkemSemiExpandedDecapsTestSchemaJson: required")
6836 }
6837 if _, ok := raw["schema"]; raw != nil && !ok {
6838 return fmt.Errorf("field schema in MlkemSemiExpandedDecapsTestSchemaJson: required")
6839 }
6840 if _, ok := raw["testGroups"]; raw != nil && !ok {
6841 return fmt.Errorf("field testGroups in MlkemSemiExpandedDecapsTestSchemaJson: required")
6842 }
6843 type Plain MlkemSemiExpandedDecapsTestSchemaJson
6844 var plain Plain
6845 if err := json.Unmarshal(value, &plain); err != nil {
6846 return err
6847 }
6848 *j = MlkemSemiExpandedDecapsTestSchemaJson(plain)
6849 return nil
6850 }
6851
6852 type MlkemTestSchemaJson struct {
6853
6854 Algorithm MlkemTestSchemaJsonAlgorithm `json:"algorithm"`
6855
6856
6857 Header []string `json:"header,omitempty"`
6858
6859
6860 Notes Notes `json:"notes,omitempty"`
6861
6862
6863 NumberOfTests int `json:"numberOfTests"`
6864
6865
6866 Schema MlkemTestSchemaJsonSchema `json:"schema"`
6867
6868
6869 TestGroups []MLKEMTestGroup `json:"testGroups"`
6870 }
6871
6872 type MlkemTestSchemaJsonAlgorithm string
6873
6874 const MlkemTestSchemaJsonAlgorithmMLKEM MlkemTestSchemaJsonAlgorithm = "ML-KEM"
6875
6876 var enumValues_MlkemTestSchemaJsonAlgorithm = []interface{}{
6877 "ML-KEM",
6878 }
6879
6880
6881 func (j *MlkemTestSchemaJsonAlgorithm) UnmarshalJSON(value []byte) error {
6882 var v string
6883 if err := json.Unmarshal(value, &v); err != nil {
6884 return err
6885 }
6886 var ok bool
6887 for _, expected := range enumValues_MlkemTestSchemaJsonAlgorithm {
6888 if reflect.DeepEqual(v, expected) {
6889 ok = true
6890 break
6891 }
6892 }
6893 if !ok {
6894 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemTestSchemaJsonAlgorithm, v)
6895 }
6896 *j = MlkemTestSchemaJsonAlgorithm(v)
6897 return nil
6898 }
6899
6900 type MlkemTestSchemaJsonSchema string
6901
6902 const MlkemTestSchemaJsonSchemaMlkemTestSchemaJson MlkemTestSchemaJsonSchema = "mlkem_test_schema.json"
6903
6904 var enumValues_MlkemTestSchemaJsonSchema = []interface{}{
6905 "mlkem_test_schema.json",
6906 }
6907
6908
6909 func (j *MlkemTestSchemaJsonSchema) UnmarshalJSON(value []byte) error {
6910 var v string
6911 if err := json.Unmarshal(value, &v); err != nil {
6912 return err
6913 }
6914 var ok bool
6915 for _, expected := range enumValues_MlkemTestSchemaJsonSchema {
6916 if reflect.DeepEqual(v, expected) {
6917 ok = true
6918 break
6919 }
6920 }
6921 if !ok {
6922 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_MlkemTestSchemaJsonSchema, v)
6923 }
6924 *j = MlkemTestSchemaJsonSchema(v)
6925 return nil
6926 }
6927
6928
6929 func (j *MlkemTestSchemaJson) UnmarshalJSON(value []byte) error {
6930 var raw map[string]interface{}
6931 if err := json.Unmarshal(value, &raw); err != nil {
6932 return err
6933 }
6934 if _, ok := raw["algorithm"]; raw != nil && !ok {
6935 return fmt.Errorf("field algorithm in MlkemTestSchemaJson: required")
6936 }
6937 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
6938 return fmt.Errorf("field numberOfTests in MlkemTestSchemaJson: required")
6939 }
6940 if _, ok := raw["schema"]; raw != nil && !ok {
6941 return fmt.Errorf("field schema in MlkemTestSchemaJson: required")
6942 }
6943 if _, ok := raw["testGroups"]; raw != nil && !ok {
6944 return fmt.Errorf("field testGroups in MlkemTestSchemaJson: required")
6945 }
6946 type Plain MlkemTestSchemaJson
6947 var plain Plain
6948 if err := json.Unmarshal(value, &plain); err != nil {
6949 return err
6950 }
6951 *j = MlkemTestSchemaJson(plain)
6952 return nil
6953 }
6954
6955 type NoteEntry struct {
6956
6957 BugType string `json:"bugType"`
6958
6959
6960 Cves []string `json:"cves,omitempty"`
6961
6962
6963 Description *string `json:"description,omitempty"`
6964
6965
6966 Effect *string `json:"effect,omitempty"`
6967
6968
6969 Links []string `json:"links,omitempty"`
6970 }
6971
6972
6973 func (j *NoteEntry) UnmarshalJSON(value []byte) error {
6974 var raw map[string]interface{}
6975 if err := json.Unmarshal(value, &raw); err != nil {
6976 return err
6977 }
6978 if _, ok := raw["bugType"]; raw != nil && !ok {
6979 return fmt.Errorf("field bugType in NoteEntry: required")
6980 }
6981 type Plain NoteEntry
6982 var plain Plain
6983 if err := json.Unmarshal(value, &plain); err != nil {
6984 return err
6985 }
6986 *j = NoteEntry(plain)
6987 return nil
6988 }
6989
6990 type Notes map[string]NoteEntry
6991
6992 type PrimalityTestGroup struct {
6993
6994 Source Source `json:"source"`
6995
6996
6997 Tests []PrimalityTestVector `json:"tests"`
6998
6999
7000 Type PrimalityTestGroupType `json:"type"`
7001 }
7002
7003 type PrimalityTestGroupType string
7004
7005 const PrimalityTestGroupTypePrimalityTest PrimalityTestGroupType = "PrimalityTest"
7006
7007 var enumValues_PrimalityTestGroupType = []interface{}{
7008 "PrimalityTest",
7009 }
7010
7011
7012 func (j *PrimalityTestGroupType) UnmarshalJSON(value []byte) error {
7013 var v string
7014 if err := json.Unmarshal(value, &v); err != nil {
7015 return err
7016 }
7017 var ok bool
7018 for _, expected := range enumValues_PrimalityTestGroupType {
7019 if reflect.DeepEqual(v, expected) {
7020 ok = true
7021 break
7022 }
7023 }
7024 if !ok {
7025 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PrimalityTestGroupType, v)
7026 }
7027 *j = PrimalityTestGroupType(v)
7028 return nil
7029 }
7030
7031
7032 func (j *PrimalityTestGroup) UnmarshalJSON(value []byte) error {
7033 var raw map[string]interface{}
7034 if err := json.Unmarshal(value, &raw); err != nil {
7035 return err
7036 }
7037 if _, ok := raw["source"]; raw != nil && !ok {
7038 return fmt.Errorf("field source in PrimalityTestGroup: required")
7039 }
7040 if _, ok := raw["tests"]; raw != nil && !ok {
7041 return fmt.Errorf("field tests in PrimalityTestGroup: required")
7042 }
7043 if _, ok := raw["type"]; raw != nil && !ok {
7044 return fmt.Errorf("field type in PrimalityTestGroup: required")
7045 }
7046 type Plain PrimalityTestGroup
7047 var plain Plain
7048 if err := json.Unmarshal(value, &plain); err != nil {
7049 return err
7050 }
7051 *j = PrimalityTestGroup(plain)
7052 return nil
7053 }
7054
7055 type PrimalityTestSchemaV1Json struct {
7056
7057 Algorithm string `json:"algorithm"`
7058
7059
7060 GeneratorVersion *string `json:"generatorVersion,omitempty"`
7061
7062
7063 Header []string `json:"header"`
7064
7065
7066 Notes Notes `json:"notes"`
7067
7068
7069 NumberOfTests int `json:"numberOfTests"`
7070
7071
7072 Schema PrimalityTestSchemaV1JsonSchema `json:"schema"`
7073
7074
7075 TestGroups []PrimalityTestGroup `json:"testGroups"`
7076 }
7077
7078 type PrimalityTestSchemaV1JsonSchema string
7079
7080 const PrimalityTestSchemaV1JsonSchemaPrimalityTestSchemaV1Json PrimalityTestSchemaV1JsonSchema = "primality_test_schema_v1.json"
7081
7082 var enumValues_PrimalityTestSchemaV1JsonSchema = []interface{}{
7083 "primality_test_schema_v1.json",
7084 }
7085
7086
7087 func (j *PrimalityTestSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7088 var v string
7089 if err := json.Unmarshal(value, &v); err != nil {
7090 return err
7091 }
7092 var ok bool
7093 for _, expected := range enumValues_PrimalityTestSchemaV1JsonSchema {
7094 if reflect.DeepEqual(v, expected) {
7095 ok = true
7096 break
7097 }
7098 }
7099 if !ok {
7100 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PrimalityTestSchemaV1JsonSchema, v)
7101 }
7102 *j = PrimalityTestSchemaV1JsonSchema(v)
7103 return nil
7104 }
7105
7106
7107 func (j *PrimalityTestSchemaV1Json) UnmarshalJSON(value []byte) error {
7108 var raw map[string]interface{}
7109 if err := json.Unmarshal(value, &raw); err != nil {
7110 return err
7111 }
7112 if _, ok := raw["algorithm"]; raw != nil && !ok {
7113 return fmt.Errorf("field algorithm in PrimalityTestSchemaV1Json: required")
7114 }
7115 if _, ok := raw["header"]; raw != nil && !ok {
7116 return fmt.Errorf("field header in PrimalityTestSchemaV1Json: required")
7117 }
7118 if _, ok := raw["notes"]; raw != nil && !ok {
7119 return fmt.Errorf("field notes in PrimalityTestSchemaV1Json: required")
7120 }
7121 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7122 return fmt.Errorf("field numberOfTests in PrimalityTestSchemaV1Json: required")
7123 }
7124 if _, ok := raw["schema"]; raw != nil && !ok {
7125 return fmt.Errorf("field schema in PrimalityTestSchemaV1Json: required")
7126 }
7127 if _, ok := raw["testGroups"]; raw != nil && !ok {
7128 return fmt.Errorf("field testGroups in PrimalityTestSchemaV1Json: required")
7129 }
7130 type Plain PrimalityTestSchemaV1Json
7131 var plain Plain
7132 if err := json.Unmarshal(value, &plain); err != nil {
7133 return err
7134 }
7135 *j = PrimalityTestSchemaV1Json(plain)
7136 return nil
7137 }
7138
7139 type PrimalityTestVector struct {
7140
7141 Comment string `json:"comment"`
7142
7143
7144 Flags []string `json:"flags"`
7145
7146
7147 Result Result `json:"result"`
7148
7149
7150 TcId int `json:"tcId"`
7151
7152
7153 Value string `json:"value"`
7154 }
7155
7156
7157 func (j *PrimalityTestVector) UnmarshalJSON(value []byte) error {
7158 var raw map[string]interface{}
7159 if err := json.Unmarshal(value, &raw); err != nil {
7160 return err
7161 }
7162 if _, ok := raw["comment"]; raw != nil && !ok {
7163 return fmt.Errorf("field comment in PrimalityTestVector: required")
7164 }
7165 if _, ok := raw["flags"]; raw != nil && !ok {
7166 return fmt.Errorf("field flags in PrimalityTestVector: required")
7167 }
7168 if _, ok := raw["result"]; raw != nil && !ok {
7169 return fmt.Errorf("field result in PrimalityTestVector: required")
7170 }
7171 if _, ok := raw["tcId"]; raw != nil && !ok {
7172 return fmt.Errorf("field tcId in PrimalityTestVector: required")
7173 }
7174 if _, ok := raw["value"]; raw != nil && !ok {
7175 return fmt.Errorf("field value in PrimalityTestVector: required")
7176 }
7177 type Plain PrimalityTestVector
7178 var plain Plain
7179 if err := json.Unmarshal(value, &plain); err != nil {
7180 return err
7181 }
7182 *j = PrimalityTestVector(plain)
7183 return nil
7184 }
7185
7186 type PrivateKey struct {
7187
7188 Coefficient *string `json:"coefficient,omitempty"`
7189
7190
7191 Exponent1 *string `json:"exponent1,omitempty"`
7192
7193
7194 Exponent2 *string `json:"exponent2,omitempty"`
7195
7196
7197 Modulus string `json:"modulus"`
7198
7199
7200 OtherPrimeInfos [][]string `json:"otherPrimeInfos,omitempty"`
7201
7202
7203 Prime1 *string `json:"prime1,omitempty"`
7204
7205
7206 Prime2 *string `json:"prime2,omitempty"`
7207
7208
7209 PrivateExponent string `json:"privateExponent"`
7210
7211
7212 PublicExponent string `json:"publicExponent"`
7213 }
7214
7215
7216 func (j *PrivateKey) 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["modulus"]; raw != nil && !ok {
7222 return fmt.Errorf("field modulus in PrivateKey: required")
7223 }
7224 if _, ok := raw["privateExponent"]; raw != nil && !ok {
7225 return fmt.Errorf("field privateExponent in PrivateKey: required")
7226 }
7227 if _, ok := raw["publicExponent"]; raw != nil && !ok {
7228 return fmt.Errorf("field publicExponent in PrivateKey: required")
7229 }
7230 type Plain PrivateKey
7231 var plain Plain
7232 if err := json.Unmarshal(value, &plain); err != nil {
7233 return err
7234 }
7235 *j = PrivateKey(plain)
7236 return nil
7237 }
7238
7239 type PublicKey struct {
7240
7241 Curve string `json:"curve"`
7242
7243
7244 KeySize int `json:"keySize"`
7245
7246
7247 Pk string `json:"pk"`
7248
7249
7250 Type PublicKeyType `json:"type"`
7251 }
7252
7253 type PublicKeyType string
7254
7255 const PublicKeyTypeECDSAPublicKey PublicKeyType = "ECDSAPublicKey"
7256 const PublicKeyTypeEDDSAPublicKey PublicKeyType = "EDDSAPublicKey"
7257
7258 var enumValues_PublicKeyType = []interface{}{
7259 "ECDSAPublicKey",
7260 "EDDSAPublicKey",
7261 }
7262
7263
7264 func (j *PublicKeyType) UnmarshalJSON(value []byte) error {
7265 var v string
7266 if err := json.Unmarshal(value, &v); err != nil {
7267 return err
7268 }
7269 var ok bool
7270 for _, expected := range enumValues_PublicKeyType {
7271 if reflect.DeepEqual(v, expected) {
7272 ok = true
7273 break
7274 }
7275 }
7276 if !ok {
7277 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_PublicKeyType, v)
7278 }
7279 *j = PublicKeyType(v)
7280 return nil
7281 }
7282
7283
7284 func (j *PublicKey) UnmarshalJSON(value []byte) error {
7285 var raw map[string]interface{}
7286 if err := json.Unmarshal(value, &raw); err != nil {
7287 return err
7288 }
7289 if _, ok := raw["curve"]; raw != nil && !ok {
7290 return fmt.Errorf("field curve in PublicKey: required")
7291 }
7292 if _, ok := raw["keySize"]; raw != nil && !ok {
7293 return fmt.Errorf("field keySize in PublicKey: required")
7294 }
7295 if _, ok := raw["pk"]; raw != nil && !ok {
7296 return fmt.Errorf("field pk in PublicKey: required")
7297 }
7298 if _, ok := raw["type"]; raw != nil && !ok {
7299 return fmt.Errorf("field type in PublicKey: required")
7300 }
7301 type Plain PublicKey
7302 var plain Plain
7303 if err := json.Unmarshal(value, &plain); err != nil {
7304 return err
7305 }
7306 *j = PublicKey(plain)
7307 return nil
7308 }
7309
7310
7311 type Recipient struct {
7312
7313 EncryptedKey *string `json:"encrypted_key,omitempty"`
7314
7315
7316 Header RecipientHeader `json:"header,omitempty"`
7317 }
7318
7319
7320 type RecipientHeader map[string]interface{}
7321
7322 type Result string
7323
7324 const ResultAcceptable Result = "acceptable"
7325 const ResultInvalid Result = "invalid"
7326 const ResultValid Result = "valid"
7327
7328 var enumValues_Result = []interface{}{
7329 "valid",
7330 "invalid",
7331 "acceptable",
7332 }
7333
7334
7335 func (j *Result) UnmarshalJSON(value []byte) error {
7336 var v string
7337 if err := json.Unmarshal(value, &v); err != nil {
7338 return err
7339 }
7340 var ok bool
7341 for _, expected := range enumValues_Result {
7342 if reflect.DeepEqual(v, expected) {
7343 ok = true
7344 break
7345 }
7346 }
7347 if !ok {
7348 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_Result, v)
7349 }
7350 *j = Result(v)
7351 return nil
7352 }
7353
7354 type RsaesOaepDecryptSchemaV1Json struct {
7355
7356 Algorithm string `json:"algorithm"`
7357
7358
7359 GeneratorVersion *string `json:"generatorVersion,omitempty"`
7360
7361
7362 Header []string `json:"header"`
7363
7364
7365 Notes Notes `json:"notes"`
7366
7367
7368 NumberOfTests int `json:"numberOfTests"`
7369
7370
7371 Schema RsaesOaepDecryptSchemaV1JsonSchema `json:"schema"`
7372
7373
7374 TestGroups []RsaesOaepTestGroup `json:"testGroups"`
7375 }
7376
7377 type RsaesOaepDecryptSchemaV1JsonSchema string
7378
7379 const RsaesOaepDecryptSchemaV1JsonSchemaRsaesOaepDecryptSchemaV1Json RsaesOaepDecryptSchemaV1JsonSchema = "rsaes_oaep_decrypt_schema_v1.json"
7380
7381 var enumValues_RsaesOaepDecryptSchemaV1JsonSchema = []interface{}{
7382 "rsaes_oaep_decrypt_schema_v1.json",
7383 }
7384
7385
7386 func (j *RsaesOaepDecryptSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7387 var v string
7388 if err := json.Unmarshal(value, &v); err != nil {
7389 return err
7390 }
7391 var ok bool
7392 for _, expected := range enumValues_RsaesOaepDecryptSchemaV1JsonSchema {
7393 if reflect.DeepEqual(v, expected) {
7394 ok = true
7395 break
7396 }
7397 }
7398 if !ok {
7399 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesOaepDecryptSchemaV1JsonSchema, v)
7400 }
7401 *j = RsaesOaepDecryptSchemaV1JsonSchema(v)
7402 return nil
7403 }
7404
7405
7406 func (j *RsaesOaepDecryptSchemaV1Json) UnmarshalJSON(value []byte) error {
7407 var raw map[string]interface{}
7408 if err := json.Unmarshal(value, &raw); err != nil {
7409 return err
7410 }
7411 if _, ok := raw["algorithm"]; raw != nil && !ok {
7412 return fmt.Errorf("field algorithm in RsaesOaepDecryptSchemaV1Json: required")
7413 }
7414 if _, ok := raw["header"]; raw != nil && !ok {
7415 return fmt.Errorf("field header in RsaesOaepDecryptSchemaV1Json: required")
7416 }
7417 if _, ok := raw["notes"]; raw != nil && !ok {
7418 return fmt.Errorf("field notes in RsaesOaepDecryptSchemaV1Json: required")
7419 }
7420 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7421 return fmt.Errorf("field numberOfTests in RsaesOaepDecryptSchemaV1Json: required")
7422 }
7423 if _, ok := raw["schema"]; raw != nil && !ok {
7424 return fmt.Errorf("field schema in RsaesOaepDecryptSchemaV1Json: required")
7425 }
7426 if _, ok := raw["testGroups"]; raw != nil && !ok {
7427 return fmt.Errorf("field testGroups in RsaesOaepDecryptSchemaV1Json: required")
7428 }
7429 type Plain RsaesOaepDecryptSchemaV1Json
7430 var plain Plain
7431 if err := json.Unmarshal(value, &plain); err != nil {
7432 return err
7433 }
7434 *j = RsaesOaepDecryptSchemaV1Json(plain)
7435 return nil
7436 }
7437
7438 type RsaesOaepTestGroup struct {
7439
7440 KeySize int `json:"keySize"`
7441
7442
7443 Mgf string `json:"mgf"`
7444
7445
7446 MgfSha string `json:"mgfSha"`
7447
7448
7449 PrivateKey PrivateKey `json:"privateKey"`
7450
7451
7452 PrivateKeyJwk *JsonWebKey `json:"privateKeyJwk,omitempty"`
7453
7454
7455 PrivateKeyPem string `json:"privateKeyPem"`
7456
7457
7458 PrivateKeyPkcs8 string `json:"privateKeyPkcs8"`
7459
7460
7461 Sha string `json:"sha"`
7462
7463
7464 Source Source `json:"source"`
7465
7466
7467 Tests []RsaesOaepTestVector `json:"tests"`
7468
7469
7470 Type RsaesOaepTestGroupType `json:"type"`
7471 }
7472
7473 type RsaesOaepTestGroupType string
7474
7475 const RsaesOaepTestGroupTypeRsaesOaepDecrypt RsaesOaepTestGroupType = "RsaesOaepDecrypt"
7476
7477 var enumValues_RsaesOaepTestGroupType = []interface{}{
7478 "RsaesOaepDecrypt",
7479 }
7480
7481
7482 func (j *RsaesOaepTestGroupType) UnmarshalJSON(value []byte) error {
7483 var v string
7484 if err := json.Unmarshal(value, &v); err != nil {
7485 return err
7486 }
7487 var ok bool
7488 for _, expected := range enumValues_RsaesOaepTestGroupType {
7489 if reflect.DeepEqual(v, expected) {
7490 ok = true
7491 break
7492 }
7493 }
7494 if !ok {
7495 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesOaepTestGroupType, v)
7496 }
7497 *j = RsaesOaepTestGroupType(v)
7498 return nil
7499 }
7500
7501
7502 func (j *RsaesOaepTestGroup) UnmarshalJSON(value []byte) error {
7503 var raw map[string]interface{}
7504 if err := json.Unmarshal(value, &raw); err != nil {
7505 return err
7506 }
7507 if _, ok := raw["keySize"]; raw != nil && !ok {
7508 return fmt.Errorf("field keySize in RsaesOaepTestGroup: required")
7509 }
7510 if _, ok := raw["mgf"]; raw != nil && !ok {
7511 return fmt.Errorf("field mgf in RsaesOaepTestGroup: required")
7512 }
7513 if _, ok := raw["mgfSha"]; raw != nil && !ok {
7514 return fmt.Errorf("field mgfSha in RsaesOaepTestGroup: required")
7515 }
7516 if _, ok := raw["privateKey"]; raw != nil && !ok {
7517 return fmt.Errorf("field privateKey in RsaesOaepTestGroup: required")
7518 }
7519 if _, ok := raw["privateKeyPem"]; raw != nil && !ok {
7520 return fmt.Errorf("field privateKeyPem in RsaesOaepTestGroup: required")
7521 }
7522 if _, ok := raw["privateKeyPkcs8"]; raw != nil && !ok {
7523 return fmt.Errorf("field privateKeyPkcs8 in RsaesOaepTestGroup: required")
7524 }
7525 if _, ok := raw["sha"]; raw != nil && !ok {
7526 return fmt.Errorf("field sha in RsaesOaepTestGroup: required")
7527 }
7528 if _, ok := raw["source"]; raw != nil && !ok {
7529 return fmt.Errorf("field source in RsaesOaepTestGroup: required")
7530 }
7531 if _, ok := raw["tests"]; raw != nil && !ok {
7532 return fmt.Errorf("field tests in RsaesOaepTestGroup: required")
7533 }
7534 if _, ok := raw["type"]; raw != nil && !ok {
7535 return fmt.Errorf("field type in RsaesOaepTestGroup: required")
7536 }
7537 type Plain RsaesOaepTestGroup
7538 var plain Plain
7539 if err := json.Unmarshal(value, &plain); err != nil {
7540 return err
7541 }
7542 *j = RsaesOaepTestGroup(plain)
7543 return nil
7544 }
7545
7546 type RsaesOaepTestVector struct {
7547
7548 Comment string `json:"comment"`
7549
7550
7551 Ct string `json:"ct"`
7552
7553
7554 Flags []string `json:"flags"`
7555
7556
7557 Label string `json:"label"`
7558
7559
7560 Msg string `json:"msg"`
7561
7562
7563 Result Result `json:"result"`
7564
7565
7566 TcId int `json:"tcId"`
7567 }
7568
7569
7570 func (j *RsaesOaepTestVector) UnmarshalJSON(value []byte) error {
7571 var raw map[string]interface{}
7572 if err := json.Unmarshal(value, &raw); err != nil {
7573 return err
7574 }
7575 if _, ok := raw["comment"]; raw != nil && !ok {
7576 return fmt.Errorf("field comment in RsaesOaepTestVector: required")
7577 }
7578 if _, ok := raw["ct"]; raw != nil && !ok {
7579 return fmt.Errorf("field ct in RsaesOaepTestVector: required")
7580 }
7581 if _, ok := raw["flags"]; raw != nil && !ok {
7582 return fmt.Errorf("field flags in RsaesOaepTestVector: required")
7583 }
7584 if _, ok := raw["label"]; raw != nil && !ok {
7585 return fmt.Errorf("field label in RsaesOaepTestVector: required")
7586 }
7587 if _, ok := raw["msg"]; raw != nil && !ok {
7588 return fmt.Errorf("field msg in RsaesOaepTestVector: required")
7589 }
7590 if _, ok := raw["result"]; raw != nil && !ok {
7591 return fmt.Errorf("field result in RsaesOaepTestVector: required")
7592 }
7593 if _, ok := raw["tcId"]; raw != nil && !ok {
7594 return fmt.Errorf("field tcId in RsaesOaepTestVector: required")
7595 }
7596 type Plain RsaesOaepTestVector
7597 var plain Plain
7598 if err := json.Unmarshal(value, &plain); err != nil {
7599 return err
7600 }
7601 *j = RsaesOaepTestVector(plain)
7602 return nil
7603 }
7604
7605 type RsaesPkcs1DecryptSchemaV1Json struct {
7606
7607 Algorithm string `json:"algorithm"`
7608
7609
7610 GeneratorVersion *string `json:"generatorVersion,omitempty"`
7611
7612
7613 Header []string `json:"header"`
7614
7615
7616 Notes Notes `json:"notes"`
7617
7618
7619 NumberOfTests int `json:"numberOfTests"`
7620
7621
7622 Schema RsaesPkcs1DecryptSchemaV1JsonSchema `json:"schema"`
7623
7624
7625 TestGroups []RsaesPkcs1TestGroup `json:"testGroups"`
7626 }
7627
7628 type RsaesPkcs1DecryptSchemaV1JsonSchema string
7629
7630 const RsaesPkcs1DecryptSchemaV1JsonSchemaRsaesPkcs1DecryptSchemaV1Json RsaesPkcs1DecryptSchemaV1JsonSchema = "rsaes_pkcs1_decrypt_schema_v1.json"
7631
7632 var enumValues_RsaesPkcs1DecryptSchemaV1JsonSchema = []interface{}{
7633 "rsaes_pkcs1_decrypt_schema_v1.json",
7634 }
7635
7636
7637 func (j *RsaesPkcs1DecryptSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7638 var v string
7639 if err := json.Unmarshal(value, &v); err != nil {
7640 return err
7641 }
7642 var ok bool
7643 for _, expected := range enumValues_RsaesPkcs1DecryptSchemaV1JsonSchema {
7644 if reflect.DeepEqual(v, expected) {
7645 ok = true
7646 break
7647 }
7648 }
7649 if !ok {
7650 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesPkcs1DecryptSchemaV1JsonSchema, v)
7651 }
7652 *j = RsaesPkcs1DecryptSchemaV1JsonSchema(v)
7653 return nil
7654 }
7655
7656
7657 func (j *RsaesPkcs1DecryptSchemaV1Json) UnmarshalJSON(value []byte) error {
7658 var raw map[string]interface{}
7659 if err := json.Unmarshal(value, &raw); err != nil {
7660 return err
7661 }
7662 if _, ok := raw["algorithm"]; raw != nil && !ok {
7663 return fmt.Errorf("field algorithm in RsaesPkcs1DecryptSchemaV1Json: required")
7664 }
7665 if _, ok := raw["header"]; raw != nil && !ok {
7666 return fmt.Errorf("field header in RsaesPkcs1DecryptSchemaV1Json: required")
7667 }
7668 if _, ok := raw["notes"]; raw != nil && !ok {
7669 return fmt.Errorf("field notes in RsaesPkcs1DecryptSchemaV1Json: required")
7670 }
7671 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
7672 return fmt.Errorf("field numberOfTests in RsaesPkcs1DecryptSchemaV1Json: required")
7673 }
7674 if _, ok := raw["schema"]; raw != nil && !ok {
7675 return fmt.Errorf("field schema in RsaesPkcs1DecryptSchemaV1Json: required")
7676 }
7677 if _, ok := raw["testGroups"]; raw != nil && !ok {
7678 return fmt.Errorf("field testGroups in RsaesPkcs1DecryptSchemaV1Json: required")
7679 }
7680 type Plain RsaesPkcs1DecryptSchemaV1Json
7681 var plain Plain
7682 if err := json.Unmarshal(value, &plain); err != nil {
7683 return err
7684 }
7685 *j = RsaesPkcs1DecryptSchemaV1Json(plain)
7686 return nil
7687 }
7688
7689 type RsaesPkcs1TestGroup struct {
7690
7691 KeySize int `json:"keySize"`
7692
7693
7694 PrivateKey PrivateKey `json:"privateKey"`
7695
7696
7697 PrivateKeyJwk *JsonWebKey `json:"privateKeyJwk,omitempty"`
7698
7699
7700 PrivateKeyPem string `json:"privateKeyPem"`
7701
7702
7703 PrivateKeyPkcs8 string `json:"privateKeyPkcs8"`
7704
7705
7706 Source Source `json:"source"`
7707
7708
7709 Tests []RsaesPkcs1TestVector `json:"tests"`
7710
7711
7712 Type RsaesPkcs1TestGroupType `json:"type"`
7713 }
7714
7715 type RsaesPkcs1TestGroupType string
7716
7717 const RsaesPkcs1TestGroupTypeRsaesPkcs1Decrypt RsaesPkcs1TestGroupType = "RsaesPkcs1Decrypt"
7718
7719 var enumValues_RsaesPkcs1TestGroupType = []interface{}{
7720 "RsaesPkcs1Decrypt",
7721 }
7722
7723
7724 func (j *RsaesPkcs1TestGroupType) UnmarshalJSON(value []byte) error {
7725 var v string
7726 if err := json.Unmarshal(value, &v); err != nil {
7727 return err
7728 }
7729 var ok bool
7730 for _, expected := range enumValues_RsaesPkcs1TestGroupType {
7731 if reflect.DeepEqual(v, expected) {
7732 ok = true
7733 break
7734 }
7735 }
7736 if !ok {
7737 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsaesPkcs1TestGroupType, v)
7738 }
7739 *j = RsaesPkcs1TestGroupType(v)
7740 return nil
7741 }
7742
7743
7744 func (j *RsaesPkcs1TestGroup) UnmarshalJSON(value []byte) error {
7745 var raw map[string]interface{}
7746 if err := json.Unmarshal(value, &raw); err != nil {
7747 return err
7748 }
7749 if _, ok := raw["keySize"]; raw != nil && !ok {
7750 return fmt.Errorf("field keySize in RsaesPkcs1TestGroup: required")
7751 }
7752 if _, ok := raw["privateKey"]; raw != nil && !ok {
7753 return fmt.Errorf("field privateKey in RsaesPkcs1TestGroup: required")
7754 }
7755 if _, ok := raw["privateKeyPem"]; raw != nil && !ok {
7756 return fmt.Errorf("field privateKeyPem in RsaesPkcs1TestGroup: required")
7757 }
7758 if _, ok := raw["privateKeyPkcs8"]; raw != nil && !ok {
7759 return fmt.Errorf("field privateKeyPkcs8 in RsaesPkcs1TestGroup: required")
7760 }
7761 if _, ok := raw["source"]; raw != nil && !ok {
7762 return fmt.Errorf("field source in RsaesPkcs1TestGroup: required")
7763 }
7764 if _, ok := raw["tests"]; raw != nil && !ok {
7765 return fmt.Errorf("field tests in RsaesPkcs1TestGroup: required")
7766 }
7767 if _, ok := raw["type"]; raw != nil && !ok {
7768 return fmt.Errorf("field type in RsaesPkcs1TestGroup: required")
7769 }
7770 type Plain RsaesPkcs1TestGroup
7771 var plain Plain
7772 if err := json.Unmarshal(value, &plain); err != nil {
7773 return err
7774 }
7775 *j = RsaesPkcs1TestGroup(plain)
7776 return nil
7777 }
7778
7779 type RsaesPkcs1TestVector struct {
7780
7781 Comment string `json:"comment"`
7782
7783
7784 Ct string `json:"ct"`
7785
7786
7787 Flags []string `json:"flags"`
7788
7789
7790 Msg string `json:"msg"`
7791
7792
7793 Result Result `json:"result"`
7794
7795
7796 TcId int `json:"tcId"`
7797 }
7798
7799
7800 func (j *RsaesPkcs1TestVector) UnmarshalJSON(value []byte) error {
7801 var raw map[string]interface{}
7802 if err := json.Unmarshal(value, &raw); err != nil {
7803 return err
7804 }
7805 if _, ok := raw["comment"]; raw != nil && !ok {
7806 return fmt.Errorf("field comment in RsaesPkcs1TestVector: required")
7807 }
7808 if _, ok := raw["ct"]; raw != nil && !ok {
7809 return fmt.Errorf("field ct in RsaesPkcs1TestVector: required")
7810 }
7811 if _, ok := raw["flags"]; raw != nil && !ok {
7812 return fmt.Errorf("field flags in RsaesPkcs1TestVector: required")
7813 }
7814 if _, ok := raw["msg"]; raw != nil && !ok {
7815 return fmt.Errorf("field msg in RsaesPkcs1TestVector: required")
7816 }
7817 if _, ok := raw["result"]; raw != nil && !ok {
7818 return fmt.Errorf("field result in RsaesPkcs1TestVector: required")
7819 }
7820 if _, ok := raw["tcId"]; raw != nil && !ok {
7821 return fmt.Errorf("field tcId in RsaesPkcs1TestVector: required")
7822 }
7823 type Plain RsaesPkcs1TestVector
7824 var plain Plain
7825 if err := json.Unmarshal(value, &plain); err != nil {
7826 return err
7827 }
7828 *j = RsaesPkcs1TestVector(plain)
7829 return nil
7830 }
7831
7832 type RsassaPkcs1GenTestGroup struct {
7833
7834 KeyAsn string `json:"keyAsn"`
7835
7836
7837 KeyDer string `json:"keyDer"`
7838
7839
7840 KeyJwk *JsonWebKey `json:"keyJwk,omitempty"`
7841
7842
7843 KeyPem string `json:"keyPem"`
7844
7845
7846 KeySize int `json:"keySize"`
7847
7848
7849 PrivateKey PrivateKey `json:"privateKey"`
7850
7851
7852 PrivateKeyJwk *JsonWebKey `json:"privateKeyJwk,omitempty"`
7853
7854
7855 PrivateKeyPem string `json:"privateKeyPem"`
7856
7857
7858 PrivateKeyPkcs8 string `json:"privateKeyPkcs8"`
7859
7860
7861 Sha string `json:"sha"`
7862
7863
7864 Source Source `json:"source"`
7865
7866
7867 Tests []SignatureTestVector `json:"tests"`
7868
7869
7870 Type RsassaPkcs1GenTestGroupType `json:"type"`
7871 }
7872
7873 type RsassaPkcs1GenTestGroupType string
7874
7875 const RsassaPkcs1GenTestGroupTypeRsassaPkcs1Generate RsassaPkcs1GenTestGroupType = "RsassaPkcs1Generate"
7876
7877 var enumValues_RsassaPkcs1GenTestGroupType = []interface{}{
7878 "RsassaPkcs1Generate",
7879 }
7880
7881
7882 func (j *RsassaPkcs1GenTestGroupType) UnmarshalJSON(value []byte) error {
7883 var v string
7884 if err := json.Unmarshal(value, &v); err != nil {
7885 return err
7886 }
7887 var ok bool
7888 for _, expected := range enumValues_RsassaPkcs1GenTestGroupType {
7889 if reflect.DeepEqual(v, expected) {
7890 ok = true
7891 break
7892 }
7893 }
7894 if !ok {
7895 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1GenTestGroupType, v)
7896 }
7897 *j = RsassaPkcs1GenTestGroupType(v)
7898 return nil
7899 }
7900
7901
7902 func (j *RsassaPkcs1GenTestGroup) UnmarshalJSON(value []byte) error {
7903 var raw map[string]interface{}
7904 if err := json.Unmarshal(value, &raw); err != nil {
7905 return err
7906 }
7907 if _, ok := raw["keyAsn"]; raw != nil && !ok {
7908 return fmt.Errorf("field keyAsn in RsassaPkcs1GenTestGroup: required")
7909 }
7910 if _, ok := raw["keyDer"]; raw != nil && !ok {
7911 return fmt.Errorf("field keyDer in RsassaPkcs1GenTestGroup: required")
7912 }
7913 if _, ok := raw["keyPem"]; raw != nil && !ok {
7914 return fmt.Errorf("field keyPem in RsassaPkcs1GenTestGroup: required")
7915 }
7916 if _, ok := raw["keySize"]; raw != nil && !ok {
7917 return fmt.Errorf("field keySize in RsassaPkcs1GenTestGroup: required")
7918 }
7919 if _, ok := raw["privateKey"]; raw != nil && !ok {
7920 return fmt.Errorf("field privateKey in RsassaPkcs1GenTestGroup: required")
7921 }
7922 if _, ok := raw["privateKeyPem"]; raw != nil && !ok {
7923 return fmt.Errorf("field privateKeyPem in RsassaPkcs1GenTestGroup: required")
7924 }
7925 if _, ok := raw["privateKeyPkcs8"]; raw != nil && !ok {
7926 return fmt.Errorf("field privateKeyPkcs8 in RsassaPkcs1GenTestGroup: required")
7927 }
7928 if _, ok := raw["sha"]; raw != nil && !ok {
7929 return fmt.Errorf("field sha in RsassaPkcs1GenTestGroup: required")
7930 }
7931 if _, ok := raw["source"]; raw != nil && !ok {
7932 return fmt.Errorf("field source in RsassaPkcs1GenTestGroup: required")
7933 }
7934 if _, ok := raw["tests"]; raw != nil && !ok {
7935 return fmt.Errorf("field tests in RsassaPkcs1GenTestGroup: required")
7936 }
7937 if _, ok := raw["type"]; raw != nil && !ok {
7938 return fmt.Errorf("field type in RsassaPkcs1GenTestGroup: required")
7939 }
7940 type Plain RsassaPkcs1GenTestGroup
7941 var plain Plain
7942 if err := json.Unmarshal(value, &plain); err != nil {
7943 return err
7944 }
7945 *j = RsassaPkcs1GenTestGroup(plain)
7946 return nil
7947 }
7948
7949 type RsassaPkcs1GenerateSchemaV1Json struct {
7950
7951 Algorithm string `json:"algorithm"`
7952
7953
7954 Header []string `json:"header"`
7955
7956
7957 Notes Notes `json:"notes"`
7958
7959
7960 NumberOfTests int `json:"numberOfTests"`
7961
7962
7963 Schema RsassaPkcs1GenerateSchemaV1JsonSchema `json:"schema"`
7964
7965
7966 TestGroups []RsassaPkcs1GenTestGroup `json:"testGroups"`
7967 }
7968
7969 type RsassaPkcs1GenerateSchemaV1JsonSchema string
7970
7971 const RsassaPkcs1GenerateSchemaV1JsonSchemaRsassaPkcs1GenerateSchemaV1Json RsassaPkcs1GenerateSchemaV1JsonSchema = "rsassa_pkcs1_generate_schema_v1.json"
7972
7973 var enumValues_RsassaPkcs1GenerateSchemaV1JsonSchema = []interface{}{
7974 "rsassa_pkcs1_generate_schema_v1.json",
7975 }
7976
7977
7978 func (j *RsassaPkcs1GenerateSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
7979 var v string
7980 if err := json.Unmarshal(value, &v); err != nil {
7981 return err
7982 }
7983 var ok bool
7984 for _, expected := range enumValues_RsassaPkcs1GenerateSchemaV1JsonSchema {
7985 if reflect.DeepEqual(v, expected) {
7986 ok = true
7987 break
7988 }
7989 }
7990 if !ok {
7991 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1GenerateSchemaV1JsonSchema, v)
7992 }
7993 *j = RsassaPkcs1GenerateSchemaV1JsonSchema(v)
7994 return nil
7995 }
7996
7997
7998 func (j *RsassaPkcs1GenerateSchemaV1Json) UnmarshalJSON(value []byte) error {
7999 var raw map[string]interface{}
8000 if err := json.Unmarshal(value, &raw); err != nil {
8001 return err
8002 }
8003 if _, ok := raw["algorithm"]; raw != nil && !ok {
8004 return fmt.Errorf("field algorithm in RsassaPkcs1GenerateSchemaV1Json: required")
8005 }
8006 if _, ok := raw["header"]; raw != nil && !ok {
8007 return fmt.Errorf("field header in RsassaPkcs1GenerateSchemaV1Json: required")
8008 }
8009 if _, ok := raw["notes"]; raw != nil && !ok {
8010 return fmt.Errorf("field notes in RsassaPkcs1GenerateSchemaV1Json: required")
8011 }
8012 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8013 return fmt.Errorf("field numberOfTests in RsassaPkcs1GenerateSchemaV1Json: required")
8014 }
8015 if _, ok := raw["schema"]; raw != nil && !ok {
8016 return fmt.Errorf("field schema in RsassaPkcs1GenerateSchemaV1Json: required")
8017 }
8018 if _, ok := raw["testGroups"]; raw != nil && !ok {
8019 return fmt.Errorf("field testGroups in RsassaPkcs1GenerateSchemaV1Json: required")
8020 }
8021 type Plain RsassaPkcs1GenerateSchemaV1Json
8022 var plain Plain
8023 if err := json.Unmarshal(value, &plain); err != nil {
8024 return err
8025 }
8026 *j = RsassaPkcs1GenerateSchemaV1Json(plain)
8027 return nil
8028 }
8029
8030 type RsassaPkcs1TestGroup struct {
8031
8032 KeyJwk *JsonWebKey `json:"keyJwk,omitempty"`
8033
8034
8035 KeySize int `json:"keySize"`
8036
8037
8038 PublicKey RsassaPkcs1TestGroupPublicKey `json:"publicKey"`
8039
8040
8041 PublicKeyAsn string `json:"publicKeyAsn"`
8042
8043
8044 PublicKeyDer string `json:"publicKeyDer"`
8045
8046
8047 PublicKeyPem string `json:"publicKeyPem"`
8048
8049
8050 Sha string `json:"sha"`
8051
8052
8053 Source Source `json:"source"`
8054
8055
8056 Tests []SignatureTestVector `json:"tests"`
8057
8058
8059 Type RsassaPkcs1TestGroupType `json:"type"`
8060 }
8061
8062 type RsassaPkcs1TestGroupPublicKey struct {
8063
8064 Modulus string `json:"modulus"`
8065
8066
8067 PublicExponent string `json:"publicExponent"`
8068 }
8069
8070
8071 func (j *RsassaPkcs1TestGroupPublicKey) 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["modulus"]; raw != nil && !ok {
8077 return fmt.Errorf("field modulus in RsassaPkcs1TestGroupPublicKey: required")
8078 }
8079 if _, ok := raw["publicExponent"]; raw != nil && !ok {
8080 return fmt.Errorf("field publicExponent in RsassaPkcs1TestGroupPublicKey: required")
8081 }
8082 type Plain RsassaPkcs1TestGroupPublicKey
8083 var plain Plain
8084 if err := json.Unmarshal(value, &plain); err != nil {
8085 return err
8086 }
8087 *j = RsassaPkcs1TestGroupPublicKey(plain)
8088 return nil
8089 }
8090
8091 type RsassaPkcs1TestGroupType string
8092
8093 const RsassaPkcs1TestGroupTypeRsassaPkcs1Verify RsassaPkcs1TestGroupType = "RsassaPkcs1Verify"
8094
8095 var enumValues_RsassaPkcs1TestGroupType = []interface{}{
8096 "RsassaPkcs1Verify",
8097 }
8098
8099
8100 func (j *RsassaPkcs1TestGroupType) UnmarshalJSON(value []byte) error {
8101 var v string
8102 if err := json.Unmarshal(value, &v); err != nil {
8103 return err
8104 }
8105 var ok bool
8106 for _, expected := range enumValues_RsassaPkcs1TestGroupType {
8107 if reflect.DeepEqual(v, expected) {
8108 ok = true
8109 break
8110 }
8111 }
8112 if !ok {
8113 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1TestGroupType, v)
8114 }
8115 *j = RsassaPkcs1TestGroupType(v)
8116 return nil
8117 }
8118
8119
8120 func (j *RsassaPkcs1TestGroup) UnmarshalJSON(value []byte) error {
8121 var raw map[string]interface{}
8122 if err := json.Unmarshal(value, &raw); err != nil {
8123 return err
8124 }
8125 if _, ok := raw["keySize"]; raw != nil && !ok {
8126 return fmt.Errorf("field keySize in RsassaPkcs1TestGroup: required")
8127 }
8128 if _, ok := raw["publicKey"]; raw != nil && !ok {
8129 return fmt.Errorf("field publicKey in RsassaPkcs1TestGroup: required")
8130 }
8131 if _, ok := raw["publicKeyAsn"]; raw != nil && !ok {
8132 return fmt.Errorf("field publicKeyAsn in RsassaPkcs1TestGroup: required")
8133 }
8134 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
8135 return fmt.Errorf("field publicKeyDer in RsassaPkcs1TestGroup: required")
8136 }
8137 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
8138 return fmt.Errorf("field publicKeyPem in RsassaPkcs1TestGroup: required")
8139 }
8140 if _, ok := raw["sha"]; raw != nil && !ok {
8141 return fmt.Errorf("field sha in RsassaPkcs1TestGroup: required")
8142 }
8143 if _, ok := raw["source"]; raw != nil && !ok {
8144 return fmt.Errorf("field source in RsassaPkcs1TestGroup: required")
8145 }
8146 if _, ok := raw["tests"]; raw != nil && !ok {
8147 return fmt.Errorf("field tests in RsassaPkcs1TestGroup: required")
8148 }
8149 if _, ok := raw["type"]; raw != nil && !ok {
8150 return fmt.Errorf("field type in RsassaPkcs1TestGroup: required")
8151 }
8152 type Plain RsassaPkcs1TestGroup
8153 var plain Plain
8154 if err := json.Unmarshal(value, &plain); err != nil {
8155 return err
8156 }
8157 *j = RsassaPkcs1TestGroup(plain)
8158 return nil
8159 }
8160
8161 type RsassaPkcs1VerifySchemaV1Json struct {
8162
8163 Algorithm string `json:"algorithm"`
8164
8165
8166 GeneratorVersion *string `json:"generatorVersion,omitempty"`
8167
8168
8169 Header []string `json:"header"`
8170
8171
8172 Notes Notes `json:"notes"`
8173
8174
8175 NumberOfTests int `json:"numberOfTests"`
8176
8177
8178 Schema RsassaPkcs1VerifySchemaV1JsonSchema `json:"schema"`
8179
8180
8181 TestGroups []RsassaPkcs1TestGroup `json:"testGroups"`
8182 }
8183
8184 type RsassaPkcs1VerifySchemaV1JsonSchema string
8185
8186 const RsassaPkcs1VerifySchemaV1JsonSchemaRsassaPkcs1VerifySchemaV1Json RsassaPkcs1VerifySchemaV1JsonSchema = "rsassa_pkcs1_verify_schema_v1.json"
8187
8188 var enumValues_RsassaPkcs1VerifySchemaV1JsonSchema = []interface{}{
8189 "rsassa_pkcs1_verify_schema_v1.json",
8190 }
8191
8192
8193 func (j *RsassaPkcs1VerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8194 var v string
8195 if err := json.Unmarshal(value, &v); err != nil {
8196 return err
8197 }
8198 var ok bool
8199 for _, expected := range enumValues_RsassaPkcs1VerifySchemaV1JsonSchema {
8200 if reflect.DeepEqual(v, expected) {
8201 ok = true
8202 break
8203 }
8204 }
8205 if !ok {
8206 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPkcs1VerifySchemaV1JsonSchema, v)
8207 }
8208 *j = RsassaPkcs1VerifySchemaV1JsonSchema(v)
8209 return nil
8210 }
8211
8212
8213 func (j *RsassaPkcs1VerifySchemaV1Json) UnmarshalJSON(value []byte) error {
8214 var raw map[string]interface{}
8215 if err := json.Unmarshal(value, &raw); err != nil {
8216 return err
8217 }
8218 if _, ok := raw["algorithm"]; raw != nil && !ok {
8219 return fmt.Errorf("field algorithm in RsassaPkcs1VerifySchemaV1Json: required")
8220 }
8221 if _, ok := raw["header"]; raw != nil && !ok {
8222 return fmt.Errorf("field header in RsassaPkcs1VerifySchemaV1Json: required")
8223 }
8224 if _, ok := raw["notes"]; raw != nil && !ok {
8225 return fmt.Errorf("field notes in RsassaPkcs1VerifySchemaV1Json: required")
8226 }
8227 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8228 return fmt.Errorf("field numberOfTests in RsassaPkcs1VerifySchemaV1Json: required")
8229 }
8230 if _, ok := raw["schema"]; raw != nil && !ok {
8231 return fmt.Errorf("field schema in RsassaPkcs1VerifySchemaV1Json: required")
8232 }
8233 if _, ok := raw["testGroups"]; raw != nil && !ok {
8234 return fmt.Errorf("field testGroups in RsassaPkcs1VerifySchemaV1Json: required")
8235 }
8236 type Plain RsassaPkcs1VerifySchemaV1Json
8237 var plain Plain
8238 if err := json.Unmarshal(value, &plain); err != nil {
8239 return err
8240 }
8241 *j = RsassaPkcs1VerifySchemaV1Json(plain)
8242 return nil
8243 }
8244
8245 type RsassaPssTestGroup struct {
8246
8247 KeySize int `json:"keySize"`
8248
8249
8250 Mgf string `json:"mgf"`
8251
8252
8253 MgfSha string `json:"mgfSha"`
8254
8255
8256 PublicKey RsassaPssTestGroupPublicKey `json:"publicKey"`
8257
8258
8259 PublicKeyAsn string `json:"publicKeyAsn"`
8260
8261
8262 PublicKeyDer string `json:"publicKeyDer"`
8263
8264
8265 PublicKeyJwk *JsonWebKey `json:"publicKeyJwk,omitempty"`
8266
8267
8268 PublicKeyPem string `json:"publicKeyPem"`
8269
8270
8271 SLen int `json:"sLen"`
8272
8273
8274 Sha string `json:"sha"`
8275
8276
8277 Source Source `json:"source"`
8278
8279
8280 Tests []RsassaPssTestVector `json:"tests"`
8281
8282
8283 Type RsassaPssTestGroupType `json:"type"`
8284 }
8285
8286 type RsassaPssTestGroupPublicKey struct {
8287
8288 Modulus string `json:"modulus"`
8289
8290
8291 PublicExponent string `json:"publicExponent"`
8292 }
8293
8294
8295 func (j *RsassaPssTestGroupPublicKey) UnmarshalJSON(value []byte) error {
8296 var raw map[string]interface{}
8297 if err := json.Unmarshal(value, &raw); err != nil {
8298 return err
8299 }
8300 if _, ok := raw["modulus"]; raw != nil && !ok {
8301 return fmt.Errorf("field modulus in RsassaPssTestGroupPublicKey: required")
8302 }
8303 if _, ok := raw["publicExponent"]; raw != nil && !ok {
8304 return fmt.Errorf("field publicExponent in RsassaPssTestGroupPublicKey: required")
8305 }
8306 type Plain RsassaPssTestGroupPublicKey
8307 var plain Plain
8308 if err := json.Unmarshal(value, &plain); err != nil {
8309 return err
8310 }
8311 *j = RsassaPssTestGroupPublicKey(plain)
8312 return nil
8313 }
8314
8315 type RsassaPssTestGroupType string
8316
8317 const RsassaPssTestGroupTypeRsassaPssVerify RsassaPssTestGroupType = "RsassaPssVerify"
8318
8319 var enumValues_RsassaPssTestGroupType = []interface{}{
8320 "RsassaPssVerify",
8321 }
8322
8323
8324 func (j *RsassaPssTestGroupType) UnmarshalJSON(value []byte) error {
8325 var v string
8326 if err := json.Unmarshal(value, &v); err != nil {
8327 return err
8328 }
8329 var ok bool
8330 for _, expected := range enumValues_RsassaPssTestGroupType {
8331 if reflect.DeepEqual(v, expected) {
8332 ok = true
8333 break
8334 }
8335 }
8336 if !ok {
8337 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPssTestGroupType, v)
8338 }
8339 *j = RsassaPssTestGroupType(v)
8340 return nil
8341 }
8342
8343
8344 func (j *RsassaPssTestGroup) UnmarshalJSON(value []byte) error {
8345 var raw map[string]interface{}
8346 if err := json.Unmarshal(value, &raw); err != nil {
8347 return err
8348 }
8349 if _, ok := raw["keySize"]; raw != nil && !ok {
8350 return fmt.Errorf("field keySize in RsassaPssTestGroup: required")
8351 }
8352 if _, ok := raw["mgf"]; raw != nil && !ok {
8353 return fmt.Errorf("field mgf in RsassaPssTestGroup: required")
8354 }
8355 if _, ok := raw["mgfSha"]; raw != nil && !ok {
8356 return fmt.Errorf("field mgfSha in RsassaPssTestGroup: required")
8357 }
8358 if _, ok := raw["publicKey"]; raw != nil && !ok {
8359 return fmt.Errorf("field publicKey in RsassaPssTestGroup: required")
8360 }
8361 if _, ok := raw["publicKeyAsn"]; raw != nil && !ok {
8362 return fmt.Errorf("field publicKeyAsn in RsassaPssTestGroup: required")
8363 }
8364 if _, ok := raw["publicKeyDer"]; raw != nil && !ok {
8365 return fmt.Errorf("field publicKeyDer in RsassaPssTestGroup: required")
8366 }
8367 if _, ok := raw["publicKeyPem"]; raw != nil && !ok {
8368 return fmt.Errorf("field publicKeyPem in RsassaPssTestGroup: required")
8369 }
8370 if _, ok := raw["sLen"]; raw != nil && !ok {
8371 return fmt.Errorf("field sLen in RsassaPssTestGroup: required")
8372 }
8373 if _, ok := raw["sha"]; raw != nil && !ok {
8374 return fmt.Errorf("field sha in RsassaPssTestGroup: required")
8375 }
8376 if _, ok := raw["source"]; raw != nil && !ok {
8377 return fmt.Errorf("field source in RsassaPssTestGroup: required")
8378 }
8379 if _, ok := raw["tests"]; raw != nil && !ok {
8380 return fmt.Errorf("field tests in RsassaPssTestGroup: required")
8381 }
8382 if _, ok := raw["type"]; raw != nil && !ok {
8383 return fmt.Errorf("field type in RsassaPssTestGroup: required")
8384 }
8385 type Plain RsassaPssTestGroup
8386 var plain Plain
8387 if err := json.Unmarshal(value, &plain); err != nil {
8388 return err
8389 }
8390 *j = RsassaPssTestGroup(plain)
8391 return nil
8392 }
8393
8394 type RsassaPssTestVector struct {
8395
8396 Comment string `json:"comment"`
8397
8398
8399 Flags []string `json:"flags"`
8400
8401
8402 Msg string `json:"msg"`
8403
8404
8405 Result Result `json:"result"`
8406
8407
8408 Sig string `json:"sig"`
8409
8410
8411 TcId int `json:"tcId"`
8412 }
8413
8414
8415 func (j *RsassaPssTestVector) UnmarshalJSON(value []byte) error {
8416 var raw map[string]interface{}
8417 if err := json.Unmarshal(value, &raw); err != nil {
8418 return err
8419 }
8420 if _, ok := raw["comment"]; raw != nil && !ok {
8421 return fmt.Errorf("field comment in RsassaPssTestVector: required")
8422 }
8423 if _, ok := raw["flags"]; raw != nil && !ok {
8424 return fmt.Errorf("field flags in RsassaPssTestVector: required")
8425 }
8426 if _, ok := raw["msg"]; raw != nil && !ok {
8427 return fmt.Errorf("field msg in RsassaPssTestVector: required")
8428 }
8429 if _, ok := raw["result"]; raw != nil && !ok {
8430 return fmt.Errorf("field result in RsassaPssTestVector: required")
8431 }
8432 if _, ok := raw["sig"]; raw != nil && !ok {
8433 return fmt.Errorf("field sig in RsassaPssTestVector: required")
8434 }
8435 if _, ok := raw["tcId"]; raw != nil && !ok {
8436 return fmt.Errorf("field tcId in RsassaPssTestVector: required")
8437 }
8438 type Plain RsassaPssTestVector
8439 var plain Plain
8440 if err := json.Unmarshal(value, &plain); err != nil {
8441 return err
8442 }
8443 *j = RsassaPssTestVector(plain)
8444 return nil
8445 }
8446
8447 type RsassaPssVerifySchemaV1Json struct {
8448
8449 Algorithm string `json:"algorithm"`
8450
8451
8452 GeneratorVersion *string `json:"generatorVersion,omitempty"`
8453
8454
8455 Header []string `json:"header"`
8456
8457
8458 Notes Notes `json:"notes"`
8459
8460
8461 NumberOfTests int `json:"numberOfTests"`
8462
8463
8464 Schema RsassaPssVerifySchemaV1JsonSchema `json:"schema"`
8465
8466
8467 TestGroups []RsassaPssTestGroup `json:"testGroups"`
8468 }
8469
8470 type RsassaPssVerifySchemaV1JsonSchema string
8471
8472 const RsassaPssVerifySchemaV1JsonSchemaRsassaPssVerifySchemaV1Json RsassaPssVerifySchemaV1JsonSchema = "rsassa_pss_verify_schema_v1.json"
8473
8474 var enumValues_RsassaPssVerifySchemaV1JsonSchema = []interface{}{
8475 "rsassa_pss_verify_schema_v1.json",
8476 }
8477
8478
8479 func (j *RsassaPssVerifySchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8480 var v string
8481 if err := json.Unmarshal(value, &v); err != nil {
8482 return err
8483 }
8484 var ok bool
8485 for _, expected := range enumValues_RsassaPssVerifySchemaV1JsonSchema {
8486 if reflect.DeepEqual(v, expected) {
8487 ok = true
8488 break
8489 }
8490 }
8491 if !ok {
8492 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_RsassaPssVerifySchemaV1JsonSchema, v)
8493 }
8494 *j = RsassaPssVerifySchemaV1JsonSchema(v)
8495 return nil
8496 }
8497
8498
8499 func (j *RsassaPssVerifySchemaV1Json) UnmarshalJSON(value []byte) error {
8500 var raw map[string]interface{}
8501 if err := json.Unmarshal(value, &raw); err != nil {
8502 return err
8503 }
8504 if _, ok := raw["algorithm"]; raw != nil && !ok {
8505 return fmt.Errorf("field algorithm in RsassaPssVerifySchemaV1Json: required")
8506 }
8507 if _, ok := raw["header"]; raw != nil && !ok {
8508 return fmt.Errorf("field header in RsassaPssVerifySchemaV1Json: required")
8509 }
8510 if _, ok := raw["notes"]; raw != nil && !ok {
8511 return fmt.Errorf("field notes in RsassaPssVerifySchemaV1Json: required")
8512 }
8513 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8514 return fmt.Errorf("field numberOfTests in RsassaPssVerifySchemaV1Json: required")
8515 }
8516 if _, ok := raw["schema"]; raw != nil && !ok {
8517 return fmt.Errorf("field schema in RsassaPssVerifySchemaV1Json: required")
8518 }
8519 if _, ok := raw["testGroups"]; raw != nil && !ok {
8520 return fmt.Errorf("field testGroups in RsassaPssVerifySchemaV1Json: required")
8521 }
8522 type Plain RsassaPssVerifySchemaV1Json
8523 var plain Plain
8524 if err := json.Unmarshal(value, &plain); err != nil {
8525 return err
8526 }
8527 *j = RsassaPssVerifySchemaV1Json(plain)
8528 return nil
8529 }
8530
8531 type SignatureTestVector struct {
8532
8533 Comment string `json:"comment"`
8534
8535
8536 Flags []string `json:"flags"`
8537
8538
8539 Msg string `json:"msg"`
8540
8541
8542 Result Result `json:"result"`
8543
8544
8545 Sig string `json:"sig"`
8546
8547
8548 TcId int `json:"tcId"`
8549 }
8550
8551
8552 func (j *SignatureTestVector) UnmarshalJSON(value []byte) error {
8553 var raw map[string]interface{}
8554 if err := json.Unmarshal(value, &raw); err != nil {
8555 return err
8556 }
8557 if _, ok := raw["comment"]; raw != nil && !ok {
8558 return fmt.Errorf("field comment in SignatureTestVector: required")
8559 }
8560 if _, ok := raw["flags"]; raw != nil && !ok {
8561 return fmt.Errorf("field flags in SignatureTestVector: required")
8562 }
8563 if _, ok := raw["msg"]; raw != nil && !ok {
8564 return fmt.Errorf("field msg in SignatureTestVector: required")
8565 }
8566 if _, ok := raw["result"]; raw != nil && !ok {
8567 return fmt.Errorf("field result in SignatureTestVector: required")
8568 }
8569 if _, ok := raw["sig"]; raw != nil && !ok {
8570 return fmt.Errorf("field sig in SignatureTestVector: required")
8571 }
8572 if _, ok := raw["tcId"]; raw != nil && !ok {
8573 return fmt.Errorf("field tcId in SignatureTestVector: required")
8574 }
8575 type Plain SignatureTestVector
8576 var plain Plain
8577 if err := json.Unmarshal(value, &plain); err != nil {
8578 return err
8579 }
8580 *j = SignatureTestVector(plain)
8581 return nil
8582 }
8583
8584 type Source struct {
8585
8586 Name string `json:"name"`
8587
8588
8589 Version string `json:"version"`
8590 }
8591
8592
8593 func (j *Source) UnmarshalJSON(value []byte) error {
8594 var raw map[string]interface{}
8595 if err := json.Unmarshal(value, &raw); err != nil {
8596 return err
8597 }
8598 if _, ok := raw["name"]; raw != nil && !ok {
8599 return fmt.Errorf("field name in Source: required")
8600 }
8601 if _, ok := raw["version"]; raw != nil && !ok {
8602 return fmt.Errorf("field version in Source: required")
8603 }
8604 type Plain Source
8605 var plain Plain
8606 if err := json.Unmarshal(value, &plain); err != nil {
8607 return err
8608 }
8609 if utf8.RuneCountInString(string(plain.Name)) < 1 {
8610 return fmt.Errorf("field %s length: must be >= %d", "name", 1)
8611 }
8612 if utf8.RuneCountInString(string(plain.Version)) < 1 {
8613 return fmt.Errorf("field %s length: must be >= %d", "version", 1)
8614 }
8615 *j = Source(plain)
8616 return nil
8617 }
8618
8619 type XdhAsnCompSchemaV1Json struct {
8620
8621 Algorithm string `json:"algorithm"`
8622
8623
8624 GeneratorVersion *string `json:"generatorVersion,omitempty"`
8625
8626
8627 Header []string `json:"header"`
8628
8629
8630 Notes Notes `json:"notes"`
8631
8632
8633 NumberOfTests int `json:"numberOfTests"`
8634
8635
8636 Schema XdhAsnCompSchemaV1JsonSchema `json:"schema"`
8637
8638
8639 TestGroups []XdhAsnTestGroup `json:"testGroups"`
8640 }
8641
8642 type XdhAsnCompSchemaV1JsonSchema string
8643
8644 const XdhAsnCompSchemaV1JsonSchemaXdhAsnCompSchemaV1Json XdhAsnCompSchemaV1JsonSchema = "xdh_asn_comp_schema_v1.json"
8645
8646 var enumValues_XdhAsnCompSchemaV1JsonSchema = []interface{}{
8647 "xdh_asn_comp_schema_v1.json",
8648 }
8649
8650
8651 func (j *XdhAsnCompSchemaV1JsonSchema) 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_XdhAsnCompSchemaV1JsonSchema {
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_XdhAsnCompSchemaV1JsonSchema, v)
8665 }
8666 *j = XdhAsnCompSchemaV1JsonSchema(v)
8667 return nil
8668 }
8669
8670
8671 func (j *XdhAsnCompSchemaV1Json) 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["algorithm"]; raw != nil && !ok {
8677 return fmt.Errorf("field algorithm in XdhAsnCompSchemaV1Json: required")
8678 }
8679 if _, ok := raw["header"]; raw != nil && !ok {
8680 return fmt.Errorf("field header in XdhAsnCompSchemaV1Json: required")
8681 }
8682 if _, ok := raw["notes"]; raw != nil && !ok {
8683 return fmt.Errorf("field notes in XdhAsnCompSchemaV1Json: required")
8684 }
8685 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8686 return fmt.Errorf("field numberOfTests in XdhAsnCompSchemaV1Json: required")
8687 }
8688 if _, ok := raw["schema"]; raw != nil && !ok {
8689 return fmt.Errorf("field schema in XdhAsnCompSchemaV1Json: required")
8690 }
8691 if _, ok := raw["testGroups"]; raw != nil && !ok {
8692 return fmt.Errorf("field testGroups in XdhAsnCompSchemaV1Json: required")
8693 }
8694 type Plain XdhAsnCompSchemaV1Json
8695 var plain Plain
8696 if err := json.Unmarshal(value, &plain); err != nil {
8697 return err
8698 }
8699 *j = XdhAsnCompSchemaV1Json(plain)
8700 return nil
8701 }
8702
8703 type XdhAsnTestGroup struct {
8704
8705 Curve string `json:"curve"`
8706
8707
8708 Source Source `json:"source"`
8709
8710
8711 Tests []XdhAsnTestVector `json:"tests"`
8712
8713
8714 Type XdhAsnTestGroupType `json:"type"`
8715 }
8716
8717 type XdhAsnTestGroupType string
8718
8719 const XdhAsnTestGroupTypeXdhAsnComp XdhAsnTestGroupType = "XdhAsnComp"
8720
8721 var enumValues_XdhAsnTestGroupType = []interface{}{
8722 "XdhAsnComp",
8723 }
8724
8725
8726 func (j *XdhAsnTestGroupType) UnmarshalJSON(value []byte) error {
8727 var v string
8728 if err := json.Unmarshal(value, &v); err != nil {
8729 return err
8730 }
8731 var ok bool
8732 for _, expected := range enumValues_XdhAsnTestGroupType {
8733 if reflect.DeepEqual(v, expected) {
8734 ok = true
8735 break
8736 }
8737 }
8738 if !ok {
8739 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhAsnTestGroupType, v)
8740 }
8741 *j = XdhAsnTestGroupType(v)
8742 return nil
8743 }
8744
8745
8746 func (j *XdhAsnTestGroup) UnmarshalJSON(value []byte) error {
8747 var raw map[string]interface{}
8748 if err := json.Unmarshal(value, &raw); err != nil {
8749 return err
8750 }
8751 if _, ok := raw["curve"]; raw != nil && !ok {
8752 return fmt.Errorf("field curve in XdhAsnTestGroup: required")
8753 }
8754 if _, ok := raw["source"]; raw != nil && !ok {
8755 return fmt.Errorf("field source in XdhAsnTestGroup: required")
8756 }
8757 if _, ok := raw["tests"]; raw != nil && !ok {
8758 return fmt.Errorf("field tests in XdhAsnTestGroup: required")
8759 }
8760 if _, ok := raw["type"]; raw != nil && !ok {
8761 return fmt.Errorf("field type in XdhAsnTestGroup: required")
8762 }
8763 type Plain XdhAsnTestGroup
8764 var plain Plain
8765 if err := json.Unmarshal(value, &plain); err != nil {
8766 return err
8767 }
8768 *j = XdhAsnTestGroup(plain)
8769 return nil
8770 }
8771
8772 type XdhAsnTestVector struct {
8773
8774 Comment string `json:"comment"`
8775
8776
8777 Flags []string `json:"flags"`
8778
8779
8780 Private string `json:"private"`
8781
8782
8783 Public string `json:"public"`
8784
8785
8786 Result Result `json:"result"`
8787
8788
8789 Shared string `json:"shared"`
8790
8791
8792 TcId int `json:"tcId"`
8793 }
8794
8795
8796 func (j *XdhAsnTestVector) UnmarshalJSON(value []byte) error {
8797 var raw map[string]interface{}
8798 if err := json.Unmarshal(value, &raw); err != nil {
8799 return err
8800 }
8801 if _, ok := raw["comment"]; raw != nil && !ok {
8802 return fmt.Errorf("field comment in XdhAsnTestVector: required")
8803 }
8804 if _, ok := raw["flags"]; raw != nil && !ok {
8805 return fmt.Errorf("field flags in XdhAsnTestVector: required")
8806 }
8807 if _, ok := raw["private"]; raw != nil && !ok {
8808 return fmt.Errorf("field private in XdhAsnTestVector: required")
8809 }
8810 if _, ok := raw["public"]; raw != nil && !ok {
8811 return fmt.Errorf("field public in XdhAsnTestVector: required")
8812 }
8813 if _, ok := raw["result"]; raw != nil && !ok {
8814 return fmt.Errorf("field result in XdhAsnTestVector: required")
8815 }
8816 if _, ok := raw["shared"]; raw != nil && !ok {
8817 return fmt.Errorf("field shared in XdhAsnTestVector: required")
8818 }
8819 if _, ok := raw["tcId"]; raw != nil && !ok {
8820 return fmt.Errorf("field tcId in XdhAsnTestVector: required")
8821 }
8822 type Plain XdhAsnTestVector
8823 var plain Plain
8824 if err := json.Unmarshal(value, &plain); err != nil {
8825 return err
8826 }
8827 *j = XdhAsnTestVector(plain)
8828 return nil
8829 }
8830
8831 type XdhCompSchemaV1Json struct {
8832
8833 Algorithm string `json:"algorithm"`
8834
8835
8836 GeneratorVersion *string `json:"generatorVersion,omitempty"`
8837
8838
8839 Header []string `json:"header"`
8840
8841
8842 Notes Notes `json:"notes"`
8843
8844
8845 NumberOfTests int `json:"numberOfTests"`
8846
8847
8848 Schema XdhCompSchemaV1JsonSchema `json:"schema"`
8849
8850
8851 TestGroups []XdhTestGroup `json:"testGroups"`
8852 }
8853
8854 type XdhCompSchemaV1JsonSchema string
8855
8856 const XdhCompSchemaV1JsonSchemaXdhCompSchemaV1Json XdhCompSchemaV1JsonSchema = "xdh_comp_schema_v1.json"
8857
8858 var enumValues_XdhCompSchemaV1JsonSchema = []interface{}{
8859 "xdh_comp_schema_v1.json",
8860 }
8861
8862
8863 func (j *XdhCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8864 var v string
8865 if err := json.Unmarshal(value, &v); err != nil {
8866 return err
8867 }
8868 var ok bool
8869 for _, expected := range enumValues_XdhCompSchemaV1JsonSchema {
8870 if reflect.DeepEqual(v, expected) {
8871 ok = true
8872 break
8873 }
8874 }
8875 if !ok {
8876 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhCompSchemaV1JsonSchema, v)
8877 }
8878 *j = XdhCompSchemaV1JsonSchema(v)
8879 return nil
8880 }
8881
8882
8883 func (j *XdhCompSchemaV1Json) UnmarshalJSON(value []byte) error {
8884 var raw map[string]interface{}
8885 if err := json.Unmarshal(value, &raw); err != nil {
8886 return err
8887 }
8888 if _, ok := raw["algorithm"]; raw != nil && !ok {
8889 return fmt.Errorf("field algorithm in XdhCompSchemaV1Json: required")
8890 }
8891 if _, ok := raw["header"]; raw != nil && !ok {
8892 return fmt.Errorf("field header in XdhCompSchemaV1Json: required")
8893 }
8894 if _, ok := raw["notes"]; raw != nil && !ok {
8895 return fmt.Errorf("field notes in XdhCompSchemaV1Json: required")
8896 }
8897 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8898 return fmt.Errorf("field numberOfTests in XdhCompSchemaV1Json: required")
8899 }
8900 if _, ok := raw["schema"]; raw != nil && !ok {
8901 return fmt.Errorf("field schema in XdhCompSchemaV1Json: required")
8902 }
8903 if _, ok := raw["testGroups"]; raw != nil && !ok {
8904 return fmt.Errorf("field testGroups in XdhCompSchemaV1Json: required")
8905 }
8906 type Plain XdhCompSchemaV1Json
8907 var plain Plain
8908 if err := json.Unmarshal(value, &plain); err != nil {
8909 return err
8910 }
8911 *j = XdhCompSchemaV1Json(plain)
8912 return nil
8913 }
8914
8915 type XdhJwkCompSchemaV1Json struct {
8916
8917 Algorithm string `json:"algorithm"`
8918
8919
8920 GeneratorVersion *string `json:"generatorVersion,omitempty"`
8921
8922
8923 Header []string `json:"header"`
8924
8925
8926 Notes Notes `json:"notes"`
8927
8928
8929 NumberOfTests int `json:"numberOfTests"`
8930
8931
8932 Schema XdhJwkCompSchemaV1JsonSchema `json:"schema"`
8933
8934
8935 TestGroups []XdhJwkTestGroup `json:"testGroups"`
8936 }
8937
8938 type XdhJwkCompSchemaV1JsonSchema string
8939
8940 const XdhJwkCompSchemaV1JsonSchemaXdhJwkCompSchemaV1Json XdhJwkCompSchemaV1JsonSchema = "xdh_jwk_comp_schema_v1.json"
8941
8942 var enumValues_XdhJwkCompSchemaV1JsonSchema = []interface{}{
8943 "xdh_jwk_comp_schema_v1.json",
8944 }
8945
8946
8947 func (j *XdhJwkCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
8948 var v string
8949 if err := json.Unmarshal(value, &v); err != nil {
8950 return err
8951 }
8952 var ok bool
8953 for _, expected := range enumValues_XdhJwkCompSchemaV1JsonSchema {
8954 if reflect.DeepEqual(v, expected) {
8955 ok = true
8956 break
8957 }
8958 }
8959 if !ok {
8960 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhJwkCompSchemaV1JsonSchema, v)
8961 }
8962 *j = XdhJwkCompSchemaV1JsonSchema(v)
8963 return nil
8964 }
8965
8966
8967 func (j *XdhJwkCompSchemaV1Json) UnmarshalJSON(value []byte) error {
8968 var raw map[string]interface{}
8969 if err := json.Unmarshal(value, &raw); err != nil {
8970 return err
8971 }
8972 if _, ok := raw["algorithm"]; raw != nil && !ok {
8973 return fmt.Errorf("field algorithm in XdhJwkCompSchemaV1Json: required")
8974 }
8975 if _, ok := raw["header"]; raw != nil && !ok {
8976 return fmt.Errorf("field header in XdhJwkCompSchemaV1Json: required")
8977 }
8978 if _, ok := raw["notes"]; raw != nil && !ok {
8979 return fmt.Errorf("field notes in XdhJwkCompSchemaV1Json: required")
8980 }
8981 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
8982 return fmt.Errorf("field numberOfTests in XdhJwkCompSchemaV1Json: required")
8983 }
8984 if _, ok := raw["schema"]; raw != nil && !ok {
8985 return fmt.Errorf("field schema in XdhJwkCompSchemaV1Json: required")
8986 }
8987 if _, ok := raw["testGroups"]; raw != nil && !ok {
8988 return fmt.Errorf("field testGroups in XdhJwkCompSchemaV1Json: required")
8989 }
8990 type Plain XdhJwkCompSchemaV1Json
8991 var plain Plain
8992 if err := json.Unmarshal(value, &plain); err != nil {
8993 return err
8994 }
8995 *j = XdhJwkCompSchemaV1Json(plain)
8996 return nil
8997 }
8998
8999 type XdhJwkTestGroup struct {
9000
9001 Curve string `json:"curve"`
9002
9003
9004 Source Source `json:"source"`
9005
9006
9007 Tests []XdhJwkTestVector `json:"tests"`
9008
9009
9010 Type XdhJwkTestGroupType `json:"type"`
9011 }
9012
9013 type XdhJwkTestGroupType string
9014
9015 const XdhJwkTestGroupTypeXdhJwkComp XdhJwkTestGroupType = "XdhJwkComp"
9016
9017 var enumValues_XdhJwkTestGroupType = []interface{}{
9018 "XdhJwkComp",
9019 }
9020
9021
9022 func (j *XdhJwkTestGroupType) UnmarshalJSON(value []byte) error {
9023 var v string
9024 if err := json.Unmarshal(value, &v); err != nil {
9025 return err
9026 }
9027 var ok bool
9028 for _, expected := range enumValues_XdhJwkTestGroupType {
9029 if reflect.DeepEqual(v, expected) {
9030 ok = true
9031 break
9032 }
9033 }
9034 if !ok {
9035 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhJwkTestGroupType, v)
9036 }
9037 *j = XdhJwkTestGroupType(v)
9038 return nil
9039 }
9040
9041
9042 func (j *XdhJwkTestGroup) UnmarshalJSON(value []byte) error {
9043 var raw map[string]interface{}
9044 if err := json.Unmarshal(value, &raw); err != nil {
9045 return err
9046 }
9047 if _, ok := raw["curve"]; raw != nil && !ok {
9048 return fmt.Errorf("field curve in XdhJwkTestGroup: required")
9049 }
9050 if _, ok := raw["source"]; raw != nil && !ok {
9051 return fmt.Errorf("field source in XdhJwkTestGroup: required")
9052 }
9053 if _, ok := raw["tests"]; raw != nil && !ok {
9054 return fmt.Errorf("field tests in XdhJwkTestGroup: required")
9055 }
9056 if _, ok := raw["type"]; raw != nil && !ok {
9057 return fmt.Errorf("field type in XdhJwkTestGroup: required")
9058 }
9059 type Plain XdhJwkTestGroup
9060 var plain Plain
9061 if err := json.Unmarshal(value, &plain); err != nil {
9062 return err
9063 }
9064 *j = XdhJwkTestGroup(plain)
9065 return nil
9066 }
9067
9068 type XdhJwkTestVector struct {
9069
9070 Comment string `json:"comment"`
9071
9072
9073 Flags []string `json:"flags"`
9074
9075
9076 Private JsonWebKey `json:"private"`
9077
9078
9079 Public JsonWebKey `json:"public"`
9080
9081
9082 Result Result `json:"result"`
9083
9084
9085 Shared string `json:"shared"`
9086
9087
9088 TcId int `json:"tcId"`
9089 }
9090
9091
9092 func (j *XdhJwkTestVector) UnmarshalJSON(value []byte) error {
9093 var raw map[string]interface{}
9094 if err := json.Unmarshal(value, &raw); err != nil {
9095 return err
9096 }
9097 if _, ok := raw["comment"]; raw != nil && !ok {
9098 return fmt.Errorf("field comment in XdhJwkTestVector: required")
9099 }
9100 if _, ok := raw["flags"]; raw != nil && !ok {
9101 return fmt.Errorf("field flags in XdhJwkTestVector: required")
9102 }
9103 if _, ok := raw["private"]; raw != nil && !ok {
9104 return fmt.Errorf("field private in XdhJwkTestVector: required")
9105 }
9106 if _, ok := raw["public"]; raw != nil && !ok {
9107 return fmt.Errorf("field public in XdhJwkTestVector: required")
9108 }
9109 if _, ok := raw["result"]; raw != nil && !ok {
9110 return fmt.Errorf("field result in XdhJwkTestVector: required")
9111 }
9112 if _, ok := raw["shared"]; raw != nil && !ok {
9113 return fmt.Errorf("field shared in XdhJwkTestVector: required")
9114 }
9115 if _, ok := raw["tcId"]; raw != nil && !ok {
9116 return fmt.Errorf("field tcId in XdhJwkTestVector: required")
9117 }
9118 type Plain XdhJwkTestVector
9119 var plain Plain
9120 if err := json.Unmarshal(value, &plain); err != nil {
9121 return err
9122 }
9123 *j = XdhJwkTestVector(plain)
9124 return nil
9125 }
9126
9127 type XdhPemCompSchemaV1Json struct {
9128
9129 Algorithm string `json:"algorithm"`
9130
9131
9132 GeneratorVersion *string `json:"generatorVersion,omitempty"`
9133
9134
9135 Header []string `json:"header"`
9136
9137
9138 Notes Notes `json:"notes"`
9139
9140
9141 NumberOfTests int `json:"numberOfTests"`
9142
9143
9144 Schema XdhPemCompSchemaV1JsonSchema `json:"schema"`
9145
9146
9147 TestGroups []XdhPemTestGroup `json:"testGroups"`
9148 }
9149
9150 type XdhPemCompSchemaV1JsonSchema string
9151
9152 const XdhPemCompSchemaV1JsonSchemaXdhPemCompSchemaV1Json XdhPemCompSchemaV1JsonSchema = "xdh_pem_comp_schema_v1.json"
9153
9154 var enumValues_XdhPemCompSchemaV1JsonSchema = []interface{}{
9155 "xdh_pem_comp_schema_v1.json",
9156 }
9157
9158
9159 func (j *XdhPemCompSchemaV1JsonSchema) UnmarshalJSON(value []byte) error {
9160 var v string
9161 if err := json.Unmarshal(value, &v); err != nil {
9162 return err
9163 }
9164 var ok bool
9165 for _, expected := range enumValues_XdhPemCompSchemaV1JsonSchema {
9166 if reflect.DeepEqual(v, expected) {
9167 ok = true
9168 break
9169 }
9170 }
9171 if !ok {
9172 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhPemCompSchemaV1JsonSchema, v)
9173 }
9174 *j = XdhPemCompSchemaV1JsonSchema(v)
9175 return nil
9176 }
9177
9178
9179 func (j *XdhPemCompSchemaV1Json) UnmarshalJSON(value []byte) error {
9180 var raw map[string]interface{}
9181 if err := json.Unmarshal(value, &raw); err != nil {
9182 return err
9183 }
9184 if _, ok := raw["algorithm"]; raw != nil && !ok {
9185 return fmt.Errorf("field algorithm in XdhPemCompSchemaV1Json: required")
9186 }
9187 if _, ok := raw["header"]; raw != nil && !ok {
9188 return fmt.Errorf("field header in XdhPemCompSchemaV1Json: required")
9189 }
9190 if _, ok := raw["notes"]; raw != nil && !ok {
9191 return fmt.Errorf("field notes in XdhPemCompSchemaV1Json: required")
9192 }
9193 if _, ok := raw["numberOfTests"]; raw != nil && !ok {
9194 return fmt.Errorf("field numberOfTests in XdhPemCompSchemaV1Json: required")
9195 }
9196 if _, ok := raw["schema"]; raw != nil && !ok {
9197 return fmt.Errorf("field schema in XdhPemCompSchemaV1Json: required")
9198 }
9199 if _, ok := raw["testGroups"]; raw != nil && !ok {
9200 return fmt.Errorf("field testGroups in XdhPemCompSchemaV1Json: required")
9201 }
9202 type Plain XdhPemCompSchemaV1Json
9203 var plain Plain
9204 if err := json.Unmarshal(value, &plain); err != nil {
9205 return err
9206 }
9207 *j = XdhPemCompSchemaV1Json(plain)
9208 return nil
9209 }
9210
9211 type XdhPemTestGroup struct {
9212
9213 Curve string `json:"curve"`
9214
9215
9216 Source Source `json:"source"`
9217
9218
9219 Tests []XdhPemTestVector `json:"tests"`
9220
9221
9222 Type XdhPemTestGroupType `json:"type"`
9223 }
9224
9225 type XdhPemTestGroupType string
9226
9227 const XdhPemTestGroupTypeXdhPemComp XdhPemTestGroupType = "XdhPemComp"
9228
9229 var enumValues_XdhPemTestGroupType = []interface{}{
9230 "XdhPemComp",
9231 }
9232
9233
9234 func (j *XdhPemTestGroupType) UnmarshalJSON(value []byte) error {
9235 var v string
9236 if err := json.Unmarshal(value, &v); err != nil {
9237 return err
9238 }
9239 var ok bool
9240 for _, expected := range enumValues_XdhPemTestGroupType {
9241 if reflect.DeepEqual(v, expected) {
9242 ok = true
9243 break
9244 }
9245 }
9246 if !ok {
9247 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhPemTestGroupType, v)
9248 }
9249 *j = XdhPemTestGroupType(v)
9250 return nil
9251 }
9252
9253
9254 func (j *XdhPemTestGroup) UnmarshalJSON(value []byte) error {
9255 var raw map[string]interface{}
9256 if err := json.Unmarshal(value, &raw); err != nil {
9257 return err
9258 }
9259 if _, ok := raw["curve"]; raw != nil && !ok {
9260 return fmt.Errorf("field curve in XdhPemTestGroup: required")
9261 }
9262 if _, ok := raw["source"]; raw != nil && !ok {
9263 return fmt.Errorf("field source in XdhPemTestGroup: required")
9264 }
9265 if _, ok := raw["tests"]; raw != nil && !ok {
9266 return fmt.Errorf("field tests in XdhPemTestGroup: required")
9267 }
9268 if _, ok := raw["type"]; raw != nil && !ok {
9269 return fmt.Errorf("field type in XdhPemTestGroup: required")
9270 }
9271 type Plain XdhPemTestGroup
9272 var plain Plain
9273 if err := json.Unmarshal(value, &plain); err != nil {
9274 return err
9275 }
9276 *j = XdhPemTestGroup(plain)
9277 return nil
9278 }
9279
9280 type XdhPemTestVector struct {
9281
9282 Comment string `json:"comment"`
9283
9284
9285 Flags []string `json:"flags"`
9286
9287
9288 Private string `json:"private"`
9289
9290
9291 Public string `json:"public"`
9292
9293
9294 Result Result `json:"result"`
9295
9296
9297 Shared string `json:"shared"`
9298
9299
9300 TcId int `json:"tcId"`
9301 }
9302
9303
9304 func (j *XdhPemTestVector) UnmarshalJSON(value []byte) error {
9305 var raw map[string]interface{}
9306 if err := json.Unmarshal(value, &raw); err != nil {
9307 return err
9308 }
9309 if _, ok := raw["comment"]; raw != nil && !ok {
9310 return fmt.Errorf("field comment in XdhPemTestVector: required")
9311 }
9312 if _, ok := raw["flags"]; raw != nil && !ok {
9313 return fmt.Errorf("field flags in XdhPemTestVector: required")
9314 }
9315 if _, ok := raw["private"]; raw != nil && !ok {
9316 return fmt.Errorf("field private in XdhPemTestVector: required")
9317 }
9318 if _, ok := raw["public"]; raw != nil && !ok {
9319 return fmt.Errorf("field public in XdhPemTestVector: required")
9320 }
9321 if _, ok := raw["result"]; raw != nil && !ok {
9322 return fmt.Errorf("field result in XdhPemTestVector: required")
9323 }
9324 if _, ok := raw["shared"]; raw != nil && !ok {
9325 return fmt.Errorf("field shared in XdhPemTestVector: required")
9326 }
9327 if _, ok := raw["tcId"]; raw != nil && !ok {
9328 return fmt.Errorf("field tcId in XdhPemTestVector: required")
9329 }
9330 type Plain XdhPemTestVector
9331 var plain Plain
9332 if err := json.Unmarshal(value, &plain); err != nil {
9333 return err
9334 }
9335 *j = XdhPemTestVector(plain)
9336 return nil
9337 }
9338
9339 type XdhTestGroup struct {
9340
9341 Curve string `json:"curve"`
9342
9343
9344 Source Source `json:"source"`
9345
9346
9347 Tests []XdhTestVector `json:"tests"`
9348
9349
9350 Type XdhTestGroupType `json:"type"`
9351 }
9352
9353 type XdhTestGroupType string
9354
9355 const XdhTestGroupTypeXdhComp XdhTestGroupType = "XdhComp"
9356
9357 var enumValues_XdhTestGroupType = []interface{}{
9358 "XdhComp",
9359 }
9360
9361
9362 func (j *XdhTestGroupType) UnmarshalJSON(value []byte) error {
9363 var v string
9364 if err := json.Unmarshal(value, &v); err != nil {
9365 return err
9366 }
9367 var ok bool
9368 for _, expected := range enumValues_XdhTestGroupType {
9369 if reflect.DeepEqual(v, expected) {
9370 ok = true
9371 break
9372 }
9373 }
9374 if !ok {
9375 return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_XdhTestGroupType, v)
9376 }
9377 *j = XdhTestGroupType(v)
9378 return nil
9379 }
9380
9381
9382 func (j *XdhTestGroup) UnmarshalJSON(value []byte) error {
9383 var raw map[string]interface{}
9384 if err := json.Unmarshal(value, &raw); err != nil {
9385 return err
9386 }
9387 if _, ok := raw["curve"]; raw != nil && !ok {
9388 return fmt.Errorf("field curve in XdhTestGroup: required")
9389 }
9390 if _, ok := raw["source"]; raw != nil && !ok {
9391 return fmt.Errorf("field source in XdhTestGroup: required")
9392 }
9393 if _, ok := raw["tests"]; raw != nil && !ok {
9394 return fmt.Errorf("field tests in XdhTestGroup: required")
9395 }
9396 if _, ok := raw["type"]; raw != nil && !ok {
9397 return fmt.Errorf("field type in XdhTestGroup: required")
9398 }
9399 type Plain XdhTestGroup
9400 var plain Plain
9401 if err := json.Unmarshal(value, &plain); err != nil {
9402 return err
9403 }
9404 *j = XdhTestGroup(plain)
9405 return nil
9406 }
9407
9408 type XdhTestVector struct {
9409
9410 Comment string `json:"comment"`
9411
9412
9413 Flags []string `json:"flags"`
9414
9415
9416 Private string `json:"private"`
9417
9418
9419 Public string `json:"public"`
9420
9421
9422 Result Result `json:"result"`
9423
9424
9425 Shared string `json:"shared"`
9426
9427
9428 TcId int `json:"tcId"`
9429 }
9430
9431
9432 func (j *XdhTestVector) UnmarshalJSON(value []byte) error {
9433 var raw map[string]interface{}
9434 if err := json.Unmarshal(value, &raw); err != nil {
9435 return err
9436 }
9437 if _, ok := raw["comment"]; raw != nil && !ok {
9438 return fmt.Errorf("field comment in XdhTestVector: required")
9439 }
9440 if _, ok := raw["flags"]; raw != nil && !ok {
9441 return fmt.Errorf("field flags in XdhTestVector: required")
9442 }
9443 if _, ok := raw["private"]; raw != nil && !ok {
9444 return fmt.Errorf("field private in XdhTestVector: required")
9445 }
9446 if _, ok := raw["public"]; raw != nil && !ok {
9447 return fmt.Errorf("field public in XdhTestVector: required")
9448 }
9449 if _, ok := raw["result"]; raw != nil && !ok {
9450 return fmt.Errorf("field result in XdhTestVector: required")
9451 }
9452 if _, ok := raw["shared"]; raw != nil && !ok {
9453 return fmt.Errorf("field shared in XdhTestVector: required")
9454 }
9455 if _, ok := raw["tcId"]; raw != nil && !ok {
9456 return fmt.Errorf("field tcId in XdhTestVector: required")
9457 }
9458 type Plain XdhTestVector
9459 var plain Plain
9460 if err := json.Unmarshal(value, &plain); err != nil {
9461 return err
9462 }
9463 *j = XdhTestVector(plain)
9464 return nil
9465 }
9466
View as plain text