From 4ebbd0d992d9a04cd83cae8a7162ee8026466a2c Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 8 May 2014 20:18:32 -0700 Subject: [PATCH] Just use escrypt_kdf_nosse if SSE2 is not available. --- .../scryptxsalsa208sha256/crypto_scrypt-common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c b/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c index 16abcad5..0f43c944 100644 --- a/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c +++ b/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c @@ -153,8 +153,12 @@ escrypt_r(escrypt_local_t * local, const uint8_t * passwd, size_t passwdlen, if (need > buflen || need < saltlen) { return NULL; } +#ifdef HAVE_EMMINTRIN_H escrypt_kdf = sodium_runtime_has_sse2() ? escrypt_kdf_sse : escrypt_kdf_nosse; +#else + escrypt_kdf = escrypt_kdf_nosse; +#endif if (escrypt_kdf(local, passwd, passwdlen, salt, saltlen, N, r, p, hash, sizeof(hash))) { return NULL; @@ -230,9 +234,12 @@ crypto_scrypt_compat(const uint8_t * passwd, size_t passwdlen, if (escrypt_init_local(&local)) { return -1; } +#ifdef HAVE_EMMINTRIN_H escrypt_kdf = sodium_runtime_has_sse2() ? escrypt_kdf_sse : escrypt_kdf_nosse; - +#else + escrypt_kdf = escrypt_kdf_nosse; +#endif retval = escrypt_kdf(&local, passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen);