]> Cypherpunks repositories - gostls13.git/commit
crypto/aes: eliminate some bounds checking and manual truncation.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Mon, 5 Dec 2011 18:30:25 +0000 (13:30 -0500)
committerAdam Langley <agl@golang.org>
Mon, 5 Dec 2011 18:30:25 +0000 (13:30 -0500)
commit3538d40ab5f57db77b3a76822c555a76020588f0
tree5619ca581695d53c35d075c68ce24d15c12ec022
parentb9ccd077dc478fca2e8bd00633c1a60a54f342d8
crypto/aes: eliminate some bounds checking and manual truncation.

By converting array indices to uint8, they are automatically
constrained in the array range, and the binary AND with 0xff
is no longer needed anymore.

Before:  aes.BenchmarkEncrypt    363 ns/op
After:   aes.BenchmarkEncrypt    273 ns/op

R=golang-dev, gri, agl
CC=golang-dev, remy
https://golang.org/cl/5450084
src/pkg/crypto/aes/aes_test.go
src/pkg/crypto/aes/block.go