9 #include "../kernel/event.h"
11 #define SPL_RSA_BUFFER_SIZE (0x100)
14 SplConfigItem_DisableProgramVerification = 1,
15 SplConfigItem_DramId = 2,
16 SplConfigItem_SecurityEngineIrqNumber = 3,
17 SplConfigItem_Version = 4,
18 SplConfigItem_HardwareType = 5,
19 SplConfigItem_IsRetail = 6,
20 SplConfigItem_IsRecoveryBoot = 7,
21 SplConfigItem_DeviceId = 8,
22 SplConfigItem_BootReason = 9,
23 SplConfigItem_MemoryArrange = 10,
24 SplConfigItem_IsDebugMode = 11,
25 SplConfigItem_KernelMemoryConfiguration = 12,
26 SplConfigItem_IsChargerHiZModeEnabled = 13,
27 SplConfigItem_IsKiosk = 14,
28 SplConfigItem_NewHardwareType = 15,
29 SplConfigItem_NewKeyGeneration = 16,
30 SplConfigItem_Package2Hash = 17,
34 RsaKeyVersion_Deprecated = 0,
35 RsaKeyVersion_Extended = 1,
92 Result splGetConfig(SplConfigItem config_item,
u64 *out_config);
93 Result splUserExpMod(
const void *input,
const void *modulus,
const void *exp,
size_t exp_size,
void *dst);
94 Result splSetConfig(SplConfigItem config_item,
u64 value);
95 Result splGetRandomBytes(
void *out,
size_t out_size);
96 Result splIsDevelopment(
bool *out_is_development);
100 Result splCryptoGenerateAesKek(
const void *wrapped_kek,
u32 key_generation,
u32 option,
void *out_sealed_kek);
101 Result splCryptoLoadAesKey(
const void *sealed_kek,
const void *wrapped_key,
u32 keyslot);
102 Result splCryptoGenerateAesKey(
const void *sealed_kek,
const void *wrapped_key,
void *out_sealed_key);
103 Result splCryptoDecryptAesKey(
const void *wrapped_key,
u32 key_generation,
u32 option,
void *out_sealed_key);
104 Result splCryptoCryptAesCtr(
const void *input,
void *output,
size_t size,
u32 keyslot,
const void *ctr);
105 Result splCryptoComputeCmac(
const void *input,
size_t size,
u32 keyslot,
void *out_cmac);
106 Result splCryptoLockAesEngine(
u32 *out_keyslot);
107 Result splCryptoUnlockAesEngine(
u32 keyslot);
108 Result splCryptoGetSecurityEngineEvent(
Event *out_event);
110 Result splRsaDecryptPrivateKey(
const void *sealed_kek,
const void *wrapped_key,
const void *wrapped_rsa_key,
size_t wrapped_rsa_key_size, RsaKeyVersion version,
void *dst,
size_t dst_size);
112 Result splSslLoadSecureExpModKey(
const void *sealed_kek,
const void *wrapped_key,
const void *wrapped_rsa_key,
size_t wrapped_rsa_key_size);
113 Result splSslSecureExpMod(
const void *input,
const void *modulus,
void *dst);
115 Result splEsLoadRsaOaepKey(
const void *sealed_kek,
const void *wrapped_key,
const void *wrapped_rsa_key,
size_t wrapped_rsa_key_size, RsaKeyVersion version);
116 Result splEsUnwrapRsaOaepWrappedTitlekey(
const void *rsa_wrapped_titlekey,
const void *modulus,
const void *label_hash,
size_t label_hash_size,
u32 key_generation,
void *out_sealed_titlekey);
117 Result splEsUnwrapAesWrappedTitlekey(
const void *aes_wrapped_titlekey,
u32 key_generation,
void *out_sealed_titlekey);
118 Result splEsLoadSecureExpModKey(
const void *sealed_kek,
const void *wrapped_key,
const void *wrapped_rsa_key,
size_t wrapped_rsa_key_size);
119 Result splEsSecureExpMod(
const void *input,
const void *modulus,
void *dst);
120 Result splEsUnwrapElicenseKey(
const void *rsa_wrapped_elicense_key,
const void *modulus,
const void *label_hash,
size_t label_hash_size,
u32 key_generation,
void *out_sealed_elicense_key);
121 Result splEsLoadElicenseKey(
const void *sealed_elicense_key,
u32 keyslot);
123 Result splFsLoadSecureExpModKey(
const void *sealed_kek,
const void *wrapped_key,
const void *wrapped_rsa_key,
size_t wrapped_rsa_key_size, RsaKeyVersion version);
124 Result splFsSecureExpMod(
const void *input,
const void *modulus,
void *dst);
125 Result splFsGenerateSpecificAesKey(
const void *wrapped_key,
u32 key_generation,
u32 option,
void *out_sealed_key);
126 Result splFsLoadTitlekey(
const void *sealed_titlekey,
u32 keyslot);
127 Result splFsGetPackage2Hash(
void *out_hash);
129 Result splManuEncryptRsaKeyForImport(
const void *sealed_kek_pre,
const void *wrapped_key_pre,
const void *sealed_kek_post,
const void *wrapped_kek_post,
u32 option,
const void *wrapped_rsa_key,
void *out_wrapped_rsa_key,
size_t rsa_key_size);
Result splCryptoInitialize(void)
Initialize spl:mig. On pre-4.0.0 this just calls splInitialize.
Service * splSslGetServiceSession(void)
Gets the Service object for the IGeneralInterface usable with splSsl*().
Result splInitialize(void)
Initialize 'spl:'.
void splCryptoExit(void)
Exit spl:mig. On pre-4.0.0 this just calls splExit.
Service * splEsGetServiceSession(void)
Gets the Service object for the IGeneralInterface usable with splEs*().
Result splManuInitialize(void)
Initialize spl:manu. On pre-4.0.0 this just calls splInitialize.
Result splSslInitialize(void)
Initialize spl:ssl. On pre-4.0.0 this just calls splInitialize.
Service * splManuGetServiceSession(void)
Gets the Service object for the IGeneralInterface usable with splManu*().
void splExit(void)
Exit 'spl:'.
void splSslExit(void)
Exit spl:ssl. On pre-4.0.0 this just calls splExit.
Result splEsInitialize(void)
Initialize spl:es. On pre-4.0.0 this just calls splInitialize.
void splManuExit(void)
Exit spl:manu. On pre-4.0.0 this just calls splExit.
Service * splGetServiceSession(void)
Gets the Service object for the IGeneralInterface usable with spl*().
void splFsExit(void)
Exit spl:fs. On pre-4.0.0 this just calls splExit.
Result splFsInitialize(void)
Initialize spl:fs. On pre-4.0.0 this just calls splInitialize.
Service * splFsGetServiceSession(void)
Gets the Service object for the IGeneralInterface usable with splFs*().
Service * splCryptoGetServiceSession(void)
Gets the Service object for the IGeneralInterface usable with splCrypto*().
void splEsExit(void)
Exit spl:es. On pre-4.0.0 this just calls splExit.
Kernel-mode event structure.
Definition: event.h:13
Service object structure.
Definition: service.h:14
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21