New SILC PKCS API, enabling support for other public keys/certs.
[silc.git] / lib / silcmath / silcmp.h
index ccc15a670a7d2e4374ad959976be9baff1f924c9..aaff041274be97127ee878f6258d72e27daa54da 100644 (file)
@@ -75,6 +75,30 @@ typedef SILC_MP_INT SilcMPInt;
  ***/
 void silc_mp_init(SilcMPInt *mp);
 
+/****f* silcmath/SilcMPAPI/silc_mp_sinit
+ *
+ * SYNOPSIS
+ *
+ *    SilcBool 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'.
+ *
+ ***/
+SilcBool silc_mp_sinit(SilcStack stack, SilcMPInt *mp);
+
 /****f* silcmath/SilcMPAPI/silc_mp_uninit
  *
  * SYNOPSIS
@@ -638,7 +662,7 @@ unsigned char *silc_mp_mp2bin(SilcMPInt *val, SilcUInt32 len,
  * DESCRIPTION
  *
  *    Same as silc_mp_mp2bin but does not allocate any memory.  The
- *    encoded data is returned into `dst' and it's length to the `ret_len'.
+ *    encoded data is returned into `dst' of size of `dst_len'.
  *
  ***/
 void silc_mp_mp2bin_noalloc(SilcMPInt *val, unsigned char *dst,