X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcmath%2Fsilcmp.h;h=22ad1926e8671030f37aa07123ce7e55a975bba2;hp=ccc15a670a7d2e4374ad959976be9baff1f924c9;hb=0f0340b9fbce9704cc7171f8f0104ce9103d2de6;hpb=d60003d3019371d4ce834a6cbfbf41c257f5a5f7 diff --git a/lib/silcmath/silcmp.h b/lib/silcmath/silcmp.h index ccc15a67..22ad1926 100644 --- a/lib/silcmath/silcmp.h +++ b/lib/silcmath/silcmp.h @@ -75,6 +75,30 @@ typedef SILC_MP_INT SilcMPInt; ***/ void silc_mp_init(SilcMPInt *mp); +/****f* silcmath/SilcMPAPI/silc_mp_sinit + * + * SYNOPSIS + * + * bool silc_mp_sinit(SilcStack stack, SilcMPInt *mp); + * + * DESCRIPTION + * + * Initializes the SilcMPInt *that is the actual MP Integer. + * This must be called before any of the silc_mp_ routines can be + * used. The integer is uninitialized with the silc_mp_uninit function. + * This routine is equivalent to silc_mp_init but allocates the memory + * from `stack'. + * + * NOTES + * + * The `stack' is saved into the `mp' for the duration of the existence + * of `mp'. This means that `stack' must not become invalid while `mp' + * is used. It also means that any routine that may need memory allocation + * to for example enlarge `mp' will allocate the memory from `stack'. + * + ***/ +bool silc_mp_sinit(SilcStack stack, SilcMPInt *mp); + /****f* silcmath/SilcMPAPI/silc_mp_uninit * * SYNOPSIS