forked from SciresM/hactool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpki.c
1156 lines (1122 loc) · 59.8 KB
/
pki.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <stdio.h>
#include <string.h>
#include "aes.h"
#include "pki.h"
/* Keydata for very early beta NCA0 archives' RSA-OAEP. */
static const unsigned char beta_nca0_modulus[0x100] = {
0xAD, 0x58, 0xEE, 0x97, 0xF9, 0x47, 0x90, 0x7D, 0xF9, 0x29, 0x5F, 0x1F, 0x39, 0x68, 0xEE, 0x49,
0x4C, 0x1E, 0x8D, 0x84, 0x91, 0x31, 0x5D, 0xE5, 0x96, 0x27, 0xB2, 0xB3, 0x59, 0x7B, 0xDE, 0xFD,
0xB7, 0xEB, 0x40, 0xA1, 0xE7, 0xEB, 0xDC, 0x60, 0xD0, 0x3D, 0xC5, 0x50, 0x92, 0xAD, 0x3D, 0xC4,
0x8C, 0x17, 0xD2, 0x37, 0x66, 0xE3, 0xF7, 0x14, 0x34, 0x38, 0x6B, 0xA7, 0x2B, 0x21, 0x10, 0x9B,
0x73, 0x49, 0x15, 0xD9, 0x2A, 0x90, 0x86, 0x76, 0x81, 0x6A, 0x10, 0xBD, 0x74, 0xC4, 0x20, 0x55,
0x25, 0xA8, 0x02, 0xC5, 0xA0, 0x34, 0x36, 0x7B, 0x66, 0x47, 0x2C, 0x7E, 0x47, 0x82, 0xA5, 0xD4,
0xA3, 0x42, 0x45, 0xE8, 0xFD, 0x65, 0x72, 0x48, 0xA1, 0xB0, 0x44, 0x10, 0xEF, 0xAC, 0x1D, 0x0F,
0xB5, 0x12, 0x19, 0xA8, 0x41, 0x0B, 0x76, 0x3B, 0xBC, 0xF1, 0x4A, 0x10, 0x46, 0x22, 0xB8, 0xF1,
0xBC, 0x21, 0x81, 0x69, 0x9B, 0x63, 0x6F, 0xD7, 0xB9, 0x60, 0x2A, 0x9A, 0xE5, 0x2C, 0x47, 0x72,
0x59, 0x65, 0xA2, 0x21, 0x60, 0xC4, 0xFC, 0xB0, 0xD7, 0x6F, 0x42, 0xC9, 0x0C, 0xF5, 0x76, 0x7D,
0xF2, 0x5C, 0xE0, 0x80, 0x0F, 0xEE, 0x45, 0x7E, 0x4E, 0x3A, 0x8D, 0x9C, 0x5B, 0x5B, 0xD9, 0xD1,
0x43, 0x94, 0x2C, 0xC7, 0x2E, 0xB9, 0x4A, 0xE5, 0x3E, 0x15, 0xDD, 0x43, 0x00, 0xF7, 0x78, 0xE7,
0x7C, 0x39, 0xB0, 0x4D, 0xC5, 0xD1, 0x1C, 0xF2, 0xB4, 0x7A, 0x2A, 0xEA, 0x0A, 0x8E, 0xB9, 0x13,
0xB4, 0x4F, 0xD7, 0x5B, 0x4D, 0x7B, 0x43, 0xB0, 0x3A, 0x9A, 0x60, 0x22, 0x47, 0x91, 0x78, 0xC7,
0x10, 0x64, 0xE0, 0x2C, 0x69, 0xD1, 0x66, 0x3C, 0x42, 0x2E, 0xEF, 0x19, 0x21, 0x89, 0x8E, 0xE1,
0xB0, 0xB4, 0xD0, 0x17, 0xA1, 0x0F, 0x73, 0x98, 0x5A, 0xF6, 0xEE, 0xC0, 0x2F, 0x9E, 0xCE, 0xC5
};
static unsigned char beta_nca0_exponent[0x100] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
};
static const unsigned char beta_nca0_label_hash[0x20] = {
0xE3, 0xB0, 0xC4, 0x42, 0x98, 0xFC, 0x1C, 0x14, 0x9A, 0xFB, 0xF4, 0xC8, 0x99, 0x6F, 0xB9, 0x24,
0x27, 0xAE, 0x41, 0xE4, 0x64, 0x9B, 0x93, 0x4C, 0xA4, 0x95, 0x99, 0x1B, 0x78, 0x52, 0xB8, 0x55
};
const unsigned char *pki_get_beta_nca0_modulus(void) {
return beta_nca0_modulus;
}
void pki_set_beta_nca0_exponent(void *exponent) {
memcpy(beta_nca0_exponent, exponent, sizeof(beta_nca0_exponent));
}
const unsigned char *pki_get_beta_nca0_exponent(void) {
return beta_nca0_exponent;
}
const unsigned char *pki_get_beta_nca0_label_hash(void) {
return beta_nca0_label_hash;
}
static const nca_keyset_t nca_keys_retail = {
ZEROES_KEY, /* Secure Boot Key (CONSOLE UNIQUE) */
ZEROES_KEY, /* TSEC Key (CONSOLE UNIQUE) */
{
ZEROES_KEY, /* Keyblob Key 00 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 01 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 02 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 03 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 04 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 05 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 06 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 07 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 08 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 09 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 10 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 11 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 12 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 13 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 14 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 15 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 16 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 17 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 18 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 19 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 20 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 21 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 22 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 23 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 24 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 25 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 26 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 27 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 28 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 29 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 30 (CONSOLE UNIQUE) */
ZEROES_KEY /* Keyblob Key 31 (CONSOLE UNIQUE) */
},
{
ZEROES_KEY, /* Keyblob Mac Key 00 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 01 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 02 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 03 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 04 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 05 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 06 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 07 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 08 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 09 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 10 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 11 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 12 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 13 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 14 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 15 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 16 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 17 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 18 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 19 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 20 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 21 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 22 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 23 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 24 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 25 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 26 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 27 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 28 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 29 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 30 (CONSOLE UNIQUE) */
ZEROES_KEY /* Keyblob Mac Key 31 (CONSOLE UNIQUE) */
},
{
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 00 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 01 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 02 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 03 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 04 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 05 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 06 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 07 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 08 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 09 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 10 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 11 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 12 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 13 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 14 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 15 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 16 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 17 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 18 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 19 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 20 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 21 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 22 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 23 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 24 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 25 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 26 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 27 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 28 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 29 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 30 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB /* Encrypted Keyblob 31 (CONSOLE UNIQUE) */
},
{
ZEROES_KEYBLOB, /* Keyblob 00 */
ZEROES_KEYBLOB, /* Keyblob 01 */
ZEROES_KEYBLOB, /* Keyblob 02 */
ZEROES_KEYBLOB, /* Keyblob 03 */
ZEROES_KEYBLOB, /* Keyblob 04 */
ZEROES_KEYBLOB, /* Keyblob 05 */
ZEROES_KEYBLOB, /* Keyblob 06 */
ZEROES_KEYBLOB, /* Keyblob 07 */
ZEROES_KEYBLOB, /* Keyblob 08 */
ZEROES_KEYBLOB, /* Keyblob 09 */
ZEROES_KEYBLOB, /* Keyblob 10 */
ZEROES_KEYBLOB, /* Keyblob 11 */
ZEROES_KEYBLOB, /* Keyblob 12 */
ZEROES_KEYBLOB, /* Keyblob 13 */
ZEROES_KEYBLOB, /* Keyblob 14 */
ZEROES_KEYBLOB, /* Keyblob 15 */
ZEROES_KEYBLOB, /* Keyblob 16 */
ZEROES_KEYBLOB, /* Keyblob 17 */
ZEROES_KEYBLOB, /* Keyblob 18 */
ZEROES_KEYBLOB, /* Keyblob 19 */
ZEROES_KEYBLOB, /* Keyblob 20 */
ZEROES_KEYBLOB, /* Keyblob 21 */
ZEROES_KEYBLOB, /* Keyblob 22 */
ZEROES_KEYBLOB, /* Keyblob 23 */
ZEROES_KEYBLOB, /* Keyblob 24 */
ZEROES_KEYBLOB, /* Keyblob 25 */
ZEROES_KEYBLOB, /* Keyblob 26 */
ZEROES_KEYBLOB, /* Keyblob 27 */
ZEROES_KEYBLOB, /* Keyblob 28 */
ZEROES_KEYBLOB, /* Keyblob 29 */
ZEROES_KEYBLOB, /* Keyblob 30 */
ZEROES_KEYBLOB /* Keyblob 31 */
},
{
ZEROES_KEY, /* Keyblob Key Source 00 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 01 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 02 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 03 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 04 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 05 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 06 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 07 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 08 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 09 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 10 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 11 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 12 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 13 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 14 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 15 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 16 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 17 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 18 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 19 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 20 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 21 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 22 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 23 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 24 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 25 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 26 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 27 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 28 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 29 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 30 (CONSOLE UNIQUE) */
ZEROES_KEY /* Keyblob Key Source 31 (CONSOLE UNIQUE) */
},
ZEROES_KEY, /* Keyblob Mac Key Source */
ZEROES_KEY, /* Master Key Source */
{
ZEROES_KEY, /* Master Key 00 */
ZEROES_KEY, /* Master Key 01 */
ZEROES_KEY, /* Master Key 02 */
ZEROES_KEY, /* Master Key 03 */
ZEROES_KEY, /* Master Key 04 */
ZEROES_KEY, /* Master Key 05 */
ZEROES_KEY, /* Master Key 06 */
ZEROES_KEY, /* Master Key 07 */
ZEROES_KEY, /* Master Key 08 */
ZEROES_KEY, /* Master Key 09 */
ZEROES_KEY, /* Master Key 10 */
ZEROES_KEY, /* Master Key 11 */
ZEROES_KEY, /* Master Key 12 */
ZEROES_KEY, /* Master Key 13 */
ZEROES_KEY, /* Master Key 14 */
ZEROES_KEY, /* Master Key 15 */
ZEROES_KEY, /* Master Key 16 */
ZEROES_KEY, /* Master Key 17 */
ZEROES_KEY, /* Master Key 18 */
ZEROES_KEY, /* Master Key 19 */
ZEROES_KEY, /* Master Key 20 */
ZEROES_KEY, /* Master Key 21 */
ZEROES_KEY, /* Master Key 22 */
ZEROES_KEY, /* Master Key 23 */
ZEROES_KEY, /* Master Key 24 */
ZEROES_KEY, /* Master Key 25 */
ZEROES_KEY, /* Master Key 26 */
ZEROES_KEY, /* Master Key 27 */
ZEROES_KEY, /* Master Key 28 */
ZEROES_KEY, /* Master Key 29 */
ZEROES_KEY, /* Master Key 30 */
ZEROES_KEY /* Master Key 31 */
},
{
ZEROES_KEY, /* Package1 Key 00 */
ZEROES_KEY, /* Package1 Key 01 */
ZEROES_KEY, /* Package1 Key 02 */
ZEROES_KEY, /* Package1 Key 03 */
ZEROES_KEY, /* Package1 Key 04 */
ZEROES_KEY, /* Package1 Key 05 */
ZEROES_KEY, /* Package1 Key 06 */
ZEROES_KEY, /* Package1 Key 07 */
ZEROES_KEY, /* Package1 Key 08 */
ZEROES_KEY, /* Package1 Key 09 */
ZEROES_KEY, /* Package1 Key 10 */
ZEROES_KEY, /* Package1 Key 11 */
ZEROES_KEY, /* Package1 Key 12 */
ZEROES_KEY, /* Package1 Key 13 */
ZEROES_KEY, /* Package1 Key 14 */
ZEROES_KEY, /* Package1 Key 15 */
ZEROES_KEY, /* Package1 Key 16 */
ZEROES_KEY, /* Package1 Key 17 */
ZEROES_KEY, /* Package1 Key 18 */
ZEROES_KEY, /* Package1 Key 19 */
ZEROES_KEY, /* Package1 Key 20 */
ZEROES_KEY, /* Package1 Key 21 */
ZEROES_KEY, /* Package1 Key 22 */
ZEROES_KEY, /* Package1 Key 23 */
ZEROES_KEY, /* Package1 Key 24 */
ZEROES_KEY, /* Package1 Key 25 */
ZEROES_KEY, /* Package1 Key 26 */
ZEROES_KEY, /* Package1 Key 27 */
ZEROES_KEY, /* Package1 Key 28 */
ZEROES_KEY, /* Package1 Key 29 */
ZEROES_KEY, /* Package1 Key 30 */
ZEROES_KEY /* Package1 Key 31 */
},
{
ZEROES_KEY, /* Package2 Key 00 */
ZEROES_KEY, /* Package2 Key 01 */
ZEROES_KEY, /* Package2 Key 02 */
ZEROES_KEY, /* Package2 Key 03 */
ZEROES_KEY, /* Package2 Key 04 */
ZEROES_KEY, /* Package2 Key 05 */
ZEROES_KEY, /* Package2 Key 06 */
ZEROES_KEY, /* Package2 Key 07 */
ZEROES_KEY, /* Package2 Key 08 */
ZEROES_KEY, /* Package2 Key 09 */
ZEROES_KEY, /* Package2 Key 10 */
ZEROES_KEY, /* Package2 Key 11 */
ZEROES_KEY, /* Package2 Key 12 */
ZEROES_KEY, /* Package2 Key 13 */
ZEROES_KEY, /* Package2 Key 14 */
ZEROES_KEY, /* Package2 Key 15 */
ZEROES_KEY, /* Package2 Key 16 */
ZEROES_KEY, /* Package2 Key 17 */
ZEROES_KEY, /* Package2 Key 18 */
ZEROES_KEY, /* Package2 Key 19 */
ZEROES_KEY, /* Package2 Key 20 */
ZEROES_KEY, /* Package2 Key 21 */
ZEROES_KEY, /* Package2 Key 22 */
ZEROES_KEY, /* Package2 Key 23 */
ZEROES_KEY, /* Package2 Key 24 */
ZEROES_KEY, /* Package2 Key 25 */
ZEROES_KEY, /* Package2 Key 26 */
ZEROES_KEY, /* Package2 Key 27 */
ZEROES_KEY, /* Package2 Key 28 */
ZEROES_KEY, /* Package2 Key 29 */
ZEROES_KEY, /* Package2 Key 30 */
ZEROES_KEY /* Package2 Key 31 */
},
ZEROES_KEY, /* Package2 Key Source */
ZEROES_KEY, /* Generate Aes Kek Source */
ZEROES_KEY, /* Generate Aes Key Source */
ZEROES_KEY, /* Key Area Encryption Key Source Application */
ZEROES_KEY, /* Key Area Encryption Key Source Ocean */
ZEROES_KEY, /* Key Area Encryption Key Source System */
ZEROES_KEY, /* Titlekek Source */
ZEROES_KEY, /* Headerkek Source */
ZEROES_KEY, /* SD Card kek Source. */
{
ZEROES_XTS_KEY, /* SD Card Key Source, for NCAs. */
ZEROES_XTS_KEY, /* SD Card Key Source, for saves. */
},
ZEROES_XTS_KEY, /* Encrypted Header Key */
ZEROES_XTS_KEY, /* Header key */
{
ZEROES_KEY, /* Titlekek 00 */
ZEROES_KEY, /* Titlekek 01 */
ZEROES_KEY, /* Titlekek 02 */
ZEROES_KEY, /* Titlekek 03 */
ZEROES_KEY, /* Titlekek 04 */
ZEROES_KEY, /* Titlekek 05 */
ZEROES_KEY, /* Titlekek 06 */
ZEROES_KEY, /* Titlekek 07 */
ZEROES_KEY, /* Titlekek 08 */
ZEROES_KEY, /* Titlekek 09 */
ZEROES_KEY, /* Titlekek 10 */
ZEROES_KEY, /* Titlekek 11 */
ZEROES_KEY, /* Titlekek 12 */
ZEROES_KEY, /* Titlekek 13 */
ZEROES_KEY, /* Titlekek 14 */
ZEROES_KEY, /* Titlekek 15 */
ZEROES_KEY, /* Titlekek 16 */
ZEROES_KEY, /* Titlekek 17 */
ZEROES_KEY, /* Titlekek 18 */
ZEROES_KEY, /* Titlekek 19 */
ZEROES_KEY, /* Titlekek 20 */
ZEROES_KEY, /* Titlekek 21 */
ZEROES_KEY, /* Titlekek 22 */
ZEROES_KEY, /* Titlekek 23 */
ZEROES_KEY, /* Titlekek 24 */
ZEROES_KEY, /* Titlekek 25 */
ZEROES_KEY, /* Titlekek 26 */
ZEROES_KEY, /* Titlekek 27 */
ZEROES_KEY, /* Titlekek 28 */
ZEROES_KEY, /* Titlekek 29 */
ZEROES_KEY, /* Titlekek 30 */
ZEROES_KEY /* Titlekek 31 */
},
{
ZEROES_KAEKS, /* Key Area Encryption Keyset 00 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 01 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 02 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 03 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 04 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 05 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 06 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 07 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 08 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 09 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 10 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 11 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 12 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 13 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 14 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 15 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 16 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 17 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 18 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 19 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 20 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 21 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 22 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 23 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 24 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 25 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 26 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 27 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 28 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 29 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 30 */
ZEROES_KAEKS /* Key Area Encryption Keyset 31 */
},
{
ZEROES_XTS_KEY, /* SD Card Key, for NCAs. */
ZEROES_XTS_KEY, /* SD Card Key, for saves. */
},
{ /* Fixed RSA key used to validate NCA signature 0. */
0xBF, 0xBE, 0x40, 0x6C, 0xF4, 0xA7, 0x80, 0xE9, 0xF0, 0x7D, 0x0C, 0x99, 0x61, 0x1D, 0x77, 0x2F,
0x96, 0xBC, 0x4B, 0x9E, 0x58, 0x38, 0x1B, 0x03, 0xAB, 0xB1, 0x75, 0x49, 0x9F, 0x2B, 0x4D, 0x58,
0x34, 0xB0, 0x05, 0xA3, 0x75, 0x22, 0xBE, 0x1A, 0x3F, 0x03, 0x73, 0xAC, 0x70, 0x68, 0xD1, 0x16,
0xB9, 0x04, 0x46, 0x5E, 0xB7, 0x07, 0x91, 0x2F, 0x07, 0x8B, 0x26, 0xDE, 0xF6, 0x00, 0x07, 0xB2,
0xB4, 0x51, 0xF8, 0x0D, 0x0A, 0x5E, 0x58, 0xAD, 0xEB, 0xBC, 0x9A, 0xD6, 0x49, 0x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B, 0xEF, 0xA0, 0xD3, 0x48, 0x63, 0xA2, 0xF8, 0xA3, 0x2C, 0x08,
0x56, 0x52, 0x2E, 0x60, 0x19, 0x67, 0x5A, 0xA7, 0x9F, 0xDC, 0x3F, 0x3F, 0x69, 0x2B, 0x31, 0x6A,
0xB7, 0x88, 0x4A, 0x14, 0x84, 0x80, 0x33, 0x3C, 0x9D, 0x44, 0xB7, 0x3F, 0x4C, 0xE1, 0x75, 0xEA,
0x37, 0xEA, 0xE8, 0x1E, 0x7C, 0x77, 0xB7, 0xC6, 0x1A, 0xA2, 0xF0, 0x9F, 0x10, 0x61, 0xCD, 0x7B,
0x5B, 0x32, 0x4C, 0x37, 0xEF, 0xB1, 0x71, 0x68, 0x53, 0x0A, 0xED, 0x51, 0x7D, 0x35, 0x22, 0xFD
},
{ /* Fixed RSA key used to validate PK21 signatures. */
0x8D, 0x13, 0xA7, 0x77, 0x6A, 0xE5, 0xDC, 0xC0, 0x3B, 0x25, 0xD0, 0x58, 0xE4, 0x20, 0x69, 0x59,
0x55, 0x4B, 0xAB, 0x70, 0x40, 0x08, 0x28, 0x07, 0xA8, 0xA7, 0xFD, 0x0F, 0x31, 0x2E, 0x11, 0xFE,
0x47, 0xA0, 0xF9, 0x9D, 0xDF, 0x80, 0xDB, 0x86, 0x5A, 0x27, 0x89, 0xCD, 0x97, 0x6C, 0x85, 0xC5,
0x6C, 0x39, 0x7F, 0x41, 0xF2, 0xFF, 0x24, 0x20, 0xC3, 0x95, 0xA6, 0xF7, 0x9D, 0x4A, 0x45, 0x74,
0x8B, 0x5D, 0x28, 0x8A, 0xC6, 0x99, 0x35, 0x68, 0x85, 0xA5, 0x64, 0x32, 0x80, 0x9F, 0xD3, 0x48,
0x39, 0xA2, 0x1D, 0x24, 0x67, 0x69, 0xDF, 0x75, 0xAC, 0x12, 0xB5, 0xBD, 0xC3, 0x29, 0x90, 0xBE,
0x37, 0xE4, 0xA0, 0x80, 0x9A, 0xBE, 0x36, 0xBF, 0x1F, 0x2C, 0xAB, 0x2B, 0xAD, 0xF5, 0x97, 0x32,
0x9A, 0x42, 0x9D, 0x09, 0x8B, 0x08, 0xF0, 0x63, 0x47, 0xA3, 0xE9, 0x1B, 0x36, 0xD8, 0x2D, 0x8A,
0xD7, 0xE1, 0x54, 0x11, 0x95, 0xE4, 0x45, 0x88, 0x69, 0x8A, 0x2B, 0x35, 0xCE, 0xD0, 0xA5, 0x0B,
0xD5, 0x5D, 0xAC, 0xDB, 0xAF, 0x11, 0x4D, 0xCA, 0xB8, 0x1E, 0xE7, 0x01, 0x9E, 0xF4, 0x46, 0xA3,
0x8A, 0x94, 0x6D, 0x76, 0xBD, 0x8A, 0xC8, 0x3B, 0xD2, 0x31, 0x58, 0x0C, 0x79, 0xA8, 0x26, 0xE9,
0xD1, 0x79, 0x9C, 0xCB, 0xD4, 0x2B, 0x6A, 0x4F, 0xC6, 0xCC, 0xCF, 0x90, 0xA7, 0xB9, 0x98, 0x47,
0xFD, 0xFA, 0x4C, 0x6C, 0x6F, 0x81, 0x87, 0x3B, 0xCA, 0xB8, 0x50, 0xF6, 0x3E, 0x39, 0x5D, 0x4D,
0x97, 0x3F, 0x0F, 0x35, 0x39, 0x53, 0xFB, 0xFA, 0xCD, 0xAB, 0xA8, 0x7A, 0x62, 0x9A, 0x3F, 0xF2,
0x09, 0x27, 0x96, 0x3F, 0x07, 0x9A, 0x91, 0xF7, 0x16, 0xBF, 0xC6, 0x3A, 0x82, 0x5A, 0x4B, 0xCF,
0x49, 0x50, 0x95, 0x8C, 0x55, 0x80, 0x7E, 0x39, 0xB1, 0x48, 0x05, 0x1E, 0x21, 0xC7, 0x24, 0x4F
}
};
static const nca_keyset_t nca_keys_dev = {
ZEROES_KEY, /* Secure Boot Key (CONSOLE UNIQUE) */
ZEROES_KEY, /* TSEC Key (CONSOLE UNIQUE) */
{
ZEROES_KEY, /* Keyblob Key 00 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 01 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 02 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 03 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 04 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 05 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 06 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 07 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 08 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 09 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 10 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 11 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 12 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 13 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 14 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 15 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 16 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 17 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 18 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 19 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 20 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 21 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 22 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 23 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 24 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 25 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 26 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 27 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 28 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 29 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key 30 (CONSOLE UNIQUE) */
ZEROES_KEY /* Keyblob Key 31 (CONSOLE UNIQUE) */
},
{
ZEROES_KEY, /* Keyblob Mac Key 00 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 01 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 02 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 03 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 04 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 05 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 06 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 07 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 08 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 09 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 10 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 11 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 12 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 13 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 14 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 15 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 16 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 17 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 18 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 19 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 20 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 21 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 22 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 23 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 24 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 25 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 26 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 27 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 28 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 29 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Mac Key 30 (CONSOLE UNIQUE) */
ZEROES_KEY /* Keyblob Mac Key 31 (CONSOLE UNIQUE) */
},
{
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 00 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 01 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 02 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 03 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 04 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 05 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 06 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 07 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 08 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 09 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 10 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 11 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 12 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 13 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 14 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 15 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 16 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 17 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 18 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 19 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 20 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 21 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 22 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 23 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 24 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 25 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 26 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 27 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 28 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 29 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB, /* Encrypted Keyblob 30 (CONSOLE UNIQUE) */
ZEROES_ENC_KEYBLOB /* Encrypted Keyblob 31 (CONSOLE UNIQUE) */
},
{
ZEROES_KEYBLOB, /* Keyblob 00 */
ZEROES_KEYBLOB, /* Keyblob 01 */
ZEROES_KEYBLOB, /* Keyblob 02 */
ZEROES_KEYBLOB, /* Keyblob 03 */
ZEROES_KEYBLOB, /* Keyblob 04 */
ZEROES_KEYBLOB, /* Keyblob 05 */
ZEROES_KEYBLOB, /* Keyblob 06 */
ZEROES_KEYBLOB, /* Keyblob 07 */
ZEROES_KEYBLOB, /* Keyblob 08 */
ZEROES_KEYBLOB, /* Keyblob 09 */
ZEROES_KEYBLOB, /* Keyblob 10 */
ZEROES_KEYBLOB, /* Keyblob 11 */
ZEROES_KEYBLOB, /* Keyblob 12 */
ZEROES_KEYBLOB, /* Keyblob 13 */
ZEROES_KEYBLOB, /* Keyblob 14 */
ZEROES_KEYBLOB, /* Keyblob 15 */
ZEROES_KEYBLOB, /* Keyblob 16 */
ZEROES_KEYBLOB, /* Keyblob 17 */
ZEROES_KEYBLOB, /* Keyblob 18 */
ZEROES_KEYBLOB, /* Keyblob 19 */
ZEROES_KEYBLOB, /* Keyblob 20 */
ZEROES_KEYBLOB, /* Keyblob 21 */
ZEROES_KEYBLOB, /* Keyblob 22 */
ZEROES_KEYBLOB, /* Keyblob 23 */
ZEROES_KEYBLOB, /* Keyblob 24 */
ZEROES_KEYBLOB, /* Keyblob 25 */
ZEROES_KEYBLOB, /* Keyblob 26 */
ZEROES_KEYBLOB, /* Keyblob 27 */
ZEROES_KEYBLOB, /* Keyblob 28 */
ZEROES_KEYBLOB, /* Keyblob 29 */
ZEROES_KEYBLOB, /* Keyblob 30 */
ZEROES_KEYBLOB /* Keyblob 31 */
},
{
ZEROES_KEY, /* Keyblob Key Source 00 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 01 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 02 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 03 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 04 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 05 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 06 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 07 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 08 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 09 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 10 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 11 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 12 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 13 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 14 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 15 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 16 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 17 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 18 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 19 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 20 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 21 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 22 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 23 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 24 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 25 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 26 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 27 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 28 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 29 (CONSOLE UNIQUE) */
ZEROES_KEY, /* Keyblob Key Source 30 (CONSOLE UNIQUE) */
ZEROES_KEY /* Keyblob Key Source 31 (CONSOLE UNIQUE) */
},
ZEROES_KEY, /* Keyblob Mac Key Source */
ZEROES_KEY, /* Master Key Source */
{
ZEROES_KEY, /* Master Key 00 */
ZEROES_KEY, /* Master Key 01 */
ZEROES_KEY, /* Master Key 02 */
ZEROES_KEY, /* Master Key 03 */
ZEROES_KEY, /* Master Key 04 */
ZEROES_KEY, /* Master Key 05 */
ZEROES_KEY, /* Master Key 06 */
ZEROES_KEY, /* Master Key 07 */
ZEROES_KEY, /* Master Key 08 */
ZEROES_KEY, /* Master Key 09 */
ZEROES_KEY, /* Master Key 10 */
ZEROES_KEY, /* Master Key 11 */
ZEROES_KEY, /* Master Key 12 */
ZEROES_KEY, /* Master Key 13 */
ZEROES_KEY, /* Master Key 14 */
ZEROES_KEY, /* Master Key 15 */
ZEROES_KEY, /* Master Key 16 */
ZEROES_KEY, /* Master Key 17 */
ZEROES_KEY, /* Master Key 18 */
ZEROES_KEY, /* Master Key 19 */
ZEROES_KEY, /* Master Key 20 */
ZEROES_KEY, /* Master Key 21 */
ZEROES_KEY, /* Master Key 22 */
ZEROES_KEY, /* Master Key 23 */
ZEROES_KEY, /* Master Key 24 */
ZEROES_KEY, /* Master Key 25 */
ZEROES_KEY, /* Master Key 26 */
ZEROES_KEY, /* Master Key 27 */
ZEROES_KEY, /* Master Key 28 */
ZEROES_KEY, /* Master Key 29 */
ZEROES_KEY, /* Master Key 30 */
ZEROES_KEY /* Master Key 31 */
},
{
ZEROES_KEY, /* Package1 Key 00 */
ZEROES_KEY, /* Package1 Key 01 */
ZEROES_KEY, /* Package1 Key 02 */
ZEROES_KEY, /* Package1 Key 03 */
ZEROES_KEY, /* Package1 Key 04 */
ZEROES_KEY, /* Package1 Key 05 */
ZEROES_KEY, /* Package1 Key 06 */
ZEROES_KEY, /* Package1 Key 07 */
ZEROES_KEY, /* Package1 Key 08 */
ZEROES_KEY, /* Package1 Key 09 */
ZEROES_KEY, /* Package1 Key 10 */
ZEROES_KEY, /* Package1 Key 11 */
ZEROES_KEY, /* Package1 Key 12 */
ZEROES_KEY, /* Package1 Key 13 */
ZEROES_KEY, /* Package1 Key 14 */
ZEROES_KEY, /* Package1 Key 15 */
ZEROES_KEY, /* Package1 Key 16 */
ZEROES_KEY, /* Package1 Key 17 */
ZEROES_KEY, /* Package1 Key 18 */
ZEROES_KEY, /* Package1 Key 19 */
ZEROES_KEY, /* Package1 Key 20 */
ZEROES_KEY, /* Package1 Key 21 */
ZEROES_KEY, /* Package1 Key 22 */
ZEROES_KEY, /* Package1 Key 23 */
ZEROES_KEY, /* Package1 Key 24 */
ZEROES_KEY, /* Package1 Key 25 */
ZEROES_KEY, /* Package1 Key 26 */
ZEROES_KEY, /* Package1 Key 27 */
ZEROES_KEY, /* Package1 Key 28 */
ZEROES_KEY, /* Package1 Key 29 */
ZEROES_KEY, /* Package1 Key 30 */
ZEROES_KEY /* Package1 Key 31 */
},
{
ZEROES_KEY, /* Package2 Key 00 */
ZEROES_KEY, /* Package2 Key 01 */
ZEROES_KEY, /* Package2 Key 02 */
ZEROES_KEY, /* Package2 Key 03 */
ZEROES_KEY, /* Package2 Key 04 */
ZEROES_KEY, /* Package2 Key 05 */
ZEROES_KEY, /* Package2 Key 06 */
ZEROES_KEY, /* Package2 Key 07 */
ZEROES_KEY, /* Package2 Key 08 */
ZEROES_KEY, /* Package2 Key 09 */
ZEROES_KEY, /* Package2 Key 10 */
ZEROES_KEY, /* Package2 Key 11 */
ZEROES_KEY, /* Package2 Key 12 */
ZEROES_KEY, /* Package2 Key 13 */
ZEROES_KEY, /* Package2 Key 14 */
ZEROES_KEY, /* Package2 Key 15 */
ZEROES_KEY, /* Package2 Key 16 */
ZEROES_KEY, /* Package2 Key 17 */
ZEROES_KEY, /* Package2 Key 18 */
ZEROES_KEY, /* Package2 Key 19 */
ZEROES_KEY, /* Package2 Key 20 */
ZEROES_KEY, /* Package2 Key 21 */
ZEROES_KEY, /* Package2 Key 22 */
ZEROES_KEY, /* Package2 Key 23 */
ZEROES_KEY, /* Package2 Key 24 */
ZEROES_KEY, /* Package2 Key 25 */
ZEROES_KEY, /* Package2 Key 26 */
ZEROES_KEY, /* Package2 Key 27 */
ZEROES_KEY, /* Package2 Key 28 */
ZEROES_KEY, /* Package2 Key 29 */
ZEROES_KEY, /* Package2 Key 30 */
ZEROES_KEY /* Package2 Key 31 */
},
ZEROES_KEY, /* Package2 Key Source */
ZEROES_KEY, /* Generate Aes Kek Source */
ZEROES_KEY, /* Generate Aes Key Source */
ZEROES_KEY, /* Key Area Encryption Key Source Application */
ZEROES_KEY, /* Key Area Encryption Key Source Ocean */
ZEROES_KEY, /* Key Area Encryption Key Source System */
ZEROES_KEY, /* Titlekek Source */
ZEROES_KEY, /* Headerkek Source */
ZEROES_KEY, /* SD Card kek Source. */
{
ZEROES_XTS_KEY, /* SD Card Key Source, for NCAs. */
ZEROES_XTS_KEY, /* SD Card Key Source, for saves. */
},
ZEROES_XTS_KEY, /* Encrypted Header Key */
ZEROES_XTS_KEY, /* Header key */
{
ZEROES_KEY, /* Titlekek 00 */
ZEROES_KEY, /* Titlekek 01 */
ZEROES_KEY, /* Titlekek 02 */
ZEROES_KEY, /* Titlekek 03 */
ZEROES_KEY, /* Titlekek 04 */
ZEROES_KEY, /* Titlekek 05 */
ZEROES_KEY, /* Titlekek 06 */
ZEROES_KEY, /* Titlekek 07 */
ZEROES_KEY, /* Titlekek 08 */
ZEROES_KEY, /* Titlekek 09 */
ZEROES_KEY, /* Titlekek 10 */
ZEROES_KEY, /* Titlekek 11 */
ZEROES_KEY, /* Titlekek 12 */
ZEROES_KEY, /* Titlekek 13 */
ZEROES_KEY, /* Titlekek 14 */
ZEROES_KEY, /* Titlekek 15 */
ZEROES_KEY, /* Titlekek 16 */
ZEROES_KEY, /* Titlekek 17 */
ZEROES_KEY, /* Titlekek 18 */
ZEROES_KEY, /* Titlekek 19 */
ZEROES_KEY, /* Titlekek 20 */
ZEROES_KEY, /* Titlekek 21 */
ZEROES_KEY, /* Titlekek 22 */
ZEROES_KEY, /* Titlekek 23 */
ZEROES_KEY, /* Titlekek 24 */
ZEROES_KEY, /* Titlekek 25 */
ZEROES_KEY, /* Titlekek 26 */
ZEROES_KEY, /* Titlekek 27 */
ZEROES_KEY, /* Titlekek 28 */
ZEROES_KEY, /* Titlekek 29 */
ZEROES_KEY, /* Titlekek 30 */
ZEROES_KEY /* Titlekek 31 */
},
{
ZEROES_KAEKS, /* Key Area Encryption Keyset 00 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 01 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 02 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 03 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 04 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 05 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 06 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 07 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 08 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 09 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 10 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 11 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 12 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 13 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 14 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 15 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 16 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 17 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 18 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 19 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 20 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 21 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 22 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 23 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 24 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 25 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 26 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 27 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 28 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 29 */
ZEROES_KAEKS, /* Key Area Encryption Keyset 30 */
ZEROES_KAEKS /* Key Area Encryption Keyset 31 */
},
{
ZEROES_XTS_KEY, /* SD Card Key, for NCAs. */
ZEROES_XTS_KEY, /* SD Card Key, for saves. */
},
{
0xD8, 0xF1, 0x18, 0xEF, 0x32, 0x72, 0x4C, 0xA7, 0x47, 0x4C, 0xB9, 0xEA, 0xB3, 0x04, 0xA8, 0xA4,
0xAC, 0x99, 0x08, 0x08, 0x04, 0xBF, 0x68, 0x57, 0xB8, 0x43, 0x94, 0x2B, 0xC7, 0xB9, 0x66, 0x49,
0x85, 0xE5, 0x8A, 0x9B, 0xC1, 0x00, 0x9A, 0x6A, 0x8D, 0xD0, 0xEF, 0xCE, 0xFF, 0x86, 0xC8, 0x5C,
0x5D, 0xE9, 0x53, 0x7B, 0x19, 0x2A, 0xA8, 0xC0, 0x22, 0xD1, 0xF3, 0x22, 0x0A, 0x50, 0xF2, 0x2B,
0x65, 0x05, 0x1B, 0x9E, 0xEC, 0x61, 0xB5, 0x63, 0xA3, 0x6F, 0x3B, 0xBA, 0x63, 0x3A, 0x53, 0xF4,
0x49, 0x2F, 0xCF, 0x03, 0xCC, 0xD7, 0x50, 0x82, 0x1B, 0x29, 0x4F, 0x08, 0xDE, 0x1B, 0x6D, 0x47,
0x4F, 0xA8, 0xB6, 0x6A, 0x26, 0xA0, 0x83, 0x3F, 0x1A, 0xAF, 0x83, 0x8F, 0x0E, 0x17, 0x3F, 0xFE,
0x44, 0x1C, 0x56, 0x94, 0x2E, 0x49, 0x83, 0x83, 0x03, 0xE9, 0xB6, 0xAD, 0xD5, 0xDE, 0xE3, 0x2D,
0xA1, 0xD9, 0x66, 0x20, 0x5D, 0x1F, 0x5E, 0x96, 0x5D, 0x5B, 0x55, 0x0D, 0xD4, 0xB4, 0x77, 0x6E,
0xAE, 0x1B, 0x69, 0xF3, 0xA6, 0x61, 0x0E, 0x51, 0x62, 0x39, 0x28, 0x63, 0x75, 0x76, 0xBF, 0xB0,
0xD2, 0x22, 0xEF, 0x98, 0x25, 0x02, 0x05, 0xC0, 0xD7, 0x6A, 0x06, 0x2C, 0xA5, 0xD8, 0x5A, 0x9D,
0x7A, 0xA4, 0x21, 0x55, 0x9F, 0xF9, 0x3E, 0xBF, 0x16, 0xF6, 0x07, 0xC2, 0xB9, 0x6E, 0x87, 0x9E,
0xB5, 0x1C, 0xBE, 0x97, 0xFA, 0x82, 0x7E, 0xED, 0x30, 0xD4, 0x66, 0x3F, 0xDE, 0xD8, 0x1B, 0x4B,
0x15, 0xD9, 0xFB, 0x2F, 0x50, 0xF0, 0x9D, 0x1D, 0x52, 0x4C, 0x1C, 0x4D, 0x8D, 0xAE, 0x85, 0x1E,
0xEA, 0x7F, 0x86, 0xF3, 0x0B, 0x7B, 0x87, 0x81, 0x98, 0x23, 0x80, 0x63, 0x4F, 0x2F, 0xB0, 0x62,
0xCC, 0x6E, 0xD2, 0x46, 0x13, 0x65, 0x2B, 0xD6, 0x44, 0x33, 0x59, 0xB5, 0x8F, 0xB9, 0x4A, 0xA9
},
{ /* Fixed RSA key used to validate ACID signatures. */
0xD6, 0x34, 0xA5, 0x78, 0x6C, 0x68, 0xCE, 0x5A, 0xC2, 0x37, 0x17, 0xF3, 0x82, 0x45, 0xC6, 0x89,
0xE1, 0x2D, 0x06, 0x67, 0xBF, 0xB4, 0x06, 0x19, 0x55, 0x6B, 0x27, 0x66, 0x0C, 0xA4, 0xB5, 0x87,
0x81, 0x25, 0xF4, 0x30, 0xBC, 0x53, 0x08, 0x68, 0xA2, 0x48, 0x49, 0x8C, 0x3F, 0x38, 0x40, 0x9C,
0xC4, 0x26, 0xF4, 0x79, 0xE2, 0xA1, 0x85, 0xF5, 0x5C, 0x7F, 0x58, 0xBA, 0xA6, 0x1C, 0xA0, 0x8B,
0x84, 0x16, 0x14, 0x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 0x87, 0x6C, 0xA6, 0xF2, 0x73, 0xF6, 0x8E,
0xA7, 0xF2, 0xFE, 0xFB, 0x6C, 0x28, 0x66, 0x0D, 0xBD, 0xD7, 0xEB, 0x42, 0xA8, 0x78, 0xE6, 0xB8,
0x6B, 0xAE, 0xC7, 0xA9, 0xE2, 0x40, 0x6E, 0x89, 0x20, 0x82, 0x25, 0x8E, 0x3C, 0x6A, 0x60, 0xD7,
0xF3, 0x56, 0x8E, 0xEC, 0x8D, 0x51, 0x8A, 0x63, 0x3C, 0x04, 0x78, 0x23, 0x0E, 0x90, 0x0C, 0xB4,
0xE7, 0x86, 0x3B, 0x4F, 0x8E, 0x13, 0x09, 0x47, 0x32, 0x0E, 0x04, 0xB8, 0x4D, 0x5B, 0xB0, 0x46,
0x71, 0xB0, 0x5C, 0xF4, 0xAD, 0x63, 0x4F, 0xC5, 0xE2, 0xAC, 0x1E, 0xC4, 0x33, 0x96, 0x09, 0x7B
}
};
static void generate_kek(unsigned char *dst, const unsigned char *src, const unsigned char *master_key, const unsigned char *kek_seed, const unsigned char *key_seed) {
unsigned char kek[0x10];
unsigned char src_kek[0x10];
aes_ctx_t *master_ctx = new_aes_ctx(master_key, 0x10, AES_MODE_ECB);
aes_decrypt(master_ctx, kek, kek_seed, 0x10);
free_aes_ctx(master_ctx);
aes_ctx_t *kek_ctx = new_aes_ctx(kek, 0x10, AES_MODE_ECB);
aes_decrypt(kek_ctx, src_kek, src, 0x10);
free_aes_ctx(kek_ctx);
if (key_seed != NULL) {
aes_ctx_t *key_ctx = new_aes_ctx(src_kek, 0x10, AES_MODE_ECB);
aes_decrypt(key_ctx, dst, key_seed, 0x10);
free_aes_ctx(key_ctx);
} else {
memcpy(dst, src_kek, 0x10);
}
}
void pki_derive_keys(nca_keyset_t *keyset) {
unsigned char zeroes[0x100];
unsigned char cmac[0x10];
memset(zeroes, 0, 0x100);
memset(cmac, 0, 0x10);
/* Derive keys as necessary. */
for (unsigned int i = 0; i < 0x20; i++) {
/* Start by deriving keyblob keys. */
if (memcmp(&keyset->secure_boot_key, zeroes, 0x10) == 0) {
continue;
}
if (memcmp(&keyset->tsec_key, zeroes, 0x10) == 0) {
continue;
}
if (memcmp(&keyset->keyblob_key_sources[i], zeroes, 0x10) == 0) {
continue;
}
aes_ctx_t *sbk_ctx = new_aes_ctx(keyset->secure_boot_key, 0x10, AES_MODE_ECB);
aes_ctx_t *tsec_ctx = new_aes_ctx(keyset->tsec_key, 0x10, AES_MODE_ECB);
aes_decrypt(tsec_ctx, &keyset->keyblob_keys[i], &keyset->keyblob_key_sources[i], 0x10);
aes_decrypt(sbk_ctx, &keyset->keyblob_keys[i], &keyset->keyblob_keys[i], 0x10);
free_aes_ctx(tsec_ctx);
free_aes_ctx(sbk_ctx);
if (memcmp(keyset->keyblob_mac_key_source, zeroes, 0x10) == 0) {
continue;
}
aes_ctx_t *mac_gen_ctx = new_aes_ctx(&keyset->keyblob_keys[i], 0x10, AES_MODE_ECB);
aes_decrypt(mac_gen_ctx, &keyset->keyblob_mac_keys[i], keyset->keyblob_mac_key_source, 0x10);
free_aes_ctx(mac_gen_ctx);
}
for (unsigned int i = 0; i < 0x20; i++) {
/* Then we decrypt keyblobs. */
if (memcmp(&keyset->keyblob_keys[i], zeroes, 0x10) == 0) {
continue;
}
if (memcmp(&keyset->keyblob_mac_keys[i], zeroes, 0x10) == 0) {
continue;
}
if (memcmp(&keyset->encrypted_keyblobs[i], zeroes, 0xB0) == 0) {
continue;
}
aes_calculate_cmac(cmac, &keyset->encrypted_keyblobs[i][0x10], 0xA0, keyset->keyblob_mac_keys[i]);
if (memcmp(cmac, &keyset->encrypted_keyblobs[i][0], 0x10) != 0) {
fprintf(stderr, "[ WARN ] Keyblob MAC %02x is invalid. Are SBK/TSEC key correct?\n", i);
continue;
}
aes_ctx_t *keyblob_ctx = new_aes_ctx(&keyset->keyblob_keys[i], 0x10, AES_MODE_CTR);
aes_setiv(keyblob_ctx, &keyset->encrypted_keyblobs[i][0x10], 0x10);
aes_decrypt(keyblob_ctx, &keyset->keyblobs[i], &keyset->encrypted_keyblobs[i][0x20], sizeof(keyset->keyblobs[i]));
free_aes_ctx(keyblob_ctx);
}
for (unsigned int i = 0; i < 0x20; i++) {
/* We only need 0x70:0x80 in the blob. */
if (memcmp(keyset->keyblobs[i] + 0x70, zeroes, 0x10) == 0) {
continue;
}
/* Package1 key is at the end of the keyblob. */
memcpy(&keyset->package1_keys[i], &keyset->keyblobs[i][0x80], 0x10);
}
for (unsigned int i = 0; i < 0x20; i++) {
/* Then we derive master keys. */
if (memcmp(keyset->master_key_source, zeroes, 0x10) == 0) {
continue;
}
/* We only need the first key in the blob. */
if (memcmp(keyset->keyblobs[i], zeroes, 0x10) == 0) {
continue;
}
/* Derive Master Keys. */