This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/* Encodes MP integer into binary data. Returns allocated data that
must be free'd by the caller. If `len' is provided the destination
buffer is allocated that large. If zero then the size is approximated. */
/* Encodes MP integer into binary data. Returns allocated data that
must be free'd by the caller. If `len' is provided the destination
buffer is allocated that large. If zero then the size is approximated. */
unsigned char *ret;
SilcMPInt tmp;
size = (len ? len : ((silc_mp_sizeinbase(val, 2) + 7) / 8));
ret = silc_calloc(size, sizeof(*ret));
unsigned char *ret;
SilcMPInt tmp;
size = (len ? len : ((silc_mp_sizeinbase(val, 2) + 7) / 8));
ret = silc_calloc(size, sizeof(*ret));
returned into `dst' and it's length to the `ret_len'. */
void silc_mp_mp2bin_noalloc(SilcMPInt *val, unsigned char *dst,
returned into `dst' and it's length to the `ret_len'. */
void silc_mp_mp2bin_noalloc(SilcMPInt *val, unsigned char *dst,