From e2967396ac73cb7410787886cdaf072a184ffc49 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 2 Jul 2013 09:53:34 -0400 Subject: Added NaCl crypto library. --- nacl/curvecp/portparse.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 nacl/curvecp/portparse.c (limited to 'nacl/curvecp/portparse.c') diff --git a/nacl/curvecp/portparse.c b/nacl/curvecp/portparse.c new file mode 100644 index 00000000..37e4caca --- /dev/null +++ b/nacl/curvecp/portparse.c @@ -0,0 +1,14 @@ +#include "portparse.h" + +int portparse(unsigned char *y,const char *x) +{ + long long d = 0; + long long j; + for (j = 0;j < 5 && x[j] >= '0' && x[j] <= '9';++j) + d = d * 10 + (x[j] - '0'); + if (j == 0) return 0; + if (x[j]) return 0; + y[0] = d >> 8; + y[1] = d; + return 1; +} -- cgit v1.2.3