Keystone

File Structure
The first step is to check the HMAC of the file. The process is to use the  from the Keys page to check the   at position 0x40 in the file.

If it is correct, it proceeds to passcode HMAC check which is not present on retail units.

Use  from the Keys to calculate HMAC of   and check   at offset 0x20. is a string of 0x20 bytes long that should match [A-Za-z0-9\-_] regex.

Usage
Retail:

sceSblPostSsMgrVerifyKeystoneForDriver

Debug:

sceSblPostSsMgrVerifyKeystoneWithPasscodeForDriver

sceSblPostSsMgrDebugEncryptKeystoneForDriver

sceSblPostSsMgrDebugDecryptKeystoneForDriver