vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceSblDmac5EncDecParam
 
struct  SceSblDmac5HashTransformParam
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x18, SceSblDmac5EncDecParam)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceSblDmac5HashTransformParam)
 
int sceSblDmac5EncDec (SceSblDmac5EncDecParam *param, SceUInt32 command)
 Execute DMAC5 encdec command.
 
int sceSblDmac5EncDecKeyGen (const SceSblDmac5EncDecParam *param, SceUInt32 key_id, SceUInt32 command)
 Execute a user-mode DMAC5 cipher operation using an AuthMgr-derived key.
 
int sceSblDmac5HashTransform (SceSblDmac5HashTransformParam *param, SceUInt32 command, SceUInt32 flags)
 Execute DMAC5 hash transform command.
 
int sceSblDmac5HmacKeyGen (const SceSblDmac5HashTransformParam *param, SceUInt32 key_id, SceUInt32 command, SceUInt32 flags)
 Execute a user-mode keyed DMAC5 hash operation using an AuthMgr-derived key.
 

Variables

const void * SceSblDmac5EncDecParam::src
 Input buffer.
 
void * SceSblDmac5EncDecParam::dst
 Output buffer.
 
SceSize SceSblDmac5EncDecParam::length
 Length of the input data.
 
const void * SceSblDmac5EncDecParam::key
 Key data.
 
SceSize SceSblDmac5EncDecParam::keysize
 Key size in bits.
 
void * SceSblDmac5EncDecParam::iv
 Initialization vector.
 
const void * SceSblDmac5HashTransformParam::src
 Input buffer.
 
void * SceSblDmac5HashTransformParam::dst
 Output buffer.
 
SceSize SceSblDmac5HashTransformParam::length
 Length of the input data.
 
const void * SceSblDmac5HashTransformParam::key
 Key data.
 
SceSize SceSblDmac5HashTransformParam::keysize
 Key size in bits.
 
void * SceSblDmac5HashTransformParam::ctx
 Pointer to a SceSblDmac5HashTransformContext, or a SceSblDmac5AesCmacContext for AES-CMAC.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:

#include <psp2/dmac5.h>


Link the library to the executable:

SceSblSsMgr_stub




Data Structure Documentation

◆ SceSblDmac5EncDecParam

struct SceSblDmac5EncDecParam
Data Fields
const void * src Input buffer.
void * dst Output buffer.
SceSize length Length of the input data.
const void * key Key data.
SceSize keysize Key size in bits.
void * iv Initialization vector.

◆ SceSblDmac5HashTransformParam

struct SceSblDmac5HashTransformParam
Data Fields
const void * src Input buffer.
void * dst Output buffer.
SceSize length Length of the input data.
const void * key Key data.
SceSize keysize Key size in bits.
void * ctx Pointer to a SceSblDmac5HashTransformContext, or a SceSblDmac5AesCmacContext for AES-CMAC.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/2]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceSblDmac5EncDecParam   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/2]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceSblDmac5HashTransformParam   
)

◆ sceSblDmac5EncDec()

int sceSblDmac5EncDec ( SceSblDmac5EncDecParam *  param,
SceUInt32  command 
)

Execute DMAC5 encdec command.

Parameters
[in]param- Operation parameters. The destination and IV buffers they point to are written.
[in]command- The DMAC5 encdec command.
Returns
0 on success, else < 0.

◆ sceSblDmac5EncDecKeyGen()

int sceSblDmac5EncDecKeyGen ( const SceSblDmac5EncDecParam *  param,
SceUInt32  key_id,
SceUInt32  command 
)

Execute a user-mode DMAC5 cipher operation using an AuthMgr-derived key.

The calling process must be a system program. Key sizes of 128 and 256 bits are supported on FW 3.60. A 192-bit size passes this wrapper's validation but is rejected by the AuthMgr key loader. CBC and CTR operations read their 16-byte IV from SceSblDmac5EncDecParam::iv and replace it with the updated IV.

Parameters
[in]param- Required operation parameters. The structure is only read; the destination and IV buffers it points to are written.
[in]key_id- AuthMgr key identifier.
[in]command- DMAC5 cipher command word.
Returns
0 on success, < 0 on error.

◆ sceSblDmac5HashTransform()

int sceSblDmac5HashTransform ( SceSblDmac5HashTransformParam *  param,
SceUInt32  command,
SceUInt32  flags 
)

Execute DMAC5 hash transform command.

Parameters
[in]param- Operation parameters. The destination and context buffers they point to may be written.
[in]command- The DMAC5 hash base command.
[in]flags- Bitwise OR of SceSblDmac5HashFlag values. Use 0 for a complete one-shot operation, 0x400 for the first streaming chunk, 0xC00 for an intermediate chunk, and 0x800 for the final chunk.
Returns
0 on success, else < 0.

◆ sceSblDmac5HmacKeyGen()

int sceSblDmac5HmacKeyGen ( const SceSblDmac5HashTransformParam *  param,
SceUInt32  key_id,
SceUInt32  command,
SceUInt32  flags 
)

Execute a user-mode keyed DMAC5 hash operation using an AuthMgr-derived key.

The calling process must be a system program and SceSblDmac5HashTransformParam::src must be 0x40-byte aligned. The key size must be 128 or 256 bits. SHA-family commands use a 0x28-byte SceSblDmac5HashTransformContext; AES-CMAC uses a 0x10-byte SceSblDmac5AesCmacContext.

Parameters
[in]param- Required operation parameters. The structure is only read; the output and context buffers it points to may be written.
[in]key_id- AuthMgr key identifier.
[in]command- DMAC5 hash or MAC command word.
[in]flags- Bitwise OR of SceSblDmac5HashFlag values.
Returns
0 on success, < 0 on error.

Variable Documentation

◆ src [1/2]

const void* SceSblDmac5EncDecParam::src

Input buffer.

◆ dst [1/2]

void* SceSblDmac5EncDecParam::dst

Output buffer.

◆ length [1/2]

SceSize SceSblDmac5EncDecParam::length

Length of the input data.

◆ key [1/2]

const void* SceSblDmac5EncDecParam::key

Key data.

◆ keysize [1/2]

SceSize SceSblDmac5EncDecParam::keysize

Key size in bits.

◆ iv

void* SceSblDmac5EncDecParam::iv

Initialization vector.

◆ src [2/2]

const void* SceSblDmac5HashTransformParam::src

Input buffer.

◆ dst [2/2]

void* SceSblDmac5HashTransformParam::dst

Output buffer.

◆ length [2/2]

SceSize SceSblDmac5HashTransformParam::length

Length of the input data.

◆ key [2/2]

const void* SceSblDmac5HashTransformParam::key

Key data.

◆ keysize [2/2]

SceSize SceSblDmac5HashTransformParam::keysize

Key size in bits.

◆ ctx

void* SceSblDmac5HashTransformParam::ctx