summaryrefslogtreecommitdiff
path: root/nacl/curvecp/uint64_unpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/curvecp/uint64_unpack.c')
-rw-r--r--nacl/curvecp/uint64_unpack.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nacl/curvecp/uint64_unpack.c b/nacl/curvecp/uint64_unpack.c
new file mode 100644
index 00000000..2d69bf72
--- /dev/null
+++ b/nacl/curvecp/uint64_unpack.c
@@ -0,0 +1,15 @@
1#include "uint64_unpack.h"
2
3crypto_uint64 uint64_unpack(const unsigned char *x)
4{
5 crypto_uint64 result;
6 result = x[7];
7 result <<= 8; result |= x[6];
8 result <<= 8; result |= x[5];
9 result <<= 8; result |= x[4];
10 result <<= 8; result |= x[3];
11 result <<= 8; result |= x[2];
12 result <<= 8; result |= x[1];
13 result <<= 8; result |= x[0];
14 return result;
15}