X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=blobdiff_plain;f=dh.c;h=f94665c9b52637fd4fda9988da612214a2e539df;hp=0616a43e4007dc330137431cbf8908b34823861c;hb=ed2b0c2a90657c4f5f1e38ec5bca9d05aef1864a;hpb=5f9e3ffe07bd4412e35e90637694a3e5bc2eac7a diff --git a/dh.c b/dh.c index 0616a43..f94665c 100644 --- a/dh.c +++ b/dh.c @@ -61,6 +61,16 @@ static string_t dh_makepublic(void *sst, uint8_t *secret, int32_t secretlen) 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,