Files

45 lines
7.2 KiB
HTML

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>crypt.h</title><link rel="stylesheet" type="text/css" href="../styles/main.css" /><script type="text/javascript" src="../styles/main.js"></script><script type="text/javascript">NDLoader.LoadJS("Content", "../styles/");</script></head>
<!-- Generated by Natural Docs, version 2.2 -->
<!-- saved from url=(0016)http://localhost -->
<body onload="NDLoader.OnLoad('Content');" class="NDPage NDContentPage">
<a name="Functions"></a><a name="Topic1418"></a><div class="CTopic TGroup LC first">
<div class="CTitle">Functions</div>
</div>
<a name="Crypt_SetKey"></a><a name="Topic1419"></a><div class="CTopic TFunction LC">
<div class="CTitle">Crypt_SetKey</div>
<div id="NDPrototype1419" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> Crypt_SetKey(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType">c8*&nbsp;</td><td class="PName last">key</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the encryption key Call to this function is mandatory before calling <a href="../index.html#File:crypt.h:Crypt_Encode" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,1422);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >Crypt_Encode</a> or <a href="../index.html#File:crypt.h:Crypt_Decode" target="_top" onmouseover="NDContentPage.OnLinkMouseOver(event,1423);" onmouseout="NDContentPage.OnLinkMouseOut(event);" >Crypt_Decode</a> functions.</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">key<div class="CDLParameterType"><span class="SHKeyword">const</span> c8*</div></td><td class="CDLDefinition"><p>Zero-terminated string that contain the key</p></td></tr></table></div>
</div>
<a name="Crypt_SetMap"></a><a name="Topic1420"></a><div class="CTopic TFunction LC">
<div class="CTitle">Crypt_SetMap</div>
<div id="NDPrototype1420" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> Crypt_SetMap(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType">c8*&nbsp;</td><td class="PName last">map</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the encryption character mapping table Not mandatory (default one will be use instead).</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">map<div class="CDLParameterType"><span class="SHKeyword">const</span> c8*</div></td><td class="CDLDefinition"><p>Zero-terminated string that contain the character mapping table (should be 16, 32 or 64 charater long depending on number of bit per character used)</p></td></tr></table></div>
</div>
<a name="Crypt_SetCode"></a><a name="Topic1421"></a><div class="CTopic TFunction LC">
<div class="CTitle">Crypt_SetCode</div>
<div id="NDPrototype1421" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">inline</span> <span class="SHKeyword">void</span> Crypt_SetCode(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType">u16*&nbsp;</td><td class="PName last">code</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Set the encryption code bit field Not mandatory (default one will be use instead).</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">code<div class="CDLParameterType"><span class="SHKeyword">const</span> u16*</div></td><td class="CDLDefinition"><p>Array of 8 entries of 16-bit number that map each bit into 2 characters</p></td></tr></table></div>
</div>
<a name="Crypt_Encode"></a><a name="Topic1422"></a><div class="CTopic TFunction LC">
<div class="CTitle">Crypt_Encode</div>
<div id="NDPrototype1422" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">bool</span> Crypt_Encode(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType"><span class="SHKeyword">void</span>*&nbsp;</td><td class="PName last">data,</td></tr><tr><td class="first"></td><td class="PType">u8&nbsp;</td><td class="PName last">size,</td></tr><tr><td class="first"></td><td class="PType">c8*&nbsp;</td><td class="PName last">str</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Encrypt data</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">data<div class="CDLParameterType"><span class="SHKeyword">const</span> <span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Source data buffer</p></td></tr><tr><td class="CDLEntry">size<div class="CDLParameterType">u8</div></td><td class="CDLDefinition"><p>Size of the data buffer</p></td></tr><tr><td class="CDLEntry">str<div class="CDLParameterType">c8*</div></td><td class="CDLDefinition"><p>Destination string buffer (size must be: input data size x 2 + 1).</p></td></tr></table><div class="CHeading">Returns</div><p>FALSE if encoding failed</p></div>
</div>
<a name="Crypt_Decode"></a><a name="Topic1423"></a><div class="CTopic TFunction LC last">
<div class="CTitle">Crypt_Decode</div>
<div id="NDPrototype1423" class="NDPrototype WideForm"><div class="PSection PParameterSection CStyle"><table><tr><td class="PBeforeParameters"><span class="SHKeyword">bool</span> Crypt_Decode(</td><td class="PParametersParentCell"><table class="PParameters"><tr><td class="PModifierQualifier first"><span class="SHKeyword">const</span>&nbsp;</td><td class="PType">c8*&nbsp;</td><td class="PName last">str,</td></tr><tr><td class="first"></td><td class="PType"><span class="SHKeyword">void</span>*&nbsp;</td><td class="PName last">data</td></tr></table></td><td class="PAfterParameters">)</td></tr></table></div></div>
<div class="CBody"><p>Decrypt data</p><div class="CHeading">Parameters</div><table class="CDefinitionList"><tr><td class="CDLEntry">str<div class="CDLParameterType"><span class="SHKeyword">const</span> c8*</div></td><td class="CDLDefinition"><p>Source string</p></td></tr><tr><td class="CDLEntry">data<div class="CDLParameterType"><span class="SHKeyword">void</span>*</div></td><td class="CDLDefinition"><p>Destination data buffer&nbsp; (size must be: length of the string / 2).</p></td></tr></table><div class="CHeading">Returns</div><p>FALSE if decoding failed</p></div>
</div>
</body></html>