)]}' { "commit": "3c4aac89819a5fdc28d906456729d3423fd46969", "tree": "c3d9a234c841dd434fc6000aabe118cc9a159608", "parents": [ "a76a400e302568c342acfdbe6e92c6531be3eb86" ], "author": { "name": "Andy Wang", "email": "cbeuw.andy@gmail.com", "time": "Sat Apr 18 01:52:37 2020 +0000" }, "committer": { "name": "Filippo Valsorda", "email": "filippo@golang.org", "time": "Mon Apr 20 20:11:42 2020 +0000" }, "message": "chacha20: improve generic implementation performance\n\nSome small changes to improve computation throughput of noasm chacha20 by between 4-11%.\n\nname old time/op new time/op delta\nChaCha20/64-12 142ns ± 1% 132ns ± 1% -7.09% (p\u003d0.000 n\u003d20+20)\nChaCha20/256-12 485ns ± 1% 441ns ± 1% -9.08% (p\u003d0.000 n\u003d20+20)\nChaCha20/10x25-12 822ns ± 1% 785ns ± 1% -4.42% (p\u003d0.000 n\u003d20+20)\nChaCha20/4096-12 484ns ± 1% 442ns ± 1% -8.80% (p\u003d0.000 n\u003d20+19)\nChaCha20/100x40-12 8.65µs ± 1% 8.08µs ± 1% -6.54% (p\u003d0.000 n\u003d19+20)\nChaCha20/65536-12 118µs ± 1% 106µs ± 1% -10.04% (p\u003d0.000 n\u003d19+20)\nChaCha20/1000x65-12 120µs ± 1% 108µs ± 0% -9.84% (p\u003d0.000 n\u003d19+19)\n\nname old speed new speed delta\nChaCha20/64-12 450MB/s ± 1% 484MB/s ± 1% +7.61% (p\u003d0.000 n\u003d19+19)\nChaCha20/256-12 527MB/s ± 1% 580MB/s ± 1% +10.03% (p\u003d0.000 n\u003d20+20)\nChaCha20/10x25-12 304MB/s ± 1% 318MB/s ± 1% +4.62% (p\u003d0.000 n\u003d20+20)\nChaCha20/4096-12 529MB/s ± 1% 580MB/s ± 1% +9.70% (p\u003d0.000 n\u003d19+20)\nChaCha20/100x40-12 463MB/s ± 1% 495MB/s ± 1% +7.00% (p\u003d0.000 n\u003d19+20)\nChaCha20/65536-12 556MB/s ± 1% 618MB/s ± 1% +11.16% (p\u003d0.000 n\u003d19+20)\nChaCha20/1000x65-12 542MB/s ± 1% 602MB/s ± 0% +10.92% (p\u003d0.000 n\u003d19+19)\n\nRedundant bound checks on loading key and nonce as uint32s in newUnauthenticatedCipher\nare eliminated.\n\nIn the main block loop, two changes were made:\n1. Specialise the xor function to addXor, so the final block state variables don\u0027t need to be\nseparately incremented by the initial block state before XORing with the input block.\n2. Change the loop condition to be bound by len(src) \u003e\u003d64 and len(dst) \u003e\u003d 64.\nThis eliminates all bound checks later in the load-xor-store stage.\nAs a result, src and dst are resliced in-place after each block.\n\nChange-Id: Ic3165a556bf7cb2d71349d534cdd21d06d9a7a2c\nGitHub-Last-Rev: b3b1a185004c551919a8984547a5bac0283919a1\nGitHub-Pull-Request: golang/crypto#131\nReviewed-on: https://go-review.googlesource.com/c/crypto/+/228618\nRun-TryBot: Filippo Valsorda \u003cfilippo@golang.org\u003e\nTryBot-Result: Gobot Gobot \u003cgobot@golang.org\u003e\nReviewed-by: Filippo Valsorda \u003cfilippo@golang.org\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "7c498e90d93790666caff35539e8158d5dd0a02b", "old_mode": 33188, "old_path": "chacha20/chacha_generic.go", "new_id": "18c8bc0567cc0a2a2603935cf768003ccd1817ab", "new_mode": 33188, "new_path": "chacha20/chacha_generic.go" }, { "type": "modify", "old_id": "0110c9865af71b440b9fa0f7b2c1e077b89d5aa6", "old_mode": 33188, "old_path": "chacha20/xor.go", "new_id": "c2d04851e0d13237589e4897cfeb39c584661945", "new_mode": 33188, "new_path": "chacha20/xor.go" } ] }