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