1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<!--========================================================================== 3 Copyright 2008 Nintendo. All rights reserved. 4 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 ==========================================================================--> 11<HTML> 12<HEAD> 13 <META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 14 <META http-equiv="Content-Style-Type" content="text/css"> 15 <TITLE>CRYPTO_SetMemAllocator</TITLE> 16 <LINK rel="stylesheet" href="../../css/nitro.css"> 17 <BASE target="main"> 18</HEAD> 19<BODY> 20<H1>CRYPTO_SetMemAllocator <IMG src="../../image/NTR.gif" width="23" height="12" border="0" align="middle"><IMG src="../../image/TWL.gif" width="23" height="12" border="0" align="middle"></H1> 21 22<H2>Syntax</H2> 23<DL> 24 <DD> 25 <PRE><CODE> 26#include <nitro/crypto.h> 27 28void CRYPTO_SetMemAllocator( 29void* (*alloc) (u32), 30void (*free) (void*), 31void* (*realloc) (void*,u32,u32) 32); 33 </CODE></PRE> 34 </DD> 35</DL> 36 37<H2>Arguments</H2> 38<TABLE border="1"> 39 <TBODY> 40 <TR> 41 <TD width="25%"><EM><STRONG><CODE>alloc</CODE></STRONG></EM></TD> 42 <TD width="75%">Pointer to the memory allocation function.</TD> 43 </TR> 44 <TR> 45 <TD><EM><STRONG><CODE>free</CODE></STRONG></EM></TD> 46 <TD>Pointer to the memory release function.</TD> 47 </TR> 48 <TR> 49 <TD><EM><STRONG><CODE>realloc</CODE></STRONG></EM></TD> 50 <TD>Pointer to the memory size changing function.</TD> 51 </TR> 52 </TBODY> 53</TABLE> 54 55<H2>Return Values</H2> 56<P> 57 None. 58</P> 59 60<H2>Description</H2> 61<P> 62 Sets the dynamic memory management functions for the CRYPTO library.<BR> 63 If these are not set, <CODE><a href="../../os/alloc/OS_AllocFromHeap.html">OS_Alloc</a></CODE>, <CODE><a href="../../os/alloc/OS_FreeToHeap.html">OS_Free</a></CODE>, and the memory size changing function implemented using these functions will be used by default.<BR> 64 Specifying NULL for the <EM><STRONG><CODE>alloc</CODE></STRONG></EM>, <EM><STRONG><CODE>free</CODE></STRONG></EM>, and <EM><STRONG><CODE>realloc</CODE></STRONG></EM> arguments results in default settings. 65</P> 66<P> 67 When using the digital signature functions (the <code>CRYPTO_VerifySignature*</code> functions), <EM><STRONG><CODE>alloc</CODE></STRONG></EM> and <EM><STRONG><CODE>free</CODE></STRONG></EM> are used. When using RSA the encryption functions (the <CODE>CRYPTO_RSA_*</CODE> functions), <EM><STRONG><CODE>alloc</CODE></STRONG></EM>, <EM><STRONG><CODE>free</CODE></STRONG></EM>, and <EM><STRONG><CODE>realloc</CODE></STRONG></EM> are used. 68</P> 69 70<H2>See Also</H2> 71<P> 72 <CODE> 73 <A href="CRYPTO_SetAllocator.html">CRYPTO_SetAllocator</A> 74 </CODE> 75</P> 76 77<H2>Revision History</H2> 78<P> 79 2008/03/27 Initial version. 80</P> 81 82<hr><p>CONFIDENTIAL</p></body> 83</HTML> 84