SPL services: Difference between revisions
| No edit summary | |||
| Line 33: | Line 33: | ||
| | 7 || [[#GetRandomBytes]] || Uses [[SMC#GetRandomBytes|GetRandomBytes SMC]]. | | 7 || [[#GetRandomBytes]] || Uses [[SMC#GetRandomBytes|GetRandomBytes SMC]]. | ||
| |- | |- | ||
| | 9 || [[# | | 9 || [[#DecryptImportPrivkForRsaOaep]] || Speculative name. Wrapper for [[SMC#LoadRsaPublicKey|LoadRsaPublicKey SMC]]. | ||
| |- | |- | ||
| | 10 || [[# | | 10 || [[#DecryptRsaOaep]] || Speculative name. Uses [[SMC#PublicRsa|PublicRsa SMC]]. | ||
| |- | |- | ||
| | 11 || [[#IsDevelopment]] || | | 11 || [[#IsDevelopment]] || | ||
| Line 187: | Line 187: | ||
| Any other '''ConfigItem''', besides 13, can't be set. | Any other '''ConfigItem''', besides 13, can't be set. | ||
| ==  | == DecryptImportPrivkForRsaOaep == | ||
| Takes one type-9 (X descriptor) buffer ('''enc_privk_in_buf'''), a 16-byte KEK ('''key_x'''), a 16-byte key ('''key_y''') and a u32 ('''version'''). | Takes one type-9 (X descriptor) buffer ('''enc_privk_in_buf'''), a 16-byte KEK ('''key_x'''), a 16-byte key ('''key_y''') and a u32 ('''version'''). | ||
| '''version''' is 0 for normal keys or 1 for extended keys. | '''version''' is 0 for normal keys or 1 for extended keys. | ||
| Line 193: | Line 193: | ||
| Decrypts '''enc_privk_in_buf''' with a key generated from '''key_x''' and '''key_y''' and imports it for later usage. | Decrypts '''enc_privk_in_buf''' with a key generated from '''key_x''' and '''key_y''' and imports it for later usage. | ||
| ==  | == DecryptRsaOaep == | ||
| Takes one type-10 (C descriptor) buffer ('''data_out_buf''') and 3 type-9 (X descriptor) buffers ('''data_in_buf''', ''' | Takes one type-10 (C descriptor) buffer ('''data_out_buf''') and 3 type-9 (X descriptor) buffers ('''data_in_buf''', '''mod_in_buf''' and '''label_hash_in_buf'''). | ||
| Decrypts '''data_in_buf''' into '''data_out_buf''' using the private key imported with [[# | Decrypts '''data_in_buf''' into '''data_out_buf''' using the private key imported with [[#DecryptImportPrivkForRsaOaep]] and the supplied '''mod_in_buf'''. Afterwards, verifies RSA-OAEP encoding using '''label_hash_in_buf'''. | ||
| Returns  | Returns an u32 ('''dec_data_size'''). | ||
| == IsDevelopment == | == IsDevelopment == | ||
| Line 211: | Line 211: | ||
| '''KeyGeneration''' ranges from 0 to 2. | '''KeyGeneration''' ranges from 0 to 2. | ||
| Returns a scrambled  | Returns a scrambled key ('''key_a'''). | ||
| == DecryptPrivk == | == DecryptPrivk == | ||
| Line 250: | Line 250: | ||
| == ExpMod1 == | == ExpMod1 == | ||
| Takes 3 type-9 (X descriptor) buffers ('''data_in_buf''', ''' | Takes 3 type-9 (X descriptor) buffers ('''data_in_buf''', '''mod_in_buf''' and '''param0_in_buf'''). | ||
| Decrypts '''data_in_buf''' using the private key imported with [[#DecryptImportPrivkForExpMod1]] and the supplied  | Decrypts '''data_in_buf''' using the private key imported with [[#DecryptImportPrivkForExpMod1]] and the supplied '''mod_in_buf''' and '''param0_in_buf'''. | ||
| Generates and returns a 16-byte key ('''key_z'''). | Generates and returns a 16-byte key ('''key_z'''). | ||