1 /*---------------------------------------------------------------------------* 2 Project: TwlSDK - MATH - include 3 File: dgt.h 4 5 Copyright 2003-2008 Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Date:: 2008-09-18#$ 14 $Rev: 8573 $ 15 $Author: okubata_ryoma $ 16 *---------------------------------------------------------------------------*/ 17 #ifndef NITRO_LIBRARIES_MATH_COMMON_HMAC_H_ 18 #define NITRO_LIBRARIES_MATH_COMMON_HMAC_H_ 19 20 #include <nitro/types.h> 21 22 typedef struct MATHiHMACFuncs { 23 const u32 dlength; 24 const u32 blength; 25 void *context; 26 u8 *hash_buf; 27 void (*HashReset)(void*); 28 void (*HashSetSource)(void*, const void*, u32); 29 void (*HashGetDigest)(void*, void*); 30 } MATHiHMACFuncs; 31 32 33 /*---------------------------------------------------------------------------* 34 Name: MATHi_CalcHMAC 35 36 Description: Uses HMAC to calculate a MAC value. 37 38 Arguments: mac: Stores the intended MAC value 39 message: Message data 40 message_length: Message data length 41 key: Key 42 key_length: Key length 43 funcs: Hash function structures used by HMAC 44 45 Returns: None. 46 *---------------------------------------------------------------------------*/ 47 void MATHi_CalcHMAC(void *mac, const void *message, u32 message_length, 48 const void *key, u32 key_length, 49 MATHiHMACFuncs *funcs); 50 51 #endif // ifndef NITRO_LIBRARIES_MATH_COMMON_HMAC_H_ 52