summaryrefslogtreecommitdiff
path: root/nacl/curvecp/hexparse.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-13 10:09:38 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-13 10:09:38 -0400
commitd4fe483efd3e0062f12430efe9deb66d43d914d7 (patch)
treee6aa9ac716ae82cdb15c6e6cb5d9d1d9d29f053b /nacl/curvecp/hexparse.c
parent835ef0320d47372eac14bef31c979b8217d04498 (diff)
NaCl moved to other repo.
Diffstat (limited to 'nacl/curvecp/hexparse.c')
-rw-r--r--nacl/curvecp/hexparse.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/nacl/curvecp/hexparse.c b/nacl/curvecp/hexparse.c
deleted file mode 100644
index 43bfe044..00000000
--- a/nacl/curvecp/hexparse.c
+++ /dev/null
@@ -1,25 +0,0 @@
1#include "hexparse.h"
2
3static int hexdigit(char x)
4{
5 if (x >= '0' && x <= '9') return x - '0';
6 if (x >= 'a' && x <= 'f') return 10 + (x - 'a');
7 if (x >= 'A' && x <= 'F') return 10 + (x - 'A');
8 return -1;
9}
10
11int hexparse(unsigned char *y,long long len,const char *x)
12{
13 if (!x) return 0;
14 while (len > 0) {
15 int digit0;
16 int digit1;
17 digit0 = hexdigit(x[0]); if (digit0 == -1) return 0;
18 digit1 = hexdigit(x[1]); if (digit1 == -1) return 0;
19 *y++ = digit1 + 16 * digit0;
20 --len;
21 x += 2;
22 }
23 if (x[0]) return 0;
24 return 1;
25}