Commit Graph
705 Commits
Author SHA1 Message Date
Frank Denis 69aac7d0af Add do { ... } while(0) when relevant 2015-10-11 00:12:16 +02:00
Frank Denis 7a67bb9484 Turn reduce4 into a macro
That's too much registers for a function call in 32-bit mode.
And in MSVC, this is even the case if the function is marked inline.
2015-10-10 23:33:34 +02:00
Frank Denis d1d833a240 Enable aes256gcm on Visual Studio 2015-10-10 23:04:40 +02:00
Frank Denis 30729b0add Don't declare new variables after a line of code 2015-10-10 21:57:04 +02:00
Frank Denis 9055a140f3 Declare __m128 arrays used as parameters as pointers
Required for MSVC
2015-10-10 21:07:07 +02:00
Frank Denis 78002f8ca7 Proper casts for aeskeygenassist() 2015-10-10 20:57:46 +02:00
Frank Denis fad86b2fe9 Let's hope that requiring ssse3 is not required any more 2015-10-10 20:15:35 +02:00
Frank Denis c3195da04d ssse3 target is required in addition to sse4.1 2015-10-10 19:40:29 +02:00
Frank Denis f267352eec Use SIMD-specific compiler flags only for files needing them 2015-10-10 19:24:30 +02:00
Frank Denis d4ff80e7a0 Define __SSSE3__ if required 2015-10-10 18:32:10 +02:00
Frank Denis 6ca06314fc Do not try to compile aesni code if this is not going to compile 2015-10-10 18:22:03 +02:00
Frank Denis e83e9b2d8e Check for AESNI & PCLMUL presence/usability 2015-10-10 17:57:47 +02:00
Frank Denis ab2e86748e Replace the aes256gcm implementation with Romain Dolbeau's implementation
which is slightly faster than mine.
Reimplement features from the previous implementation: add batch mode and
use two passes in the decryption function in order to check the tag before
decrypting.
2015-10-10 16:21:08 +02:00
Frank Denis ef1417bc2f Explicit cast 2015-10-09 09:48:34 +02:00
Frank Denis 41c296fcf8 Make the state const in *_afternm() 2015-10-09 09:43:03 +02:00
Frank Denis 96d4494f2f Add crypto_aead_aes256gcm_aesni_{beforenm|*_afternm} 2015-10-09 09:25:01 +02:00
Frank Denis 396e16880d Move CRYPTO_ALIGN to sodium/export.h 2015-10-09 08:50:49 +02:00
Frank Denis e8e5d2fc18 Add crypto_aead_aes256gcm_aesni_*
Requires a CPU with aesni and pclmulqdq
This is a private branch for a reason. It is not going to be merged as-is.
2015-10-07 23:09:19 +02:00
Frank Denis d8e870cb43 /dev/urandom can be a name special file in addition to a character special file 2015-10-05 11:51:29 +02:00
Frank Denis fe27e6c136 randombytes: use arc4random(3) on OpenBSD and CloudABI 2015-09-13 15:34:01 +02:00
Frank Denis 6757e3320a Confusing indentation 2015-09-13 15:09:51 +02:00
Frank Denis 46f71fba9e Check for getpid(2) presence instead of checking for Visual Studio 2015-09-13 15:04:26 +02:00
Frank Denis e424963ae8 Call a weak function in sodium_memcmp() to prevent LTO.
sodium_memcmp() can be used to compare user-provided secrets against
constant, hardcoded secrets. We don't want the compiler to generate code
that would be optimized for these hardcoded values.
2015-09-09 09:33:20 +02:00
Frank Denis 7fca230be8 Nits after pnacl merge 2015-08-02 13:53:22 +02:00
Frank Denis f610f781f2 Merge remote-tracking branch 'arbinger/pnacl' into nacl
* arbinger/pnacl:
  removed comment
  Added .final and .nexe output files to CLEANFILES
  revert original hack
  Initial patch for Chrome NaCl implementation
  Added patch to obtain random bytes for Chrome NaCl via IRT -- allows build with NaCl SDK toolchain
2015-08-02 12:54:05 +02:00
evoskuil aadab3eba3 Remove dead code. 2015-07-26 16:03:24 -07:00
Frank Denis f16abdb5e3 <unistd.h> -> <stddef.h> 2015-07-20 23:58:09 +02:00
Frank Denis bb8c58cdd7 Include <unistd.h> for size_t 2015-07-18 12:07:38 +02:00
James Robson 8444667b8b removed comment 2015-06-23 13:34:29 -05:00
James Robson 1b633bb8ca Merge branch 'master' into pnacl 2015-06-22 13:19:33 -05:00
James Robson 34a4931d9a Initial patch for Chrome NaCl implementation 2015-06-22 13:02:21 -05:00
Frank Denis 3822caf6c7 Micro-optimization 2015-06-22 15:56:35 +02:00
Frank Denis e2fca8cac5 Add sodium_increment() 2015-06-22 15:44:58 +02:00
Frank Denis 5f74196b0f scrypt extra parameters checks 2015-06-19 18:55:41 +02:00
Frank Denis facb3c4343 Implicit conversions 2015-06-16 22:42:13 +02:00
Frank Denis d35b364f31 Blake2b: fix flags on architectures with < 32-bit int 2015-06-13 17:31:49 +02:00
Deirdre Connolly f2afab4b1b If browser crypto is not available, try msCrypto before assuming a
Node environment
2015-06-08 18:25:51 -04:00
Frank Denis f46439c1e2 Ensure that PBKDF2_SHA256() is not used to output more than 128 Go. 2015-06-06 12:46:22 +02:00
Frank Denis 86d92bc11d SHA512: just use memcpy() to initialize the state 2015-06-06 12:33:11 +02:00
Frank Denis ba1cd6a128 SHA256: use uint64_t for the counter instead of two uint32_t 2015-06-06 12:32:23 +02:00
Frank Denis 21fc07e6f4 Leverage randombytes_salsa20_random_rekey() 2015-06-01 12:45:45 +02:00
Frank Denis 3c3635e53a salsa20_random(): just abort(3) if the pid changes and _stir() wasn't called 2015-06-01 12:40:58 +02:00
Frank Denis 315029188e Suggest randombytes_stir() 2015-06-01 10:22:01 +02:00
Frank Denis e326ef9030 Do not use timeval. The structure is not defined on Windows RT. 2015-05-29 17:40:37 +02:00
Frank Denis 3bd6b8d074 Further simplify WINAPI_DESKTOP 2015-05-29 17:40:37 +02:00
Frank Denis ada287ad56 Disable guarded memory on WinRT 2015-05-29 17:40:32 +02:00
Frank Denis 7821009bff Do not assume that _MSC_VER being defined implied x86 or x64 2015-05-29 17:40:25 +02:00
Frank Denis 94255bee36 bin2hex(): abort(3) if the length doesn't include the final \0 2015-05-15 09:23:59 +02:00
Frank Denis bf920dc717 Add IETF-compatible version of chacha20poly1305 2015-05-09 16:12:03 +02:00
Frank Denis 63dd05419e crypto_box_keypair() cannot fail - Add lcov exclusion. 2015-05-09 15:56:52 +02:00