dchest/tweetnacl-js — pull request #19 by dchest (2014-06-25 15:21:09+00:00)
Title: "Faster" xsalsa20 and curve25519.

Turns out curve25519 is not much faster. But xsalsa20 is ~5 times faster. Not sure if we need this.

Very rough benchmarks on my super-slow Atom:

Chrome:
```
BEFORE AFTER

Benchmarking crypto_stream_xor Benchmarking crypto_stream_xor
0.19821605550049554 MB/s 1.589825119236884 MB/s

Benchmarking crypto_onetimeauth Benchmarking crypto_onetimeauth
1.697792869269949 MB/s 1.5847860538827259 MB/s

Benchmarking crypto_secretbox Benchmarking crypto_secretbox
0.2014098690835851 MB/s 1.0548523206751055 MB/s

Benchmarking crypto_hash Benchmarking crypto_hash
395.3488372093023 ops/s 300 ops/s
0.48053820278712156 MB/s 0.4051863857374392 MB/s

Benchmarking secretbox Benchmarking secretbox
0.19952114924181963 MB/s 0.975609756097561 MB/s

Benchmarking secretbox.open Benchmarking secretbox.open
0.17806267806267806 MB/s 0.8467400508044031 MB/s

Benchmarking crypto_scalarmult_bas Benchmarking crypto_scalarmult_bas
26.515151515151516 ops/s 20.26635784597568 ops/s

Benchmarking box Benchmarking box
0.023299161230195712 MB/s 0.01953125 MB/s

Benchmarking box.open (valid) Benchmarking box.open (valid)
0.023004370830457786 MB/s 0.019425019425019424 MB/s

Benchmarking box.open (invalid key Benchmarking box.open (invalid key
0.025906735751295335 MB/s 0.020080321285140562 MB/s
```

Firefox:

```
Benchmarking crypto_stream_xor Benchmarking crypto_stream_xor
1.017293997965412 MB/s 6.0606060606060606 MB/s

Benchmarking crypto_onetimeauth Benchmarking crypto_onetimeauth
1.7241379310344827 MB/s 1.9342359767891684 MB/s

Benchmarking crypto_secretbox Benchmarking crypto_secretbox
0.6269592476489029 MB/s 1.455604075691412 MB/s

Benchmarking crypto_hash Benchmarking crypto_hash
262.88659793814435 ops/s 252.22551928783383 ops/s
0.3776435045317221 MB/s 0.40404040404040403 MB/s

Benchmarking secretbox Benchmarking secretbox
0.6738544474393531 MB/s 1.4124293785310735 MB/s

Benchmarking secretbox.open Benchmarking secretbox.open
0.5824111822947 MB/s 1.3262599469496021 MB/s

Benchmarking crypto_scalarmult_bas Benchmarking crypto_scalarmult_bas
16.073478760045923 ops/s 21.315468940316688 ops/s

Benchmarking box Benchmarking box
0.015232292460015232 MB/s 0.020479213598197828 MB/s

Benchmarking box.open (valid) Benchmarking box.open (valid)
0.01525320317266626 MB/s 0.01908761213972132 MB/s

Benchmarking box.open (invalid key Benchmarking box.open (invalid key
0.016116035455278 MB/s 0.02011263073209976 MB/s
```