Changes

Jump to navigation Jump to search
576 bytes added ,  13:15, 1 May 2017
Update descriptions
Line 286: Line 286:  
| 5a || u32 load_module(const char* path) || Load the specified IOS module and run it (can only be called from UID 0, which is kernel or ES) || 0 on success, negative for error
 
| 5a || u32 load_module(const char* path) || Load the specified IOS module and run it (can only be called from UID 0, which is kernel or ES) || 0 on success, negative for error
 
|-
 
|-
| 5b || IOSCError IOSC_CreateObject(u32* key_handle, IOSCObjectType type, IOSCObjectSubType subtype); || create a new keyring entry || 0 on success, negative for error
+
| 5b || IOSCError IOSC_CreateObject(u32* key_handle, IOSCObjectType type, IOSCObjectSubType subtype); || Create a new keyring entry. <code>key_handle</code> is updated with a key handle to use with other IOSC calls. || 0 on success, negative for error
 
|-
 
|-
| 5c || IOSCError IOSC_DeleteObject(int key_handle) || Remove a keyring entry || 0 on success, negative for error
+
| 5c || IOSCError IOSC_DeleteObject(u32 key_handle) || Remove a keyring entry || 0 on success, negative for error
 
|-
 
|-
| 5d || IOSCError IOSC_ImportSecretKey(IOSCSecretKeyHandle importedHandle, IOSCSecretKeyHandle verifyHandle, IOSCSecretKeyHandle decryptHandle, IOSCSecretKeySecurity flag, u8 * signbuffer, u8 * ivData, u8 * keybuffer); || Sets the contents of a key || 0 on success, negative for error
+
| 5d || IOSCError IOSC_ImportSecretKey(IOSCSecretKeyHandle importedHandle, IOSCSecretKeyHandle verifyHandle, IOSCSecretKeyHandle decryptHandle, IOSCSecretKeySecurity flag, u8 * signbuffer, u8 * ivData, u8 * keybuffer); || Sets the contents of a key handle. This is commonly used to import a built-in key handle (such as the common key). || 0 on success, negative for error
 
|-
 
|-
 
| 5e || IOSCError IOSC_ExportSecretKey(IOSCSecretKeyHandle exportedHandle, IOSCSecretKeyHandle signHandle, IOSCSecretKeyHandle encryptHandle, IOSCSecretKeySecurity security_flag, u8 * signbuffer, u8 * ivData, u8 * keybuffer); || || 0 on success, negative for error
 
| 5e || IOSCError IOSC_ExportSecretKey(IOSCSecretKeyHandle exportedHandle, IOSCSecretKeyHandle signHandle, IOSCSecretKeyHandle encryptHandle, IOSCSecretKeySecurity security_flag, u8 * signbuffer, u8 * ivData, u8 * keybuffer); || || 0 on success, negative for error
 
|-
 
|-
| 5f || IOSCError IOSC_ImportPublicKey(u8 * publicKeyData, u8 * exponent, IOSCPublicKeyHandle publicKeyHandle); || Sets the contents of a signature. data length should match the signature type, user_data is optional 4 bytes that can be attached || 0 on success, negative for error
+
| 5f || IOSCError IOSC_ImportPublicKey(u8 * publicKeyData, u8 * exponent, IOSCPublicKeyHandle publicKeyHandle); || Sets the contents of a signature. The imported public key must match <code>publicKeyHandle</code>'s type. <code>exponent</code> is optional 4 bytes that can be attached || 0 on success, negative for error
 
|-
 
|-
 
| 60 || IOSCError IOSC_ExportPublicKey(u8 * publicKeyData, u8 * exponent, IOSCPublicKeyHandle publicKeyHandle); || Gets the contents of a signature || 0 on success, negative for error
 
| 60 || IOSCError IOSC_ExportPublicKey(u8 * publicKeyData, u8 * exponent, IOSCPublicKeyHandle publicKeyHandle); || Gets the contents of a signature || 0 on success, negative for error
 
|-
 
|-
| 61 || IOSCError IOSC_ComputeSharedKey(IOSCSecretKeyHandle privateHandle, IOSCPublicKeyHandle publicHandle, IOSCSecretKeyHandle sharedHandle); || Generates a new AES crypto key from an ecdh shared secret calculated from a sender's ECC key and our own ECC key || 0 on success, negative for error
+
| 61 || IOSCError IOSC_ComputeSharedKey(IOSCSecretKeyHandle privateHandle, IOSCPublicKeyHandle publicHandle, IOSCSecretKeyHandle sharedHandle); || Generates a new AES crypto key (<code>sharedHandle</code>) from an ecdh shared secret calculated from a sender's ECC key (<code>publicHandle</code>) and our own ECC key (<code>privateHandle</code>) || 0 on success, negative for error
 
|-
 
|-
 
| 62 || IOSCError IOSC_SetData(IOSCDataHandle dataHandle, u32 value); || || 0 on success, negative for error
 
| 62 || IOSCError IOSC_SetData(IOSCDataHandle dataHandle, u32 value); || || 0 on success, negative for error
Line 304: Line 304:  
| 63 || IOSCError IOSC_GetData(IOSCDataHandle dataHandle, u32 * value); || Fetch 4 bytes of userdata from the key || 0 on success (userdata in data), negative for error
 
| 63 || IOSCError IOSC_GetData(IOSCDataHandle dataHandle, u32 * value); || Fetch 4 bytes of userdata from the key || 0 on success (userdata in data), negative for error
 
|-
 
|-
| 64 || IOSCError IOSC_GetKeySize(u32 * keySize, IOSCKeyHandle handle);|| Return the key's size in size[0] || 0 on success, negative for error
+
| 64 || IOSCError IOSC_GetKeySize(u32 * keySize, IOSCKeyHandle handle);|| Return the key size || 0 on success, negative for error
 
|-
 
|-
| 65 || IOSCError IOSC_GetSignatureSize(u32 * signSize, int handle); || Return the key's userdata size in size[0] || 0 on success, negative for error
+
| 65 || IOSCError IOSC_GetSignatureSize(u32 * signSize, int handle); || Return the signature size || 0 on success, negative for error
 
|-
 
|-
| 66 || int IOSC_GenerateHashAsync(u8 * context, u8 * inputData, u32 inputSize, u32 chainingFlag, u8 * hashData, int message_queue_id, IOSRequest* reply); || Calculate SHA1 hash of data, send message to queueid with result || 0 on success
+
| 66 || int IOSC_GenerateHashAsync(u8 * context, u8 * inputData, u32 inputSize, u32 chainingFlag, u8 * hashData, int message_queue_id, IOSRequest* reply); || Calculate SHA1 hash of <code>inputData</code>. An IPC reply is sent to the message queue on completion. || 0 on success
 
|-
 
|-
 
| 67 || IOSCError IOSC_GenerateHash(u8 * context, u8 * inputData, u32 inputSize, u32 chainingFlag, u8 * hashData); || Synchronous implementation of IOSC_GenerateHashAsync || 0 on success
 
| 67 || IOSCError IOSC_GenerateHash(u8 * context, u8 * inputData, u32 inputSize, u32 chainingFlag, u8 * hashData); || Synchronous implementation of IOSC_GenerateHashAsync || 0 on success
 
|-
 
|-
| 68 || int IOSC_EncryptAsync(IOSCSecretKeyHandle encryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData, int message_queue_id, IOSRequest* reply) || AES-encrypt len bytes from in using keyid and iv (which gets updated) and write to out. Send message to queueid with result || 0 on success
+
| 68 || int IOSC_EncryptAsync(IOSCSecretKeyHandle encryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData, int message_queue_id, IOSRequest* reply) || AES-encrypt <code>inputSize</code> bytes from <code>inputData</code> using <code>encryptHandle</code> and <code>ivData</code> (which gets updated) and write to <code>outputData</code>. An IPC reply is sent to the message queue on completion. || 0 on success
 
|-
 
|-
 
| 69 || IOSCError IOSC_Encrypt(IOSCSecretKeyHandle encryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData); || Synchronous implementation of IOSC_EncryptAsync || 0 on success
 
| 69 || IOSCError IOSC_Encrypt(IOSCSecretKeyHandle encryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData); || Synchronous implementation of IOSC_EncryptAsync || 0 on success
 
|-
 
|-
| 6a || int IOSC_DecryptAsync((IOSCSecretKeyHandle decryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData, int message_queue_id, IOSRequest* request); || AES-decrypt len bytes from in using keyid and iv (which gets updated) and write to out. Send message to queueid with result || 0 on success
+
| 6a || int IOSC_DecryptAsync((IOSCSecretKeyHandle decryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData, int message_queue_id, IOSRequest* request); || AES-decrypt <code>inputSize</code> bytes from <code>inputData</code> using <code>decryptHandle</code> and <code>ivData</code> (which gets updated) and write to <code>outputData</code>. An IPC reply is sent to the message queue on completion. || 0 on success
 
|-
 
|-
 
| 6b || IOSCError IOSC_Decrypt(IOSCSecretKeyHandle decryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData); || Synchronous implementation of IOSC_DecryptAsync || 0 on success
 
| 6b || IOSCError IOSC_Decrypt(IOSCSecretKeyHandle decryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData); || Synchronous implementation of IOSC_DecryptAsync || 0 on success
Line 328: Line 328:  
| 6f || IOSCError IOSC_ImportCertificate(u8 * certData, IOSCPublicKeyHandle signerHandle, IOSCPublicKeyHandle publicKeyHandle); || || 0 on success
 
| 6f || IOSCError IOSC_ImportCertificate(u8 * certData, IOSCPublicKeyHandle signerHandle, IOSCPublicKeyHandle publicKeyHandle); || || 0 on success
 
|-
 
|-
| 70 || IOSCError IOSC_GetDeviceCertificate(IOSCEccSignedCert * certificate); || Write 0x180 bytes of NG certificate to cert || 0 on success
+
| 70 || IOSCError IOSC_GetDeviceCertificate(IOSCEccSignedCert * certificate); || Write 0x180 bytes of NG certificate to <code>certificate</code> || 0 on success
 
|-
 
|-
 
| 71 || IOSCError IOSC_SetOwnership(u32 handle, u32 users); || Allow the PIDs set in mask to use this key || 0 on success
 
| 71 || IOSCError IOSC_SetOwnership(u32 handle, u32 users); || Allow the PIDs set in mask to use this key || 0 on success
Line 336: Line 336:  
| 73 || IOSCError IOSC_GenerateRand(u8 * randBytes, u32 numBytes); || Write size bytes of random data to data || 0 on success
 
| 73 || IOSCError IOSC_GenerateRand(u8 * randBytes, u32 numBytes); || Write size bytes of random data to data || 0 on success
 
|-
 
|-
| 74 || IOSCError IOSC_GenerateKey(IOSCKeyHandle handle); || Sets contents of keyid to random data
+
| 74 || IOSCError IOSC_GenerateKey(IOSCKeyHandle handle); || Sets contents of <code>handle</code> to random data
 
|-
 
|-
 
| 75 || IOSCError IOSC_GeneratePublicKeySign(u8 * hash, u32 hashLength, IOSCSecretKeyHandle signerHandle, u8 * eccSignature); || Makes an ECC signature || 0 on success
 
| 75 || IOSCError IOSC_GeneratePublicKeySign(u8 * hash, u32 hashLength, IOSCSecretKeyHandle signerHandle, u8 * eccSignature); || Makes an ECC signature || 0 on success
219

edits

Navigation menu