Commit Graph

2889 Commits

Author SHA1 Message Date
Frank Denis
9eea164007 Check for _xgetbv() presence 2017-02-28 17:51:18 +01:00
Frank Denis
f23d7eff4d Automatically generate MSVC projects 2017-02-28 17:33:57 +01:00
Frank Denis
bf9b322334 _mm_set_epi64x() emulation for MSVC < 2015 2017-02-28 16:27:45 +01:00
Frank Denis
72426ed9c0 Always include <intrin.h> on Visual Studio x86/x86_64 2017-02-28 15:28:59 +01:00
Frank Denis
88cc2c6ba5 scrypt_common: check for sse2 support the same way as everywhere else 2017-02-28 15:08:40 +01:00
Frank Denis
9904e95bde salsa_ref: properly initialize variables when NULL is used as constants 2017-02-27 17:06:14 +01:00
Frank Denis
8398b47573 Remove unused variable 2017-02-27 17:04:31 +01:00
Frank Denis
fa89071261 Manual unrolling 2017-02-27 17:03:03 +01:00
Frank Denis
c6460c9e9a Remove unreferenced variables 2017-02-27 16:57:37 +01:00
Frank Denis
03f27b4204 Use _xgetbv() on Visual Studio, when available 2017-02-27 16:54:20 +01:00
Frank Denis
4fea4d917b With MSVC, AVX2 cause ICEs on x86 targets 2017-02-27 16:34:41 +01:00
Frank Denis
0e4a05d558 MSVC can only assembly x86 instructions 2017-02-27 16:31:46 +01:00
Frank Denis
3cd883d33e Remove debugging leftover in tests 2017-02-27 16:25:32 +01:00
Frank Denis
47bc8df460 Avoid unsupport pragmas 2017-02-27 16:07:57 +01:00
Frank Denis
f6a032f3e6 Regen the top-level msvc project 2017-02-27 16:02:59 +01:00
Frank Denis
cc55a084f8 MSC_VER -> _MSC_VER typo 2017-02-27 09:15:37 +01:00
Frank Denis
e05d2b3d8f C++ compat 2017-02-27 00:36:59 +01:00
Frank Denis
17b26a6e01 Missing \ 2017-02-27 00:30:30 +01:00
Frank Denis
9c699ecdd4 Don't ask too much from automake 2017-02-27 00:22:35 +01:00
Frank Denis
14bebe460b Allow compilation without a working x86_64 assembler 2017-02-27 00:19:42 +01:00
Frank Denis
e3b9907429 Use the assembly version of salsa20_xmm6 by default, if possible
icc produces good code from the intrinsics-based translation,
clang produces okay code, but gcc doesn't perform very well ATM.

It's a bummer to have a 3rd implementation, but salsa20 is used quite
a lot in the library, so it deserves a special attention.

If the assembly code cannot be assembled, fall back to the reduced
version of the intrinsics-based translation.

So, in the final library, we always only get two implementations at most.
2017-02-27 00:09:48 +01:00
Frank Denis
7d29c0fbd7 Remove useless prototypes 2017-02-26 23:51:58 +01:00
Frank Denis
3db624d335 Bring the asm amd64_xmm6 implementation back 2017-02-26 23:36:54 +01:00
Frank Denis
606f569c7b Replace the SSSE3 ChaCha20 impl with one derived from the AVX2 impl 2017-02-26 23:02:45 +01:00
Frank Denis
f60e4ae514 Capitalize macro params 2017-02-26 22:48:49 +01:00
Frank Denis
9d706253ff + AVX2 ChaCha20 implementation 2017-02-26 22:46:34 +01:00
Frank Denis
9dc21def26 Move declarations, for consistency 2017-02-26 22:18:09 +01:00
Frank Denis
8d256f0edd With the full counter, the limit is comfortable enough (2^70) 2017-02-26 22:04:50 +01:00
Frank Denis
d155bfd686 Remove useless brackets 2017-02-26 21:59:52 +01:00
Frank Denis
17ebc9cb07 Import SSE2 & AVX2 salsa20 implementations 2017-02-26 21:32:00 +01:00
Frank Denis
c0c645da45 Test crypto_kdf constants, add _PRIMITIVE 2017-02-26 21:30:40 +01:00
Frank Denis
8a213f021c Remove useless prototypes 2017-02-26 21:26:14 +01:00
Frank Denis
15f1904f00 Use the AVX2 salsa20 implementation if the CPU supports it 2017-02-26 21:23:39 +01:00
Frank Denis
d85454c3c7 No // comments 2017-02-26 21:23:17 +01:00
Frank Denis
5088ca52f6 Use <impl>/<primitive_name>*.[ch], not <impl>/<operation>_<primitive_name>* 2017-02-26 20:54:08 +01:00
Frank Denis
5ccf9c2f46 salsa20-xmm6int: don't hardcode the number of rounds 2017-02-26 19:04:34 +01:00
Frank Denis
78330822cb Save trees 2017-02-26 19:02:23 +01:00
Frank Denis
294007a16f Import u0.h 2017-02-26 19:00:01 +01:00
Frank Denis
e0ee69874f xmm6int: optimize the last block 2017-02-26 18:56:27 +01:00
Frank Denis
45160a0f78 Define the HAVE_* macros for SIMD instructions on Visual Studio
This avoids a lot of redundant preprocessor checks
2017-02-26 18:22:14 +01:00
Frank Denis
d781ec3cdf Add missing header for _crypto_stream_salsa20_pick_best_implementation 2017-02-26 17:50:11 +01:00
Frank Denis
e08843d138 Enable the xmm6int implementation on Visual Studio, too 2017-02-26 17:48:39 +01:00
Frank Denis
0a4418a25f Compile salsa20-xmm6int only if HAVE_EMMINTRIN_H is defined
This is redundant with the next check, and needs to be adjusted for Visual Studio
2017-02-26 17:41:03 +01:00
Frank Denis
e4a43d5cff Nits 2017-02-26 17:35:30 +01:00
Frank Denis
ed8277a2f6 Use a single way for stream_salsa20_ref conditional inclusion 2017-02-26 17:27:28 +01:00
Frank Denis
47a3461793 xor_salsa2012.c is not used any more 2017-02-26 17:21:13 +01:00
Frank Denis
199aa0efa2 Update AUTHORS 2017-02-26 17:21:04 +01:00
Frank Denis
3b3613d464 Add missing header files to the distfiles 2017-02-26 17:17:00 +01:00
Frank Denis
c58cbcbd90 Indent 2017-02-26 17:13:55 +01:00
Frank Denis
9294e2e699 Revamp the salsa20 implmentations and structure
- Factorize core_salsa20{20,12,8}
- Add support for multiple salsa20 implementations
- Replace the assembly SSE2 implementation with its equivalent using intrisics
2017-02-26 16:49:15 +01:00