<html><head><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><linkrel="shortcut icon"href="../icons/favicon.ico"/><linkrel="stylesheet"type="text/css"href="../styles/branding.css"/><linkrel="stylesheet"type="text/css"href="../styles/branding-en-US.css"/><scripttype="text/javascript"src="../scripts/branding.js"></script><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>gmp_lib.mpn_cnd_sub_n Method </title><metaname="Language"content="en-us"/><metaname="System.Keywords"content="mpn_cnd_sub_n method"/><metaname="System.Keywords"content="gmp_lib.mpn_cnd_sub_n method"/><metaname="Microsoft.Help.F1"content="Math.Gmp.Native.gmp_lib.mpn_cnd_sub_n"/><metaname="Microsoft.Help.Id"content="M:Math.Gmp.Native.gmp_lib.mpn_cnd_sub_n(Math.Gmp.Native.mp_limb_t,Math.Gmp.Native.mp_ptr,Math.Gmp.Native.mp_ptr,Math.Gmp.Native.mp_ptr,Math.Gmp.Native.mp_size_t)"/><metaname="Description"content="If is non-zero, it produces the same result as a regular mpn_sub_n, and if is zero, it copies {, } to the result area and returns zero."/><metaname="Microsoft.Help.ContentType"content="Reference"/><metaname="BrandingAware"content="true"/><metaname="container"content="Math.Gmp.Native"/><metaname="file"content="b82bad6a-f8f0-db53-a6d3-ed6002046257"/><metaname="guid"content="b82bad6a-f8f0-db53-a6d3-ed6002046257"/><linktype="text/css"rel="stylesheet"href="../styles/highlight.css"/><scripttype="text/javascript"src="../scripts/highlight.js"></script><linkrel="stylesheet"type="text/css"href="../styles/branding-Website.css"/><scripttype="text/javascript"src="../scripts/jquery-1.11.0.min.js"></script><scripttype="text/javascript"src="../scripts/branding-Website.js"></script><scripttype="text/javascript"src="../scripts/clipboard.min.js"></script></head><bodyonload="OnLoad('cs')"><inputtype="hidden"id="userDataCache"class="userDataStyle"/><divclass="pageHeader"id="PageHeader">GMP Native Interface for .NET<formid="SearchForm"method="get"action="#"onsubmit="javascript:TransferToSearchPage(); return false;"><inputid="SearchTextBox"type="text"maxlength="200"/><buttonid="SearchButton"type="submit"></button></form></div><divclass="pageBody"><divclass="leftNav"id="leftNav"><divid="tocNav"><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="846f5c8a-6cba-433e-9f18-cde2ff5695cd.htm"title="GMP Native Interface for .NET"tocid="roottoc">GMP Native Interface for .NET</a></div><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm"title="Math.Gmp.Native"tocid="d9c51b9f-0c54-770b-28ea-6eebd8fef368">Math.Gmp.Native</a></div><divclass="toclevel0"data-toclevel="0"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"title="gmp_lib Class"tocid="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f">gmp_lib Class</a></div><divclass="toclevel1"data-toclevel="1"data-childrenloaded="true"><aclass="tocExpanded"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="0fa7cbf3-e8f4-6b14-d829-8aa663e77c74.htm"title="gmp_lib Methods"tocid="0fa7cbf3-e8f4-6b14-d829-8aa663e77c74">gmp_lib Methods</a></div><divclass="toclevel2"data-toclevel="2"><adata-tochassubtree="false"href="c9cb6a67-59b8-5c03-f31d-f252441c53f6.htm"title="_mpz_realloc Method "tocid="c9cb6a67-59b8-5c03-f31d-f252441c53f6">_mpz_realloc Method </a></div><divclass="toclevel2"data-toclevel="2"><adata-tochassubtree="false"href="2c68671c-cd5c-e2ec-52a2-65b0ca31c3d1.htm"title="allocate Method "tocid="2c68671c-cd5c-e2ec-52a2-65b0ca31c3d1">allocate Method </a></div><divclass="toclevel2"data-toclevel="2"><aclass="tocCollapsed"onclick="javascript: Toggle(this);"href="#!"/><adata-tochassubtree="true"href="92160da3-b1af-e005-cb05-e3fb4dd524d8.htm"title="freeMet
If <spanclass="parameter">cnd</span> is non-zero, it produces the same result as a regular <ahref="b104184e-cf49-dbdb-764a-9dee5cf7b2fd.htm">mpn_sub_n</a>, and if <spanclass="parameter">cnd</span> is zero, it copies {<spanclass="parameter">s1p</span>, <spanclass="parameter">n</span>} to the result area and returns zero.
</pre></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDCA");</script><h4class="subHeading">Parameters</h4><dl><dt><spanclass="parameter">cnd</span></dt><dd>Type:<ahref="bf1f694d-f9b2-6413-12e5-ebae603d5b49.htm">Math.Gmp.Native<spanid="LSTEABE3FE_1"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTEABE3FE_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_limb_t</a><br/>Conditonal value: non-zero for true, zero for false.</dd><dt><spanclass="parameter">rp</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LSTEABE3FE_2"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTEABE3FE_2?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The result integer.</dd><dt><spanclass="parameter">s1p</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LSTEABE3FE_3"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTEABE3FE_3?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The first operand integer.</dd><dt><spanclass="parameter">s2p</span></dt><dd>Type:<ahref="4609ac5e-5cf9-cd20-2fa9-8040101c165c.htm">Math.Gmp.Native<spanid="LSTEABE3FE_4"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTEABE3FE_4?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_ptr</a><br/>The second operand integer.</dd><dt><spanclass="parameter">n</span></dt><dd>Type:<ahref="4b58a584-7a0e-b600-18fa-ebd493861eb3.htm">Math.Gmp.Native<spanid="LSTEABE3FE_5"></span><scripttype="text/javascript">AddLanguageSpecificTextSet("LSTEABE3FE_5?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>mp_size_t</a><br/>The number of limbs of <spanclass="parameter">s1p</span> and <spanclass="parameter">s2p</span>.</dd></dl><h4class="subHeading">Return Value</h4>Type:<ahref="bf1f694d-f9b2-6413-12e5-ebae603d5b49.htm">mp_limb_t</a><br/>If <spanclass="parameter">cnd</span> is non-zero, return borrow, either 0 or 1, and if <spanclass="parameter">cnd</span> is zero, return 0.</div><divclass="collapsibleAreaRegion"><spanclass="collapsibleRegionTitle"onclick="SectionExpandCollapse('ID2RB')"onkeypress="SectionExpandCollapse_CheckKey('ID2RB', event)"tabindex="0"><imgid="ID2RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>Remarks</span></div><divid="ID2RBSection"class="collapsibleSection"><p>
If <spanclass="parameter">cnd</span> is non-zero, it produces the same result as a regular <ahref="b104184e-cf49-dbdb-764a-9dee5cf7b2fd.htm">mpn_sub_n</a>,
and if <spanclass="parameter">cnd</span> is zero, it copies {<spanclass="parameter">s1p</span>, <spanclass="parameter">n</span>} to the result area and returns zero.
The functions is designed to have timing and memory access patterns depending only
on size and location of the data areas, but independent of the condition <spanclass="parameter">cnd</span>.
mp_ptr rp = <spanclass="highlight-keyword">new</span> mp_ptr(<spanclass="highlight-keyword">new</span><spanclass="highlight-keyword">uint</span>[<spanclass="highlight-number">2</span>]);
mp_ptr result = <spanclass="highlight-keyword">new</span> mp_ptr(<spanclass="highlight-keyword">new</span><spanclass="highlight-keyword">uint</span>[] { <spanclass="highlight-number">0xfffffffe</span>, <spanclass="highlight-number">0xffffffff</span> });
<spanclass="highlight-comment">// Set rp = s1 - s2.</span>
gmp_lib.free(rp, s1p, s2p, result)</pre></div><divid="ID0EDAABA_code_Div3"class="codeSnippetContainerCode"style="display: none"><p>No code example is currently available or this language may not be supported.</p></div><divid="ID0EDAABA_code_Div4"class="codeSnippetContainerCode"style="display: none"><p>No code example is currently available or this language may not be supported.</p></div></div></div><scripttype="text/javascript">AddLanguageTabSet("ID0EDAABA");</script></div><divclass="collapsibleAreaRegion"id="seeAlsoSection"><spanclass="collapsibleRegionTitle"onclick="SectionExpandCollapse('ID4RB')"onkeypress="SectionExpandCollapse_CheckKey('ID4RB', event)"tabindex="0"><imgid="ID4RBToggle"class="collapseToggle"src="../icons/SectionExpanded.png"/>See Also</span></div><divid="ID4RBSection"class="collapsibleSection"><h4class="subHeading">Reference</h4><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm">gmp_lib Class</a></div><divclass="seeAlsoStyle"><ahref="d9c51b9f-0c54-770b-28ea-6eebd8fef368.htm">Math.Gmp.Native Namespace</a></div><divclass="seeAlsoStyle"><ahref="27902901-3a7d-b5b3-d3fc-3900f754bff1.htm">mpn_cnd_add_n</a></div><divclass="seeAlsoStyle"><ahref="1555cd52-98d2-6253-214a-d342a539bfb5.htm">mpn_sec_add_1</a></div><divclass="seeAlsoStyle"><ahref="9137a632-abd2-7963-1991-85e6d753bf13.htm">mpn_sec_sub_1</a></div><divclass="seeAlsoStyle"><ahref="f0985ccc-17da-8a0b-066c-53df9b1921a1.htm">mpn_cnd_swap</a></div><divclass="seeAlsoStyle"><ahref="028e92d4-3699-77ff-e8da-9ff4c367f5b3.htm">mpn_sec_mul</a></div><divclass="seeAlsoStyle"><ahref="bfe1e9b5-6fc1-95f2-d5b6-137fe87c071a.htm">mpn_sec_sqr</a></div><divclass="seeAlsoStyle"><ahref="a38b87c5-c6ac-fa68-6d58-c45793bf933e.htm">mpn_sec_powm</a></div><divclass="seeAlsoStyle"><ahref="3588cf60-567a-6182-20e8-5e2836498f49.htm">mpn_sec_tabselect</a></div><divclass="seeAlsoStyle"><ahref="6f1dca2b-39f4-3acd-71fb-4f1e5a0d04e6.htm">mpn_sec_div_qr</a></div><divclass="seeAlsoStyle"><ahref="094ea390-8cc8-bac7-35c3-3616775736de.htm">mpn_sec_div_r</a></div><divclass="seeAlsoStyle"><ahref="62ffb793-b32f-e0dc-a399-f20fe708a803.htm">mpn_sec_invert</a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="/Math.Gmp.Native/html/3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm#Low_level_functions_for_cryptography">Low-level functions for cryptography</a></a></div><divclass="seeAlsoStyle"><ahref="3af6b34c-3242-2b75-e7c7-ab79af8a4b0f.htm"><ahref="https://gmplib.org/manual/Low_002dlevel-Functions.html#Low_002dlevel-Functions">GNU MP - Low-level Functions</a></a></div></div></div></div><divid="pageFooter"class="pageFooter"></div></body></html>