return r;
}
+static int32_t write_mpbin(MP_INT *a, uint8_t *buffer,
+ int32_t buflen)
+{
+ char *hb = write_mpstring(a);
+ int32_t len;
+ hex_decode(buffer, buflen, &len, hb, True);
+ free(hb);
+ return len;
+}
+
static dh_makeshared_fn dh_makeshared;
static void dh_makeshared(void *sst, uint8_t *secret, int32_t secretlen,
cstring_t rempublic, uint8_t *sharedsecret,
return buff;
}
-int32_t write_mpbin(MP_INT *a, uint8_t *buffer, int32_t buflen)
-{
- char *hb = write_mpstring(a);
- int32_t len;
- hex_decode(buffer, buflen, &len, hb, True);
- free(hb);
- return len;
-}
-
#define DEFINE_SETFDFLAG(fn,FL,FLAG) \
void fn(int fd) { \
int r=fcntl(fd, F_GET##FL); \
extern char *write_mpstring(MP_INT *a);
/* Convert a MP_INT into a hex string */
-extern int32_t write_mpbin(MP_INT *a, uint8_t *buffer, int32_t buflen);
- /* Convert a MP_INT into a buffer; return length; truncate if necessary */
-
extern struct log_if *init_log(list_t *loglist);
extern void send_nak(const struct comm_addr *dest, uint32_t our_index,