PSPXI:EncryptDecryptAes

PSPXI:EncryptDecryptAes

Request #

Index WordDescription
0Header code [0x000401C4]
1Size in bytes
2-5IV / CTR
6u8 Algorithm Type (0..5)
7u8 Key Type (0..7)
8(size<<8) | 0x4
9Source pointer
10(size<<8) | 0x14
11Destination pointer

Response #

Index WordDescription
0Header code [0x00040140]
1Result code
2-5Output IV / CTR: this is the IV/CTR which would be used if the crypto operation were to continue.

Algorithm Types #

TypeDescription
0CBC Encrypt
1CBC Decrypt
2CTR Encrypt
3CTR Decrypt
4CCM Encrypt
5CCM Decrypt

Key Types #

TypeAES Engine KeyslotDescription
00x0DUsed to decrypt the SSL client cert/private-key stored in ClCertA.
10x2DUsed to generate the UDS local-WLAN CCMP key.
20x31This is used by NS for the APT AES-CCM Wrap/Unwrap commands. These two NS commands are used by the Mii Maker application for the encrypted Mii data in the Mii QR codes.
30x38BOSS
40x32?
50x39This is used by the Download Play module for calculating a 32bit checksum over the entire UDS application data-fames, stored in the DLP data-frame header.
60x2EThis is used by the StreetPass CECD module to generate the CCMP key passed to nwm::CEC commands, when beginning StreetPass communications.
7Invalid
80x36This is used by the friends module.

Support for this keytype was added with the NATIVE_FIRM updated with 2.2.0-X. When the running NATIVE_FIRM doesn't support this keytype, the result is the same as using keytype7.

90x39This is used by the NFC module.

Support for this keytype was added with the NATIVE_FIRM updated with 9.3.0-X. When the running NATIVE_FIRM doesn't support this keytype, the result is the same as using keytype7. Before selecting this keyslot, Process9 writes a keyY from the Process9 .(ro)data section(keydata is different for retail/dev units) to this keyslot. Once finished with crypto, Process9 restores the original keyY to this keyslot.

>=10Invalid, same as keytype7.

Description #

This is used to encrypt/decrypt data via the AES engine. AES-CCM is not supported by this command, PSPXI:EncryptSignDecryptVerifyAesCcm must be used for AES-CCM instead.