vitasdk
Documentation of the vitasdk

Exports for Kernel. More...

Data Structures

struct  SceVisibleId
 Opaque 32-byte visible identifier returned by aimgr_sm command 8. More...
 
struct  SceOpenPsId
 Console-specific 16-byte OpenPSID. More...
 
struct  SceConsoleId
 Sixteen-byte console identifier returned by aimgr_sm command 1. More...
 
struct  ScePsCode
 Eight-byte platform security code returned in host byte order. More...
 
struct  ScePortabilityData
 Fixed-capacity message used by the portability encryption services. More...
 
struct  SceSblSsCreatePassPhraseParam
 Parameters used to create the 0x200-byte CMA account pass phrase. More...
 
struct  SceSblDmac5AesCmacContext
 16-byte chaining value used by the AES-CMAC DMAC5 commands. More...
 
struct  SceSblDmac5HashTransformContext
 Chaining context used by SHA-1, SHA-224, and SHA-256 DMAC5 commands. More...
 
union  SceConsoleId.__unnamed19__
 
struct  SceConsoleId.__unnamed19__.__unnamed21__
 

Macros

#define ksceSblSsMgrAesCtrDecrypt   ksceSblDmac5AesCtrDec
 

Enumerations

enum  SceSblSsNvsDataType {
  SCE_SBL_SS_NVS_DATA_SYSTEM_LANGUAGE = 0 , SCE_SBL_SS_NVS_DATA_WLAN_BT_AVAILABILITY = 1 , SCE_SBL_SS_NVS_DATA_UNK_482 = 2 , SCE_SBL_SS_NVS_DATA_UNK_4E0 = 3 ,
  SCE_SBL_SS_NVS_DATA_UNK_483 = 4 , SCE_SBL_SS_NVS_DATA_UNK_486 = 5
}
 NVS values supported by ksceSblSsGetNvsData and ksceSblSsSetNvsData. More...
 
enum  SceSblDmac5HashFlag { SCE_SBL_DMAC5_HASH_FLAG_OUTPUT_CONTEXT = 0x00000400 , SCE_SBL_DMAC5_HASH_FLAG_INPUT_CONTEXT = 0x00000800 }
 Flags for supplying or returning a context in DMAC5 hash operations. More...
 
enum  SceSblDmac5Keyslot { SCE_SBL_DMAC5_KEYSLOT_1C = 0x1C , SCE_SBL_DMAC5_KEYSLOT_1D = 0x1D , SCE_SBL_DMAC5_KEYSLOT_1E = 0x1E , SCE_SBL_DMAC5_KEYSLOT_1F = 0x1F }
 DMAC5 key slots accepted by the operations whose names end in WithKeyslot. More...
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x20, SceVisibleId)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceOpenPsId)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceConsoleId)
 
 VITASDK_BUILD_ASSERT_EQ (8, ScePsCode)
 
 VITASDK_BUILD_ASSERT_EQ (0x24, ScePortabilityData)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceSblSsCreatePassPhraseParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceSblDmac5AesCmacContext)
 
 VITASDK_BUILD_ASSERT_EQ (0x28, SceSblDmac5HashTransformContext)
 
int ksceSblAimgrGetConsoleId (SceConsoleId *cid)
 
int ksceSblAimgrGetOpenPsId (SceOpenPsId *open_psid)
 
int ksceSblAimgrGetPscode (ScePsCode *pscode)
 
int ksceSblRngPseudoRandomNumber (void *result, SceSize size)
 
int ksceSblDmac5AesCbcDec (const void *src, void *dst, int size, const void *key, int key_size, void *iv, int mask_enable)
 
int ksceSblDmac5AesCbcEnc (const void *src, void *dst, int size, const void *key, int key_size, void *iv, int mask_enable)
 
int ksceSblDmac5AesCtrDec (const void *src, void *dst, int size, const void *key, int key_size, void *iv, int mask_enable)
 
int ksceSblSsDecryptWithPortability (SceUInt32 key_type, void *iv, ScePortabilityData *src, ScePortabilityData *dst)
 
int ksceSblAimgrGetPscode2 (ScePsCode *ps_code)
 Retrieve the secondary platform security code from aimgr_sm.
 
int ksceSblAimgrGetVisibleId (SceVisibleId *visible_id)
 Retrieve the 32-byte visible identifier from aimgr_sm.
 
int ksceSblDmac5AesCbcDecNP (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, void *iv, SceUInt32 key_id, SceBool mask_enable)
 Decrypt data using AES-CBC and an AuthMgr-derived key.
 
int ksceSblDmac5AesCbcEncNP (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, void *iv, SceUInt32 key_id, SceBool mask_enable)
 Encrypt data using AES-CBC and an AuthMgr-derived key.
 
int ksceSblDmac5AesCmacNP (const void *src, void *dst, SceSize length, const void *key, SceSize keysize, SceSblDmac5AesCmacContext *ctx, SceUInt32 key_id, SceBool mask_enable, SceUInt32 flags)
 Compute AES-CMAC using an AuthMgr-derived key.
 
int ksceSblDmac5AesCmacWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, SceSblDmac5AesCmacContext *ctx, SceBool mask_enable, SceUInt32 flags)
 Compute AES-CMAC using a preloaded DMAC5 key slot.
 
int ksceSblDmac5AesCtrEnc (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, void *iv, SceBool mask_enable)
 Encrypt or decrypt data using AES-CTR and a caller-supplied key.
 
int ksceSblDmac5AesEcbDec (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, SceBool mask_enable)
 Decrypt data using AES-ECB and a caller-supplied key.
 
int ksceSblDmac5AesEcbDecNP (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, SceUInt32 key_id, SceBool mask_enable)
 Decrypt data using AES-ECB and an AuthMgr-derived key.
 
int ksceSblDmac5AesEcbDecWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, SceBool mask_enable)
 Decrypt data using AES-ECB and a preloaded DMAC5 key slot.
 
int ksceSblDmac5AesEcbEnc (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, SceBool mask_enable)
 Encrypt data using AES-ECB and a caller-supplied key.
 
int ksceSblDmac5AesEcbEncNP (const void *src, void *dst, SceSize size, const void *key, SceSize key_length, SceUInt32 key_id, SceBool mask_enable)
 Encrypt data using AES-ECB and an AuthMgr-derived 128- or 256-bit key.
 
int ksceSblDmac5AesEcbEncWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, SceBool mask_enable)
 Encrypt data using AES-ECB and a preloaded DMAC5 key slot.
 
int ksceSblDmac5DesCbcDecWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, void *iv, SceBool mask_enable)
 Decrypt data using DES or 3DES-CBC and a preloaded DMAC5 key slot.
 
int ksceSblDmac5DesCbcEncWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, void *iv, SceBool mask_enable)
 Encrypt data using DES or 3DES-CBC and a preloaded DMAC5 key slot.
 
int ksceSblDmac5DesEcbDecWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, SceBool mask_enable)
 Decrypt data using DES or 3DES-ECB and a preloaded DMAC5 key slot.
 
int ksceSblDmac5DesEcbEncWithKeyslot (const void *src, void *dst, SceSize size, SceUInt32 keyslot, SceSize key_length, SceBool mask_enable)
 Encrypt data using DES or 3DES-ECB and a preloaded DMAC5 key slot.
 
int ksceSblDmac5Rnd (void *output_buffer, SceSize size, SceBool mask_enable)
 Generate random bytes using DMAC5.
 
int ksceSblDmac5Sha1 (const void *src, void *dst, SceSize length, SceSblDmac5HashTransformContext *ctx, SceBool mask_enable, SceUInt32 flags)
 Compute or continue a SHA-1 digest.
 
int ksceSblDmac5Sha1HmacNP (const void *src, void *dst, SceSize length, const void *key, SceSblDmac5HashTransformContext *ctx, SceUInt32 key_id, SceBool mask_enable, SceUInt32 flags)
 Compute or continue a SHA-1 HMAC using an AuthMgr-derived 256-bit key.
 
int ksceSblDmac5Sha1HmacTransform (const void *src, void *dst, SceSize length, const void *key, SceSblDmac5HashTransformContext *ctx, SceBool mask_enable, SceUInt32 flags)
 Compute or continue a SHA-1 HMAC using a caller-supplied 0x20-byte key.
 
int ksceSblDmac5Sha256Hmac (const void *src, void *dst, SceSize length, const void *key, SceSblDmac5HashTransformContext *ctx, SceBool mask_enable, SceUInt32 flags)
 Compute or continue a SHA-256 HMAC using a caller-supplied 0x20-byte key.
 
int ksceSblNvsReadData (SceUInt32 offset, void *buffer, SceSize size)
 Read an arbitrary Syscon NVS range in chunks of at most eight bytes.
 
int ksceSblNvsWriteData (SceUInt32 offset, const void *buffer, SceSize size)
 Write an arbitrary Syscon NVS range in chunks of at most eight bytes.
 
int ksceSblQafManagerGetQAFlags (SceUInt8 buffer[0x10])
 Copy the 16 cached QA-flag bytes.
 
int ksceSblQafManagerGetQafName (char *buffer, SceSize max_len)
 Copy the active QAF profile name.
 
int ksceSblQafMgrIsAllowControlIduAutoUpdate (void)
 
int ksceSblQafMgrIsAllowDecryptedBootConfigLoad (void)
 
int ksceSblQafMgrIsAllowDtcpIpReset (void)
 
int ksceSblQafMgrIsAllowHost0Access (void)
 
int ksceSblQafMgrIsAllowKeepCoreFile (void)
 
int ksceSblQafMgrIsAllowLoadMagicGate (void)
 
int ksceSblQafMgrIsAllowMarlinTest (void)
 
int ksceSblQafMgrIsAllowNearTest (void)
 
int ksceSblQafMgrIsAllowPSPEmuShowQAInfo (void)
 
int ksceSblQafMgrIsAllowRemotePlayDebug (void)
 
int ksceSblQafMgrIsAllowSystemAppDebug (void)
 
int ksceSblRngGenuineRandomNumber (void *dest)
 Generate exactly 0x40 bytes of DMAC5 genuine-random output.
 
int ksceSblSsCreatePassPhrase (const SceSblSsCreatePassPhraseParam *param, void *pass_phrase)
 Create a 0x200-byte CMA pass phrase through aimgr_sm command 5.
 
SceInt32 ksceSblSsEncryptWithPortability (SceUInt32 key_type, const void *iv, const ScePortabilityData *plain_msg, ScePortabilityData *enc_msg)
 Encrypt a portability message.
 
int ksceSblSsGetNvsData (SceSblSsNvsDataType type, void *data, SceSize size)
 Read the NVS value selected by type.
 
void * ksceSblSsMemset (void *dest, int value, SceSize size)
 Fill a memory range and return dest.
 
int ksceSblSsMgrExecuteDmac5HashCommand (const void *src, void *dst, SceSize size, void *ctx, SceBool mask_enable, SceUInt32 command, SceUInt32 flags)
 Execute a DMAC5 hash-family command.
 
int ksceSblSsSetNvsData (SceSblSsNvsDataType type, const void *data, SceSize size)
 Write the NVS value selected by type.
 

Variables

SceUInt8 SceVisibleId::visible_id [0x20]
 
SceUInt8 SceOpenPsId::open_psid [0x10]
 
SceUInt16 SceConsoleId::unk
 Its purpose is unknown; the complete 16-byte identifier is cryptographically significant.
 
SceUInt16 SceConsoleId::company_code
 
SceUInt16 SceConsoleId::product_code
 
SceUInt16 SceConsoleId::product_sub_code
 
SceUInt8 SceConsoleId::unk2: 2
 Not interpreted by the FW 3.60 callers examined.
 
SceUInt8 SceConsoleId::factory_code: 6
 
struct { 
 
SceUInt8 unk2: 2
 Not interpreted by the FW 3.60 callers examined.
 
SceUInt8 factory_code: 6
 
}  
 
SceUInt8 SceConsoleId::chassis_check
 
union { 
 
   struct { 
 
SceUInt8 unk2: 2
 Not interpreted by the FW 3.60 callers examined.
 
SceUInt8 factory_code: 6
 
   }  
 
SceUInt8 chassis_check
 
};  
 
SceUInt8 SceConsoleId::unk3 [7]
 Its purpose is unknown; these bytes are used as part of the complete identifier.
 
SceUInt16 ScePsCode::company_code
 
SceUInt16 ScePsCode::product_code
 
SceUInt16 ScePsCode::product_sub_code
 
SceUInt16 ScePsCode::factory_code
 
SceSize ScePortabilityData::msg_size
 Message size; must be 0, 0x10, or 0x20 on FW 3.60.
 
SceUInt8 ScePortabilityData::msg [0x20]
 
SceUInt32 SceSblSsCreatePassPhraseParam::secure_module_arg
 Set to 0 by the observed FW 3.60 caller; forwarded to aimgr_sm command 5. Its purpose is unknown.
 
SceSize SceSblSsCreatePassPhraseParam::size
 Ignored on FW 3.60.
 
char SceSblSsCreatePassPhraseParam::account_id_text [0x10]
 Sixteen lowercase ASCII hexadecimal account-ID characters; not NUL-terminated.
 
SceUInt8 SceSblDmac5AesCmacContext::state [0x10]
 
SceUInt32 SceSblDmac5HashTransformContext::state [8]
 Intermediate hash state.
 
SceUInt64 SceSblDmac5HashTransformContext::length
 Length of input processed so far, maintained by DMAC5.
 

Detailed Description

Exports for Kernel.


Using this library in your project

Include the header file in your project:




Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceSblSsMgrForDriver_stub SceSblSsMgrForKernel_stub SceQafMgrForDriver_stub




Data Structure Documentation

◆ SceVisibleId

struct SceVisibleId

Opaque 32-byte visible identifier returned by aimgr_sm command 8.

Data Fields
SceUInt8 visible_id[0x20]

◆ SceOpenPsId

struct SceOpenPsId

Console-specific 16-byte OpenPSID.

Data Fields
SceUInt8 open_psid[0x10]

◆ SceConsoleId

struct SceConsoleId

Sixteen-byte console identifier returned by aimgr_sm command 1.

Data Fields
SceUInt16 unk Its purpose is unknown; the complete 16-byte identifier is cryptographically significant.
SceUInt16 company_code
SceUInt16 product_code
SceUInt16 product_sub_code
union SceConsoleId.__unnamed19__ __unnamed__
SceUInt8 unk3[7] Its purpose is unknown; these bytes are used as part of the complete identifier.

◆ ScePsCode

struct ScePsCode

Eight-byte platform security code returned in host byte order.

Data Fields
SceUInt16 company_code
SceUInt16 product_code
SceUInt16 product_sub_code
SceUInt16 factory_code

◆ ScePortabilityData

struct ScePortabilityData

Fixed-capacity message used by the portability encryption services.

Data Fields
SceSize msg_size Message size; must be 0, 0x10, or 0x20 on FW 3.60.
SceUInt8 msg[0x20]

◆ SceSblSsCreatePassPhraseParam

struct SceSblSsCreatePassPhraseParam

Parameters used to create the 0x200-byte CMA account pass phrase.

Data Fields
SceUInt32 secure_module_arg Set to 0 by the observed FW 3.60 caller; forwarded to aimgr_sm command 5. Its purpose is unknown.
SceSize size Ignored on FW 3.60.
char account_id_text[0x10] Sixteen lowercase ASCII hexadecimal account-ID characters; not NUL-terminated.

◆ SceSblDmac5AesCmacContext

struct SceSblDmac5AesCmacContext

16-byte chaining value used by the AES-CMAC DMAC5 commands.

Data Fields
SceUInt8 state[0x10]

◆ SceSblDmac5HashTransformContext

struct SceSblDmac5HashTransformContext

Chaining context used by SHA-1, SHA-224, and SHA-256 DMAC5 commands.

Data Fields
SceUInt32 state[8] Intermediate hash state.
SceUInt64 length Length of input processed so far, maintained by DMAC5.

◆ SceConsoleId.__unnamed19__

union SceConsoleId.__unnamed19__
Data Fields
struct SceConsoleId.__unnamed19__.__unnamed21__ __unnamed__
SceUInt8 chassis_check

◆ SceConsoleId.__unnamed19__.__unnamed21__

struct SceConsoleId.__unnamed19__.__unnamed21__
Data Fields
SceUInt8 unk2: 2 Not interpreted by the FW 3.60 callers examined.
SceUInt8 factory_code: 6

Macro Definition Documentation

◆ ksceSblSsMgrAesCtrDecrypt

#define ksceSblSsMgrAesCtrDecrypt   ksceSblDmac5AesCtrDec

Enumeration Type Documentation

◆ SceSblSsNvsDataType

NVS values supported by ksceSblSsGetNvsData and ksceSblSsSetNvsData.

Enumerator
SCE_SBL_SS_NVS_DATA_SYSTEM_LANGUAGE 

Four-byte system-language value at NVS offset 0x4A4.

SCE_SBL_SS_NVS_DATA_WLAN_BT_AVAILABILITY 

One-byte WLAN/Bluetooth availability value at NVS offset 0x500.

SCE_SBL_SS_NVS_DATA_UNK_482 

One-byte value at NVS offset 0x482; its purpose is unknown.

SCE_SBL_SS_NVS_DATA_UNK_4E0 

0x20-byte per-device value at NVS offset 0x4E0; its purpose is unknown.

SCE_SBL_SS_NVS_DATA_UNK_483 

One-byte value at NVS offset 0x483; its purpose is unknown.

SCE_SBL_SS_NVS_DATA_UNK_486 

One-byte value at NVS offset 0x486; AppMgr uses bit 0 to select a cloud-data storage location.

◆ SceSblDmac5HashFlag

Flags for supplying or returning a context in DMAC5 hash operations.

Enumerator
SCE_SBL_DMAC5_HASH_FLAG_OUTPUT_CONTEXT 

Return an updated context instead of a digest.

SCE_SBL_DMAC5_HASH_FLAG_INPUT_CONTEXT 

Continue from the supplied context.

◆ SceSblDmac5Keyslot

DMAC5 key slots accepted by the operations whose names end in WithKeyslot.

Enumerator
SCE_SBL_DMAC5_KEYSLOT_1C 
SCE_SBL_DMAC5_KEYSLOT_1D 
SCE_SBL_DMAC5_KEYSLOT_1E 
SCE_SBL_DMAC5_KEYSLOT_1F 

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/8]

VITASDK_BUILD_ASSERT_EQ ( 0x20  ,
SceVisibleId   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/8]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceOpenPsId   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/8]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceConsoleId   
)

◆ VITASDK_BUILD_ASSERT_EQ() [4/8]

VITASDK_BUILD_ASSERT_EQ ( 8  ,
ScePsCode   
)

◆ VITASDK_BUILD_ASSERT_EQ() [5/8]

VITASDK_BUILD_ASSERT_EQ ( 0x24  ,
ScePortabilityData   
)

◆ VITASDK_BUILD_ASSERT_EQ() [6/8]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceSblSsCreatePassPhraseParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [7/8]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceSblDmac5AesCmacContext   
)

◆ VITASDK_BUILD_ASSERT_EQ() [8/8]

VITASDK_BUILD_ASSERT_EQ ( 0x28  ,
SceSblDmac5HashTransformContext   
)

◆ ksceSblAimgrGetConsoleId()

int ksceSblAimgrGetConsoleId ( SceConsoleId *  cid)

◆ ksceSblAimgrGetOpenPsId()

int ksceSblAimgrGetOpenPsId ( SceOpenPsId *  open_psid)

◆ ksceSblAimgrGetPscode()

int ksceSblAimgrGetPscode ( ScePsCode *  pscode)

◆ ksceSblRngPseudoRandomNumber()

int ksceSblRngPseudoRandomNumber ( void *  result,
SceSize  size 
)

◆ ksceSblDmac5AesCbcDec()

int ksceSblDmac5AesCbcDec ( const void *  src,
void *  dst,
int  size,
const void *  key,
int  key_size,
void *  iv,
int  mask_enable 
)

◆ ksceSblDmac5AesCbcEnc()

int ksceSblDmac5AesCbcEnc ( const void *  src,
void *  dst,
int  size,
const void *  key,
int  key_size,
void *  iv,
int  mask_enable 
)

◆ ksceSblDmac5AesCtrDec()

int ksceSblDmac5AesCtrDec ( const void *  src,
void *  dst,
int  size,
const void *  key,
int  key_size,
void *  iv,
int  mask_enable 
)

◆ ksceSblSsDecryptWithPortability()

int ksceSblSsDecryptWithPortability ( SceUInt32  key_type,
void *  iv,
ScePortabilityData *  src,
ScePortabilityData *  dst 
)

◆ ksceSblAimgrGetPscode2()

int ksceSblAimgrGetPscode2 ( ScePsCode *  ps_code)

Retrieve the secondary platform security code from aimgr_sm.

The four 16-bit fields are returned in host byte order. This operation is available only when the product-mode check allows it.

Parameters
[out]ps_code- Required eight-byte output.
Returns
0 on success, < 0 on error.

◆ ksceSblAimgrGetVisibleId()

int ksceSblAimgrGetVisibleId ( SceVisibleId *  visible_id)

Retrieve the 32-byte visible identifier from aimgr_sm.

Parameters
[out]visible_id- Required output buffer.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesCbcDecNP()

int ksceSblDmac5AesCbcDecNP ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
void *  iv,
SceUInt32  key_id,
SceBool  mask_enable 
)

Decrypt data using AES-CBC and an AuthMgr-derived key.

Parameters
[in]src- Input data.
[out]dst- Output data.
[in]size- Data size; must be a multiple of 0x10.
[in]key- Key material supplied to AuthMgr.
[in]key_length- Key size in bits: 128 or 256. AuthMgr rejects 192 bits on FW 3.60.
[in,out]iv- Required 16-byte IV, updated after the operation.
[in]key_id- AuthMgr key identifier: 0, 0x10000, 0x10001, 0x20000, or 0x20001.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesCbcEncNP()

int ksceSblDmac5AesCbcEncNP ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
void *  iv,
SceUInt32  key_id,
SceBool  mask_enable 
)

Encrypt data using AES-CBC and an AuthMgr-derived key.

Parameters and return values are the same as ksceSblDmac5AesCbcDecNP.

◆ ksceSblDmac5AesCmacNP()

int ksceSblDmac5AesCmacNP ( const void *  src,
void *  dst,
SceSize  length,
const void *  key,
SceSize  keysize,
SceSblDmac5AesCmacContext *  ctx,
SceUInt32  key_id,
SceBool  mask_enable,
SceUInt32  flags 
)

Compute AES-CMAC using an AuthMgr-derived key.

Parameters
[in]src- Input data.
[out]dst- Optional 16-byte MAC output.
[in]length- Input size.
[in]key- Key material supplied to AuthMgr.
[in]keysize- Key size in bits: 128 or 256.
[in,out]ctx- Optional 0x10-byte AES-CMAC chaining context.
[in]key_id- AuthMgr key identifier: 0, 0x10000, 0x10001, 0x20000, or 0x20001.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
[in]flags- Bitwise OR of SceSblDmac5HashFlag values.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesCmacWithKeyslot()

int ksceSblDmac5AesCmacWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
SceSblDmac5AesCmacContext *  ctx,
SceBool  mask_enable,
SceUInt32  flags 
)

Compute AES-CMAC using a preloaded DMAC5 key slot.

Parameters
[in]src- Input data.
[out]dst- Optional 16-byte MAC output.
[in]size- Input size.
[in]keyslot- One of SceSblDmac5Keyslot.
[in]key_length- Key size in bits: 128, 192, or 256.
[in,out]ctx- Optional 0x10-byte chaining context.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
[in]flags- Bitwise OR of SceSblDmac5HashFlag values.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesCtrEnc()

int ksceSblDmac5AesCtrEnc ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
void *  iv,
SceBool  mask_enable 
)

Encrypt or decrypt data using AES-CTR and a caller-supplied key.

Parameters
[in]src- Input data.
[out]dst- Output data.
[in]size- Data size.
[in]key- AES key.
[in]key_length- Key size in bits: 128, 192, or 256.
[in,out]iv- Required 16-byte counter, updated after the operation.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesEcbDec()

int ksceSblDmac5AesEcbDec ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
SceBool  mask_enable 
)

Decrypt data using AES-ECB and a caller-supplied key.

Parameters
[in]src- Input data.
[out]dst- Output data.
[in]size- Data size; must be a multiple of 0x10.
[in]key- AES key.
[in]key_length- Key size in bits: 128, 192, or 256.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesEcbDecNP()

int ksceSblDmac5AesEcbDecNP ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
SceUInt32  key_id,
SceBool  mask_enable 
)

Decrypt data using AES-ECB and an AuthMgr-derived key.

Parameters
[in]src- Input data.
[out]dst- Output data.
[in]size- Data size; must be a multiple of 0x10.
[in]key- Key material supplied to AuthMgr.
[in]key_length- Key size in bits: 128 or 256.
[in]key_id- AuthMgr key identifier: 0, 0x10000, 0x10001, 0x20000, or 0x20001.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5AesEcbDecWithKeyslot()

int ksceSblDmac5AesEcbDecWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
SceBool  mask_enable 
)

Decrypt data using AES-ECB and a preloaded DMAC5 key slot.

Parameters
[in]keyslot- One of SceSblDmac5Keyslot.

Other parameters and return values are the same as ksceSblDmac5AesEcbDec.

◆ ksceSblDmac5AesEcbEnc()

int ksceSblDmac5AesEcbEnc ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
SceBool  mask_enable 
)

Encrypt data using AES-ECB and a caller-supplied key.

◆ ksceSblDmac5AesEcbEncNP()

int ksceSblDmac5AesEcbEncNP ( const void *  src,
void *  dst,
SceSize  size,
const void *  key,
SceSize  key_length,
SceUInt32  key_id,
SceBool  mask_enable 
)

Encrypt data using AES-ECB and an AuthMgr-derived 128- or 256-bit key.

◆ ksceSblDmac5AesEcbEncWithKeyslot()

int ksceSblDmac5AesEcbEncWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
SceBool  mask_enable 
)

Encrypt data using AES-ECB and a preloaded DMAC5 key slot.

Parameters
[in]keyslot- One of SceSblDmac5Keyslot.

◆ ksceSblDmac5DesCbcDecWithKeyslot()

int ksceSblDmac5DesCbcDecWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
void *  iv,
SceBool  mask_enable 
)

Decrypt data using DES or 3DES-CBC and a preloaded DMAC5 key slot.

Parameters
[in]keyslot- One of SceSblDmac5Keyslot.
[in,out]iv- Required eight-byte IV, updated after the operation.

◆ ksceSblDmac5DesCbcEncWithKeyslot()

int ksceSblDmac5DesCbcEncWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
void *  iv,
SceBool  mask_enable 
)

Encrypt data using DES or 3DES-CBC and a preloaded DMAC5 key slot.

◆ ksceSblDmac5DesEcbDecWithKeyslot()

int ksceSblDmac5DesEcbDecWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
SceBool  mask_enable 
)

Decrypt data using DES or 3DES-ECB and a preloaded DMAC5 key slot.

◆ ksceSblDmac5DesEcbEncWithKeyslot()

int ksceSblDmac5DesEcbEncWithKeyslot ( const void *  src,
void *  dst,
SceSize  size,
SceUInt32  keyslot,
SceSize  key_length,
SceBool  mask_enable 
)

Encrypt data using DES or 3DES-ECB and a preloaded DMAC5 key slot.

◆ ksceSblDmac5Rnd()

int ksceSblDmac5Rnd ( void *  output_buffer,
SceSize  size,
SceBool  mask_enable 
)

Generate random bytes using DMAC5.

Parameters
[out]output_buffer- Output buffer; required when size is nonzero.
[in]size- Number of bytes to generate. Must be at most 0x40.
[in]mask_enable- Nonzero to apply the DMAC access mask.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5Sha1()

int ksceSblDmac5Sha1 ( const void *  src,
void *  dst,
SceSize  length,
SceSblDmac5HashTransformContext *  ctx,
SceBool  mask_enable,
SceUInt32  flags 
)

Compute or continue a SHA-1 digest.

Parameters
[in]src- Input data.
[out]dst- Optional 20-byte digest output.
[in]length- Input size.
[in,out]ctx- Optional 0x28-byte SHA chaining context.
[in]mask_enable- Nonzero to enable the DMAC memory-access mask.
[in]flags- Bitwise OR of SceSblDmac5HashFlag values.
Returns
0 on success, < 0 on error.

◆ ksceSblDmac5Sha1HmacNP()

int ksceSblDmac5Sha1HmacNP ( const void *  src,
void *  dst,
SceSize  length,
const void *  key,
SceSblDmac5HashTransformContext *  ctx,
SceUInt32  key_id,
SceBool  mask_enable,
SceUInt32  flags 
)

Compute or continue a SHA-1 HMAC using an AuthMgr-derived 256-bit key.

Parameters
[in]key- 0x20-byte key material supplied to AuthMgr.
[in]key_id- AuthMgr key identifier: 0, 0x10000, 0x10001, 0x20000, or 0x20001.

Other parameters and return values are the same as ksceSblDmac5Sha1.

◆ ksceSblDmac5Sha1HmacTransform()

int ksceSblDmac5Sha1HmacTransform ( const void *  src,
void *  dst,
SceSize  length,
const void *  key,
SceSblDmac5HashTransformContext *  ctx,
SceBool  mask_enable,
SceUInt32  flags 
)

Compute or continue a SHA-1 HMAC using a caller-supplied 0x20-byte key.

◆ ksceSblDmac5Sha256Hmac()

int ksceSblDmac5Sha256Hmac ( const void *  src,
void *  dst,
SceSize  length,
const void *  key,
SceSblDmac5HashTransformContext *  ctx,
SceBool  mask_enable,
SceUInt32  flags 
)

Compute or continue a SHA-256 HMAC using a caller-supplied 0x20-byte key.

dst receives 0x20 bytes for a completed operation.

◆ ksceSblNvsReadData()

int ksceSblNvsReadData ( SceUInt32  offset,
void *  buffer,
SceSize  size 
)

Read an arbitrary Syscon NVS range in chunks of at most eight bytes.

Parameters
[in]offset- NVS byte offset.
[out]buffer- Destination buffer. It may be NULL only when size is 0.
[in]size- Number of bytes to read.
Returns
0 on success, < 0 on error.

◆ ksceSblNvsWriteData()

int ksceSblNvsWriteData ( SceUInt32  offset,
const void *  buffer,
SceSize  size 
)

Write an arbitrary Syscon NVS range in chunks of at most eight bytes.

Parameters
[in]offset- NVS byte offset.
[in]buffer- Source buffer. It may be NULL only when size is 0.
[in]size- Number of bytes to write.
Returns
0 on success, < 0 on error.

◆ ksceSblQafManagerGetQAFlags()

int ksceSblQafManagerGetQAFlags ( SceUInt8  buffer[0x10])

Copy the 16 cached QA-flag bytes.

Parameters
[out]buffer- Required 0x10-byte output buffer.
Returns
0 on success, < 0 when the QAF state is unavailable.

◆ ksceSblQafManagerGetQafName()

int ksceSblQafManagerGetQafName ( char *  buffer,
SceSize  max_len 
)

Copy the active QAF profile name.

Values of max_len above 0x18 are treated as 0x18. The resulting string is always NUL-terminated within the selected range.

Parameters
[out]buffer- Required profile-name buffer.
[in]max_len- Number of writable bytes; must be nonzero.
Returns
0 on success, < 0 on error.

◆ ksceSblQafMgrIsAllowControlIduAutoUpdate()

int ksceSblQafMgrIsAllowControlIduAutoUpdate ( void  )
Returns
1 when QA configuration allows IDU automatic updates, otherwise 0.

◆ ksceSblQafMgrIsAllowDecryptedBootConfigLoad()

int ksceSblQafMgrIsAllowDecryptedBootConfigLoad ( void  )
Returns
1 when QA configuration allows decrypted boot-configuration loading, otherwise 0.

◆ ksceSblQafMgrIsAllowDtcpIpReset()

int ksceSblQafMgrIsAllowDtcpIpReset ( void  )
Returns
1 when QA configuration allows DTCP-IP reset operations, otherwise 0.

◆ ksceSblQafMgrIsAllowHost0Access()

int ksceSblQafMgrIsAllowHost0Access ( void  )
Returns
1 when QA configuration allows host0: access, otherwise 0.

◆ ksceSblQafMgrIsAllowKeepCoreFile()

int ksceSblQafMgrIsAllowKeepCoreFile ( void  )
Returns
1 when QA configuration allows retaining core files, otherwise 0.

◆ ksceSblQafMgrIsAllowLoadMagicGate()

int ksceSblQafMgrIsAllowLoadMagicGate ( void  )
Returns
1 when QA configuration allows loading MagicGate components, otherwise 0.

◆ ksceSblQafMgrIsAllowMarlinTest()

int ksceSblQafMgrIsAllowMarlinTest ( void  )
Returns
1 when QA configuration allows Marlin testing, otherwise 0.

◆ ksceSblQafMgrIsAllowNearTest()

int ksceSblQafMgrIsAllowNearTest ( void  )
Returns
1 when QA configuration allows Near testing, otherwise 0.

◆ ksceSblQafMgrIsAllowPSPEmuShowQAInfo()

int ksceSblQafMgrIsAllowPSPEmuShowQAInfo ( void  )
Returns
1 when QA configuration allows showing PSPEmu QA information, otherwise 0.

◆ ksceSblQafMgrIsAllowRemotePlayDebug()

int ksceSblQafMgrIsAllowRemotePlayDebug ( void  )
Returns
1 when QA configuration allows Remote Play debugging, otherwise 0.

◆ ksceSblQafMgrIsAllowSystemAppDebug()

int ksceSblQafMgrIsAllowSystemAppDebug ( void  )
Returns
1 when QA configuration allows system-application debugging, otherwise 0.

◆ ksceSblRngGenuineRandomNumber()

int ksceSblRngGenuineRandomNumber ( void *  dest)

Generate exactly 0x40 bytes of DMAC5 genuine-random output.

Parameters
[out]dest- Required 0x40-byte output buffer.
Returns
0 on success, < 0 on error.

◆ ksceSblSsCreatePassPhrase()

int ksceSblSsCreatePassPhrase ( const SceSblSsCreatePassPhraseParam *  param,
void *  pass_phrase 
)

Create a 0x200-byte CMA pass phrase through aimgr_sm command 5.

The function copies the 16 account-ID characters, IdStorage leaf 0x44, and the current secure tick into the secure-module request. It does not inspect SceSblSsCreatePassPhraseParam::size.

Parameters
[in]param- Required 0x18-byte input parameters.
[out]pass_phrase- Required 0x200-byte output buffer.
Returns
0 on success, < 0 on error.

◆ ksceSblSsEncryptWithPortability()

SceInt32 ksceSblSsEncryptWithPortability ( SceUInt32  key_type,
const void *  iv,
const ScePortabilityData *  plain_msg,
ScePortabilityData *  enc_msg 
)

Encrypt a portability message.

On FW 3.60 only key type 0 succeeds; after validating the current process's SELF authentication information, it copies the plaintext message unchanged. Key types 1 through 20 return an invalid-argument error without invoking a secure module. The input and output message sizes must match, be at most 0x20, and be multiples of 0x10.

Parameters
[in]key_type- Portability key type, from 0 through 20.
[in]iv- Required 0x10-byte IV.
[in]plain_msg- Required plaintext message.
[in,out]enc_msg- Required output whose ScePortabilityData::msg_size is initialized to the plaintext message size.
Returns
0 on success, < 0 on error.

◆ ksceSblSsGetNvsData()

int ksceSblSsGetNvsData ( SceSblSsNvsDataType  type,
void *  data,
SceSize  size 
)

Read the NVS value selected by type.

size must be 1, 2, 4, 8, 16, or 32 and must be at least the selected value's size. Only that value's bytes are copied.

Parameters
[in]type- NVS value to read.
[out]data- Required output buffer.
[in]size- Caller buffer size, subject to the limits above.
Returns
0 on success, < 0 on error.

◆ ksceSblSsMemset()

void * ksceSblSsMemset ( void *  dest,
int  value,
SceSize  size 
)

Fill a memory range and return dest.

Parameters
[out]dest- Destination memory.
[in]value- Byte value; only the low eight bits are used.
[in]size- Number of bytes to write.
Returns
dest.

◆ ksceSblSsMgrExecuteDmac5HashCommand()

int ksceSblSsMgrExecuteDmac5HashCommand ( const void *  src,
void *  dst,
SceSize  size,
void *  ctx,
SceBool  mask_enable,
SceUInt32  command,
SceUInt32  flags 
)

Execute a DMAC5 hash-family command.

Parameters
[in]src- Input data.
[out]dst- Optional command-dependent digest or MAC output.
[in]size- Input size.
[in,out]ctx- Command-dependent chaining context. SHA-family commands use a SceSblDmac5HashTransformContext; AES-CMAC uses a 0x10-byte context.
[in]mask_enable- Nonzero to apply the DMAC access mask.
[in]command- DMAC5 base command.
[in]flags- Bitwise OR of SceSblDmac5HashFlag values.
Returns
0 on success, < 0 on error.

◆ ksceSblSsSetNvsData()

int ksceSblSsSetNvsData ( SceSblSsNvsDataType  type,
const void *  data,
SceSize  size 
)

Write the NVS value selected by type.

size follows the same validation rules as ksceSblSsGetNvsData. Only the selected value's bytes are written.

Parameters
[in]type- NVS value to write.
[in]data- Required source buffer.
[in]size- Caller buffer size, subject to the limits above.
Returns
0 on success, < 0 on error.

Variable Documentation

◆ visible_id

SceUInt8 SceVisibleId::visible_id[0x20]

◆ open_psid

SceUInt8 SceOpenPsId::open_psid[0x10]

◆ unk

SceUInt16 SceConsoleId::unk

Its purpose is unknown; the complete 16-byte identifier is cryptographically significant.

◆ company_code [1/2]

SceUInt16 SceConsoleId::company_code

◆ product_code [1/2]

SceUInt16 SceConsoleId::product_code

◆ product_sub_code [1/2]

SceUInt16 SceConsoleId::product_sub_code

◆ []

SceUInt8 { ... } ::unk2

Not interpreted by the FW 3.60 callers examined.

◆ [] [1/2]

SceUInt8 { ... } ::factory_code

◆ [struct]

struct { ... } SceConsoleId

◆ []

SceUInt8 { ... } ::chassis_check

◆ [union]

union { ... } SceConsoleId

◆ unk3

SceUInt8 SceConsoleId::unk3[7]

Its purpose is unknown; these bytes are used as part of the complete identifier.

◆ company_code [2/2]

SceUInt16 ScePsCode::company_code

◆ product_code [2/2]

SceUInt16 ScePsCode::product_code

◆ product_sub_code [2/2]

SceUInt16 ScePsCode::product_sub_code

◆ factory_code [2/2]

SceUInt16 ScePsCode::factory_code

◆ msg_size

SceSize ScePortabilityData::msg_size

Message size; must be 0, 0x10, or 0x20 on FW 3.60.

◆ msg

SceUInt8 ScePortabilityData::msg[0x20]

◆ secure_module_arg

SceUInt32 SceSblSsCreatePassPhraseParam::secure_module_arg

Set to 0 by the observed FW 3.60 caller; forwarded to aimgr_sm command 5. Its purpose is unknown.

◆ size

SceSize SceSblSsCreatePassPhraseParam::size

Ignored on FW 3.60.

◆ account_id_text

char SceSblSsCreatePassPhraseParam::account_id_text[0x10]

Sixteen lowercase ASCII hexadecimal account-ID characters; not NUL-terminated.

◆ state [1/2]

SceUInt8 SceSblDmac5AesCmacContext::state[0x10]

◆ state [2/2]

SceUInt32 SceSblDmac5HashTransformContext::state[8]

Intermediate hash state.

◆ length

SceUInt64 SceSblDmac5HashTransformContext::length

Length of input processed so far, maintained by DMAC5.