summaryrefslogtreecommitdiff
path: root/nacl/tests/hash4.cpp
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-02 09:53:34 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-02 09:53:34 -0400
commite2967396ac73cb7410787886cdaf072a184ffc49 (patch)
tree527a74d25a4a0705fc641994fd35bfab22662034 /nacl/tests/hash4.cpp
parent8928c817df345f29aa0b194743595aa11bd6a8ba (diff)
Added NaCl crypto library.
Diffstat (limited to 'nacl/tests/hash4.cpp')
-rw-r--r--nacl/tests/hash4.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/nacl/tests/hash4.cpp b/nacl/tests/hash4.cpp
new file mode 100644
index 00000000..1d0a3f37
--- /dev/null
+++ b/nacl/tests/hash4.cpp
@@ -0,0 +1,18 @@
1#include <iostream>
2#include <string>
3using std::string;
4using std::cout;
5using std::hex;
6#include "crypto_hash_sha512.h"
7
8int main()
9{
10 string x = "testing\n";
11 string h = crypto_hash_sha512(x);
12 for (int i = 0;i < h.size();++i) {
13 cout << hex << (15 & (int) (h[i] >> 4));
14 cout << hex << (15 & (int) h[i]);
15 }
16 cout << "\n";
17 return 0;
18}