summaryrefslogtreecommitdiff
path: root/toxencryptsave/crypto_pwhash_scryptsalsa208sha256
diff options
context:
space:
mode:
authordubslow <bill@mint>2014-09-12 21:15:05 -0500
committerdubslow <bill@mint>2014-09-12 21:15:05 -0500
commit579e7998b7c33962c645b9476949aa58c76be876 (patch)
tree92682d3c73e828b48a3b33d81c478a581053b0a8 /toxencryptsave/crypto_pwhash_scryptsalsa208sha256
parentc26c6d86aeb2a0dd672ff7611394ebbf806d70c7 (diff)
encrypted save fully work with both libsodium and nacl
they both reliably pass "make check"
Diffstat (limited to 'toxencryptsave/crypto_pwhash_scryptsalsa208sha256')
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c8
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c3
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.h3
15 files changed, 48 insertions, 2 deletions
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h
index e10a81d8..5cb32f8d 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifndef crypto_pwhash_scryptsalsa208sha256_H 6#ifndef crypto_pwhash_scryptsalsa208sha256_H
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
index 159dac10..5a5c5525 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h
index 1f70b7a2..3f0b7d72 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h
index d6975e8d..ee5b30f7 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifndef __SODIUM_EXPORT_H__ 6#ifndef __SODIUM_EXPORT_H__
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
index 0dc896f1..97d9ba68 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c
index d66a5395..01eb7dff 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h
index 6e5f2832..b74bc6a3 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
index 0a519937..52c51abc 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
@@ -1,11 +1,14 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3
4#include <errno.h> 6#include <errno.h>
5#include <limits.h> 7#include <limits.h>
6#include <stddef.h> 8#include <stddef.h>
7#include <stdint.h> 9#include <stdint.h>
8#include <string.h> 10#include <string.h>
11//#include <stdio.h>
9 12
10#include "crypto_pwhash_scryptsalsa208sha256.h" 13#include "crypto_pwhash_scryptsalsa208sha256.h"
11#include "crypto_scrypt.h" 14#include "crypto_scrypt.h"
@@ -102,6 +105,7 @@ crypto_pwhash_scryptsalsa208sha256(unsigned char * const out,
102 unsigned long long opslimit, 105 unsigned long long opslimit,
103 size_t memlimit) 106 size_t memlimit)
104{ 107{
108 //fprintf(stderr, "Doing that dirty thang!!!!\n");
105 uint32_t N_log2; 109 uint32_t N_log2;
106 uint32_t p; 110 uint32_t p;
107 uint32_t r; 111 uint32_t r;
@@ -146,7 +150,7 @@ crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha2
146 errno = EINVAL; 150 errno = EINVAL;
147 return -1; 151 return -1;
148 } 152 }
149 randombytes_buf(salt, sizeof salt); 153 randombytes(salt, sizeof salt);
150 if (escrypt_gensalt_r(N_log2, r, p, salt, sizeof salt, 154 if (escrypt_gensalt_r(N_log2, r, p, salt, sizeof salt,
151 (uint8_t *) setting, sizeof setting) == NULL) { 155 (uint8_t *) setting, sizeof setting) == NULL) {
152 errno = EINVAL; 156 errno = EINVAL;
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c
index f02c3803..9b5c5131 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifdef HAVE_ANDROID_GETCPUFEATURES 6#ifdef HAVE_ANDROID_GETCPUFEATURES
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h
index 2e5efddd..874915ef 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifndef __SODIUM_RUNTIME_H__ 6#ifndef __SODIUM_RUNTIME_H__
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c
index 9de9763a..58196514 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
index 18cf6ae6..856a655e 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3/*- 6/*-
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h
index e28c5202..04e5c1ed 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifndef _SYSENDIAN_H_ 6#ifndef _SYSENDIAN_H_
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c
index 677633b4..e61ccf3e 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifndef __STDC_WANT_LIB_EXT1__ 6#ifndef __STDC_WANT_LIB_EXT1__
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.h b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.h
index 7d5214e1..fb2020c3 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.h
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.h
@@ -1,3 +1,6 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
1#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ 4#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */
2 5
3#ifndef __SODIUM_UTILS_H__ 6#ifndef __SODIUM_UTILS_H__