• Luke Curley's avatar
    crypto/cipher: improved cbc performance · 701982f1
    Luke Curley authored
    decrypt: reduced the number of copy calls from 2n to 1.
    encrypt: reduced the number of copy calls from n to 1.
    
    Encryption is straight-forward: use dst instead of tmp when
    xoring the block with the iv.
    
    Decryption now loops backwards through the blocks abusing the
    fact that the previous block's ciphertext (src) is the iv. This
    means we don't need to copy the iv every time, in addition to
    using dst instead of tmp like encryption.
    
    R=golang-codereviews, agl, mikioh.mikioh
    CC=golang-codereviews
    https://golang.org/cl/50900043
    701982f1
Name
Last commit
Last update
..
benchmark_test.go Loading commit data...
cbc.go Loading commit data...
cbc_aes_test.go Loading commit data...
cfb.go Loading commit data...
cfb_test.go Loading commit data...
cipher.go Loading commit data...
cipher_test.go Loading commit data...
common_test.go Loading commit data...
ctr.go Loading commit data...
ctr_aes_test.go Loading commit data...
example_test.go Loading commit data...
gcm.go Loading commit data...
gcm_test.go Loading commit data...
io.go Loading commit data...
ofb.go Loading commit data...
ofb_test.go Loading commit data...
xor.go Loading commit data...
xor_test.go Loading commit data...