Add rwc for block cipher mode

This commit is contained in:
9seconds
2018-06-05 13:10:26 +03:00
parent 7f01c03cb7
commit 336730b919
2 changed files with 73 additions and 3 deletions
-3
View File
@@ -1,7 +1,6 @@
package wrappers
import (
"bytes"
"crypto/cipher"
"io"
)
@@ -10,7 +9,6 @@ type StreamCipherReadWriteCloser struct {
encryptor cipher.Stream
decryptor cipher.Stream
conn io.ReadWriteCloser
rest *bytes.Buffer
}
// Read reads from connection
@@ -48,6 +46,5 @@ func NewStreamCipherRWC(conn io.ReadWriteCloser, encryptor, decryptor cipher.Str
conn: conn,
encryptor: encryptor,
decryptor: decryptor,
rest: &bytes.Buffer{},
}
}