<refentry id="xmlsec-bn">
<refmeta>
<refentrytitle role="top_of_page" id="xmlsec-bn.top_of_page">bn</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>XMLSEC Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>bn</refname>
<refpurpose>Big numbers support functions.</refpurpose>
</refnamediv>

<refsynopsisdiv id="xmlsec-bn.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
enum                <link linkend="xmlSecBnFormat">xmlSecBnFormat</link>;
<link linkend="xmlSecBn">xmlSecBnPtr</link>         <link linkend="xmlSecBnCreate">xmlSecBnCreate</link>                      (<link linkend="xmlSecSize">xmlSecSize</link> size);
<link linkend="void">void</link>                <link linkend="xmlSecBnDestroy">xmlSecBnDestroy</link>                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="int">int</link>                 <link linkend="xmlSecBnInitialize">xmlSecBnInitialize</link>                  (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> size);
<link linkend="void">void</link>                <link linkend="xmlSecBnFinalize">xmlSecBnFinalize</link>                    (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="xmlSecByte">xmlSecByte</link>*         <link linkend="xmlSecBnGetData">xmlSecBnGetData</link>                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="int">int</link>                 <link linkend="xmlSecBnSetData">xmlSecBnSetData</link>                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> size);
<link linkend="xmlSecSize">xmlSecSize</link>          <link linkend="xmlSecBnGetSize">xmlSecBnGetSize</link>                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="void">void</link>                <link linkend="xmlSecBnZero">xmlSecBnZero</link>                        (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="int">int</link>                 <link linkend="xmlSecBnFromString">xmlSecBnFromString</link>                  (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlChar">xmlChar</link> *str,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> base);
<link linkend="xmlChar">xmlChar</link>*            <link linkend="xmlSecBnToString">xmlSecBnToString</link>                    (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> base);
<link linkend="int">int</link>                 <link linkend="xmlSecBnFromHexString">xmlSecBnFromHexString</link>               (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlChar">xmlChar</link> *str);
<link linkend="xmlChar">xmlChar</link>*            <link linkend="xmlSecBnToHexString">xmlSecBnToHexString</link>                 (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="int">int</link>                 <link linkend="xmlSecBnFromDecString">xmlSecBnFromDecString</link>               (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlChar">xmlChar</link> *str);
<link linkend="xmlChar">xmlChar</link>*            <link linkend="xmlSecBnToDecString">xmlSecBnToDecString</link>                 (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="int">int</link>                 <link linkend="xmlSecBnMul">xmlSecBnMul</link>                         (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="int">int</link> multiplier);
<link linkend="int">int</link>                 <link linkend="xmlSecBnDiv">xmlSecBnDiv</link>                         (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="int">int</link> divider,
                                                         <link linkend="int">int</link> *mod);
<link linkend="int">int</link>                 <link linkend="xmlSecBnAdd">xmlSecBnAdd</link>                         (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="int">int</link> delta);
<link linkend="int">int</link>                 <link linkend="xmlSecBnReverse">xmlSecBnReverse</link>                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);
<link linkend="int">int</link>                 <link linkend="xmlSecBnCompare">xmlSecBnCompare</link>                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize);
<link linkend="int">int</link>                 <link linkend="xmlSecBnCompareReverse">xmlSecBnCompareReverse</link>              (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize);
<link linkend="int">int</link>                 <link linkend="xmlSecBnGetNodeValue">xmlSecBnGetNodeValue</link>                (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlNode">xmlNodePtr</link> cur,
                                                         <link linkend="xmlSecBnFormat">xmlSecBnFormat</link> format,
                                                         <link linkend="int">int</link> reverse);
<link linkend="int">int</link>                 <link linkend="xmlSecBnSetNodeValue">xmlSecBnSetNodeValue</link>                (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlNode">xmlNodePtr</link> cur,
                                                         <link linkend="xmlSecBnFormat">xmlSecBnFormat</link> format,
                                                         <link linkend="int">int</link> reverse,
                                                         <link linkend="int">int</link> addLineBreaks);
<link linkend="int">int</link>                 <link linkend="xmlSecBnBlobSetNodeValue">xmlSecBnBlobSetNodeValue</link>            (const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlNode">xmlNodePtr</link> cur,
                                                         <link linkend="xmlSecBnFormat">xmlSecBnFormat</link> format,
                                                         <link linkend="int">int</link> reverse,
                                                         <link linkend="int">int</link> addLineBreaks);
</synopsis>
</refsynopsisdiv>









<refsect1 id="xmlsec-bn.description" role="desc">
<title role="desc.title">Description</title>
<para>
Big numbers support functions.
</para>
</refsect1>

<refsect1 id="xmlsec-bn.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="xmlSecBnFormat" role="enum">
<title>enum xmlSecBnFormat</title>
<indexterm zone="xmlSecBnFormat"><primary sortas="xmlSecBnFormat">xmlSecBnFormat</primary></indexterm><programlisting>typedef enum {
    xmlSecBnBase64,
    xmlSecBnHex,
    xmlSecBnDec
} xmlSecBnFormat;
</programlisting>
<para>
The big numbers formats.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="xmlSecBnBase64" role="constant">
<term><literal>xmlSecBnBase64</literal></term>
<listitem><simpara>             the base64 decoded binary blob.
</simpara></listitem>
</varlistentry>
<varlistentry id="xmlSecBnHex" role="constant">
<term><literal>xmlSecBnHex</literal></term>
<listitem><simpara>                the hex number.
</simpara></listitem>
</varlistentry>
<varlistentry id="xmlSecBnDec" role="constant">
<term><literal>xmlSecBnDec</literal></term>
<listitem><simpara>                the decimal number.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnCreate" role="function">
<title>xmlSecBnCreate ()</title>
<indexterm zone="xmlSecBnCreate"><primary sortas="xmlSecBnCreate">xmlSecBnCreate</primary></indexterm><programlisting><link linkend="xmlSecBn">xmlSecBnPtr</link>         xmlSecBnCreate                      (<link linkend="xmlSecSize">xmlSecSize</link> size);</programlisting>
<para>
Creates a new BN object. Caller is responsible for destroying it
by calling <parameter>xmlSecBnDestroy</parameter> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>       the initial allocated BN size.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the newly BN or a NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnDestroy" role="function">
<title>xmlSecBnDestroy ()</title>
<indexterm zone="xmlSecBnDestroy"><primary sortas="xmlSecBnDestroy">xmlSecBnDestroy</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecBnDestroy                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Destroys <parameter>bn</parameter> object created with <parameter>xmlSecBnCreate</parameter> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnInitialize" role="function">
<title>xmlSecBnInitialize ()</title>
<indexterm zone="xmlSecBnInitialize"><primary sortas="xmlSecBnInitialize">xmlSecBnInitialize</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnInitialize                  (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> size);</programlisting>
<para>
Initializes a BN object. Caller is responsible for destroying it
by calling <parameter>xmlSecBnFinalize</parameter> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>       the initial allocated BN size.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnFinalize" role="function">
<title>xmlSecBnFinalize ()</title>
<indexterm zone="xmlSecBnFinalize"><primary sortas="xmlSecBnFinalize">xmlSecBnFinalize</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecBnFinalize                    (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Destroys <parameter>bn</parameter> object created with <parameter>xmlSecBnInitialize</parameter> function.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnGetData" role="function">
<title>xmlSecBnGetData ()</title>
<indexterm zone="xmlSecBnGetData"><primary sortas="xmlSecBnGetData">xmlSecBnGetData</primary></indexterm><programlisting><link linkend="xmlSecByte">xmlSecByte</link>*         xmlSecBnGetData                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Gets pointer to the binary <parameter>bn</parameter> representation.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> pointer to binary BN data or NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnSetData" role="function">
<title>xmlSecBnSetData ()</title>
<indexterm zone="xmlSecBnSetData"><primary sortas="xmlSecBnSetData">xmlSecBnSetData</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnSetData                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> size);</programlisting>
<para>
Sets the value of <parameter>bn</parameter> to <parameter>data</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>       the pointer to new BN binary data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara>       the size of new BN data.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnGetSize" role="function">
<title>xmlSecBnGetSize ()</title>
<indexterm zone="xmlSecBnGetSize"><primary sortas="xmlSecBnGetSize">xmlSecBnGetSize</primary></indexterm><programlisting><link linkend="xmlSecSize">xmlSecSize</link>          xmlSecBnGetSize                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Gets the size of binary data in <parameter>bn</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the size of binary data.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnZero" role="function">
<title>xmlSecBnZero ()</title>
<indexterm zone="xmlSecBnZero"><primary sortas="xmlSecBnZero">xmlSecBnZero</primary></indexterm><programlisting><link linkend="void">void</link>                xmlSecBnZero                        (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Sets the value of <parameter>bn</parameter> to zero.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnFromString" role="function">
<title>xmlSecBnFromString ()</title>
<indexterm zone="xmlSecBnFromString"><primary sortas="xmlSecBnFromString">xmlSecBnFromString</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnFromString                  (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlChar">xmlChar</link> *str,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> base);</programlisting>
<para>
Reads <parameter>bn</parameter> from string <parameter>str</parameter> assuming it has base <parameter>base</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>        the string with BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>base</parameter>&#160;:</term>
<listitem><simpara>       the base for <parameter>str</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnToString" role="function">
<title>xmlSecBnToString ()</title>
<indexterm zone="xmlSecBnToString"><primary sortas="xmlSecBnToString">xmlSecBnToString</primary></indexterm><programlisting><link linkend="xmlChar">xmlChar</link>*            xmlSecBnToString                    (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> base);</programlisting>
<para>
Writes <parameter>bn</parameter> to string with base <parameter>base</parameter>. Caller is responsible for
freeing returned string with <parameter>xmlFree</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>base</parameter>&#160;:</term>
<listitem><simpara>       the base for returned string.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the string represenataion if BN or a NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnFromHexString" role="function">
<title>xmlSecBnFromHexString ()</title>
<indexterm zone="xmlSecBnFromHexString"><primary sortas="xmlSecBnFromHexString">xmlSecBnFromHexString</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnFromHexString               (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlChar">xmlChar</link> *str);</programlisting>
<para>
Reads <parameter>bn</parameter> from hex string <parameter>str</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>        the string with BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnToHexString" role="function">
<title>xmlSecBnToHexString ()</title>
<indexterm zone="xmlSecBnToHexString"><primary sortas="xmlSecBnToHexString">xmlSecBnToHexString</primary></indexterm><programlisting><link linkend="xmlChar">xmlChar</link>*            xmlSecBnToHexString                 (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Writes <parameter>bn</parameter> to hex string. Caller is responsible for
freeing returned string with <parameter>xmlFree</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the string represenataion if BN or a NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnFromDecString" role="function">
<title>xmlSecBnFromDecString ()</title>
<indexterm zone="xmlSecBnFromDecString"><primary sortas="xmlSecBnFromDecString">xmlSecBnFromDecString</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnFromDecString               (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlChar">xmlChar</link> *str);</programlisting>
<para>
Reads <parameter>bn</parameter> from decimal string <parameter>str</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>        the string with BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnToDecString" role="function">
<title>xmlSecBnToDecString ()</title>
<indexterm zone="xmlSecBnToDecString"><primary sortas="xmlSecBnToDecString">xmlSecBnToDecString</primary></indexterm><programlisting><link linkend="xmlChar">xmlChar</link>*            xmlSecBnToDecString                 (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Writes <parameter>bn</parameter> to decimal string. Caller is responsible for
freeing returned string with <parameter>xmlFree</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the string represenataion if BN or a NULL if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnMul" role="function">
<title>xmlSecBnMul ()</title>
<indexterm zone="xmlSecBnMul"><primary sortas="xmlSecBnMul">xmlSecBnMul</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnMul                         (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="int">int</link> multiplier);</programlisting>
<para>
Multiplies <parameter>bn</parameter> with <parameter>multiplier</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>                 the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>multiplier</parameter>&#160;:</term>
<listitem><simpara>         the multiplier.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnDiv" role="function">
<title>xmlSecBnDiv ()</title>
<indexterm zone="xmlSecBnDiv"><primary sortas="xmlSecBnDiv">xmlSecBnDiv</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnDiv                         (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="int">int</link> divider,
                                                         <link linkend="int">int</link> *mod);</programlisting>
<para>
Divides <parameter>bn</parameter> by <parameter>divider</parameter> and places modulus into <parameter>mod</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>divider</parameter>&#160;:</term>
<listitem><simpara>    the divider
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mod</parameter>&#160;:</term>
<listitem><simpara>        the pointer for modulus result.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnAdd" role="function">
<title>xmlSecBnAdd ()</title>
<indexterm zone="xmlSecBnAdd"><primary sortas="xmlSecBnAdd">xmlSecBnAdd</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnAdd                         (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="int">int</link> delta);</programlisting>
<para>
Adds <parameter>delta</parameter> to <parameter>bn</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>delta</parameter>&#160;:</term>
<listitem><simpara>      the delta.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnReverse" role="function">
<title>xmlSecBnReverse ()</title>
<indexterm zone="xmlSecBnReverse"><primary sortas="xmlSecBnReverse">xmlSecBnReverse</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnReverse                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn);</programlisting>
<para>
Reverses bytes order in <parameter>bn</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success or a negative value if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnCompare" role="function">
<title>xmlSecBnCompare ()</title>
<indexterm zone="xmlSecBnCompare"><primary sortas="xmlSecBnCompare">xmlSecBnCompare</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnCompare                     (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize);</programlisting>
<para>
Compares the <parameter>bn</parameter> with <parameter>data</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>       the data to compare BN to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>   the <parameter>data</parameter> size.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 if data is equal, negative value if <parameter>bn</parameter> is less or positive value if <parameter>bn</parameter>
is greater than <parameter>data</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnCompareReverse" role="function">
<title>xmlSecBnCompareReverse ()</title>
<indexterm zone="xmlSecBnCompareReverse"><primary sortas="xmlSecBnCompareReverse">xmlSecBnCompareReverse</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnCompareReverse              (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize);</programlisting>
<para>
Compares the <parameter>bn</parameter> with reverse <parameter>data</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>       the data to compare BN to.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>   the <parameter>data</parameter> size.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 if data is equal, negative value if <parameter>bn</parameter> is less or positive value if <parameter>bn</parameter>
is greater than <parameter>data</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnGetNodeValue" role="function">
<title>xmlSecBnGetNodeValue ()</title>
<indexterm zone="xmlSecBnGetNodeValue"><primary sortas="xmlSecBnGetNodeValue">xmlSecBnGetNodeValue</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnGetNodeValue                (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlNode">xmlNodePtr</link> cur,
                                                         <link linkend="xmlSecBnFormat">xmlSecBnFormat</link> format,
                                                         <link linkend="int">int</link> reverse);</programlisting>
<para>
Converts the node content from <parameter>format</parameter> to <parameter>bn</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>         the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cur</parameter>&#160;:</term>
<listitem><simpara>        the poitner to an XML node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>     the BN format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>reverse</parameter>&#160;:</term>
<listitem><simpara>    if set then reverse read buffer after reading.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success and a negative values if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnSetNodeValue" role="function">
<title>xmlSecBnSetNodeValue ()</title>
<indexterm zone="xmlSecBnSetNodeValue"><primary sortas="xmlSecBnSetNodeValue">xmlSecBnSetNodeValue</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnSetNodeValue                (<link linkend="xmlSecBn">xmlSecBnPtr</link> bn,
                                                         <link linkend="xmlNode">xmlNodePtr</link> cur,
                                                         <link linkend="xmlSecBnFormat">xmlSecBnFormat</link> format,
                                                         <link linkend="int">int</link> reverse,
                                                         <link linkend="int">int</link> addLineBreaks);</programlisting>
<para>
Converts the <parameter>bn</parameter> and sets it to node content.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>bn</parameter>&#160;:</term>
<listitem><simpara>                 the pointer to BN.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cur</parameter>&#160;:</term>
<listitem><simpara>                the poitner to an XML node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>             the BN format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>reverse</parameter>&#160;:</term>
<listitem><simpara>            the flag that indicates whether to reverse the buffer before writing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addLineBreaks</parameter>&#160;:</term>
<listitem><simpara>      the flag; it is equal to 1 then linebreaks will be added before and after new buffer content.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success and a negative values if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="xmlSecBnBlobSetNodeValue" role="function">
<title>xmlSecBnBlobSetNodeValue ()</title>
<indexterm zone="xmlSecBnBlobSetNodeValue"><primary sortas="xmlSecBnBlobSetNodeValue">xmlSecBnBlobSetNodeValue</primary></indexterm><programlisting><link linkend="int">int</link>                 xmlSecBnBlobSetNodeValue            (const <link linkend="xmlSecByte">xmlSecByte</link> *data,
                                                         <link linkend="xmlSecSize">xmlSecSize</link> dataSize,
                                                         <link linkend="xmlNode">xmlNodePtr</link> cur,
                                                         <link linkend="xmlSecBnFormat">xmlSecBnFormat</link> format,
                                                         <link linkend="int">int</link> reverse,
                                                         <link linkend="int">int</link> addLineBreaks);</programlisting>
<para>
Converts the <parameter>blob</parameter> and sets it to node content.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>       the pointer to BN blob.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dataSize</parameter>&#160;:</term>
<listitem><simpara>   the size of BN blob.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cur</parameter>&#160;:</term>
<listitem><simpara>        the poitner to an XML node.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara>     the BN format.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>reverse</parameter>&#160;:</term>
<listitem><simpara>    the flag that indicates whether to reverse the buffer before writing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>addLineBreaks</parameter>&#160;:</term>
<listitem><simpara>  if the flag is equal to 1 then
             linebreaks will be added before and after
             new buffer content.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> 0 on success and a negative values if an error occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
