]> Cypherpunks repositories - gostls13.git/commit
crypto/des: faster permutation.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 31 Jul 2013 20:06:48 +0000 (22:06 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 31 Jul 2013 20:06:48 +0000 (22:06 +0200)
commit441ef7978d262745fd275e29cede0522f88955d0
tree53c92a231002427d12902097c3b77a205fbfa0e6
parentd43ee1b71411ac0b372e4bc191108ddda321e179
crypto/des: faster permutation.

This patch introduces specialized functions for initial
and final permutations, and precomputes the output of the
third permutation on the S-box elements.

benchmark           old ns/op    new ns/op    delta
BenchmarkEncrypt         3581         1226  -65.76%
BenchmarkDecrypt         3590         1224  -65.91%

benchmark            old MB/s     new MB/s  speedup
BenchmarkEncrypt         2.23         6.52    2.92x
BenchmarkDecrypt         2.23         6.53    2.93x

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12072045
src/pkg/crypto/des/block.go
src/pkg/crypto/des/const.go
src/pkg/crypto/des/des_test.go