Just incorporate the X64 ASM version of Salsa20/12 for X64 platforms. This gives us (for example) 1.5gb/sec encryption on a Core i5 2.8ghz.

This commit is contained in:
Adam Ierymenko 2017-04-18 08:45:37 -07:00
parent 4938e82795
commit a1e94154be
6 changed files with 4597 additions and 4 deletions

View file

@ -0,0 +1,6 @@
Blazingly fast X64 ASM implementation of Salsa20/12
======
This is ripped from the [cnacl](https://github.com/cjdelisle/cnacl) source. The actual code is by Danial J. Bernstein and is in the public domain.
This is included on Linux and Mac 64-bit builds and is significantly faster than the SSE intrinsics or C versions. It's used for packet encode/decode only since its use differs a bit from the regular Salsa20 C++ class. Specifically it lacks the ability to be called on multiple blocks, preferring instead to take a key and a single stream to encrypt and that's it.

View file

@ -0,0 +1,13 @@
#ifdef __cplusplus
extern "C" {
#endif
// output, outlen, nonce, key (256-bit / 32-byte)
extern int zt_salsa2012_amd64_xmm6(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
// ciphertext, message, mlen, nonce, key
extern int zt_salsa2012_amd64_xmm6_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff