twl_wrapsdk/include/twl/os/common/systemCall.h
nakasima 395c3f4d5e update SVC.
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@303 4ee2a332-4b2b-5046-8439-1ba90f034370
2007-10-22 11:26:01 +00:00

120 lines
3.8 KiB
C

/*---------------------------------------------------------------------------*
Project: TwlSDK - OS - include
File: systemCall.h
Copyright 2007 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Log: $
$NoKeywords: $
*---------------------------------------------------------------------------*/
#ifndef TWL_OS_SYSTEMCALL_H_
#define TWL_OS_SYSTEMCALL_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
u32* head;
u32* tail;
u32 size;
}
SVCSignHeapContext;
typedef struct SVCSHA1Context
{
u32 h0,h1,h2,h3,h4;
u32 Nl,Nh;
u32 data[16];
int num;
void (*sha_block)(struct SVCSHA1Context *c, const u8 *W, int num);
}
SVCSHA1Context;
typedef struct
{
void* output;
const void* input;
const void* key;
}
SVCSignBuffers;
void SVC_InitSignHeap(
SVCSignHeapContext* acmemory_pool,
void* heap,
unsigned int length
);
int SVC_DecryptRSA(
const SVCSignHeapContext* acmemory_pool,
const SVCSignBuffers* pData,
unsigned int* len // 出力サイズ
);
int SVC_DecryptSign(
const SVCSignHeapContext* acmemory_pool,
void* buffer, // 出力領域
const void* sgn_ptr, // データへのポインタ
const void* key_ptr // キーへのポインタ
);
int SVC_DecryptSignDER(
const SVCSignHeapContext* acmemory_pool,
void* buffer, // 出力領域
const void* sgn_ptr, // データへのポインタ
const void* key_ptr // キーへのポインタ
);
void SVC_SHA1Init( SVCSHA1Context *ctx );
void SVC_SHA1Update( SVCSHA1Context *ctx, const unsigned char *data, unsigned long len );
void SVC_SHA1GetHash( SVCSHA1Context *ctx, unsigned char *md );
void SVC_CalcSHA1(
void* buffer, // 出力領域
const void* buf, // データへのポインタ
unsigned int len // データの長さ
);
int SVC_CompareSHA1(
const void* decedHash, // SVC_Decrypto*の出力
const void* digest // SVC_GetDigestの出力
);
int SVC_RandomSHA1(
void* dest_ptr, // 出力データへのポインタ
unsigned int dest_len, // 出力データの長さ
const void* src_ptr, // 入力データへのポインタ
unsigned int src_len // 入力データの長さ
);
int SVC_UncompressLZ8FromDevice( const void* srcp,
void* destp,
const void* paramp,
const MIReadStreamCallbacks *callbacks
);
int SVC_UncompressLZ16FromDeviceIMG( const void* srcp,
void* destp,
const void* paramp,
const MIReadStreamCallbacks *callbacks
);
#ifdef __cplusplus
} /* extern "C" */
#endif
/* TWL_OS_SYSTEMCALL_H_ */
#endif