go.crypto: remove cipher.Reset()
The go.crypto repo was missed when this function was removed from the ciphers in the standard library. R=agl CC=golang-dev https://golang.org/cl/6904062
This commit is contained in:
committed by
Adam Langley
parent
4c5258d8b6
commit
62944567d8
@@ -57,13 +57,6 @@ func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c, dst, src) }
|
||||
// Decrypt decrypts the 8 byte buffer src using the key k and stores the result in dst.
|
||||
func (c *Cipher) Decrypt(dst, src []byte) { decryptBlock(c, dst, src) }
|
||||
|
||||
// Reset zeros the table, so that it will no longer appear in the process's memory.
|
||||
func (c *Cipher) Reset() {
|
||||
for i := 0; i < len(c.table); i++ {
|
||||
c.table[i] = 0
|
||||
}
|
||||
}
|
||||
|
||||
// initCipher initializes the cipher context by creating a look up table
|
||||
// of precalculated values that are based on the key.
|
||||
func initCipher(c *Cipher, key []byte) {
|
||||
|
||||
@@ -227,20 +227,3 @@ func TestCipherDecrypt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test resetting the cipher context
|
||||
func TestReset(t *testing.T) {
|
||||
c, err := NewCipher(testKey)
|
||||
if err != nil {
|
||||
t.Errorf("NewCipher(%d bytes) = %s", len(testKey), err)
|
||||
return
|
||||
}
|
||||
|
||||
c.Reset()
|
||||
for i := 0; i < len(c.table); i++ {
|
||||
if c.table[i] != 0 {
|
||||
t.Errorf("Cipher.Reset: Failed to clear Cipher.table[%d]. expected 0, got %08X", i, c.table[i])
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user