Cleanup
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package peer
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"crypto/rand"
|
||||
@@ -38,6 +39,10 @@ func (sc *dataCipher) Key() [32]byte {
|
||||
return sc.key
|
||||
}
|
||||
|
||||
func (sc *dataCipher) HasKey(k [32]byte) bool {
|
||||
return bytes.Equal(k[:], sc.key[:])
|
||||
}
|
||||
|
||||
func (sc *dataCipher) Encrypt(h Header, data, out []byte) []byte {
|
||||
const s = dataHeaderSize
|
||||
out = out[:s+dataCipherOverhead+len(data)]
|
||||
|
||||
Reference in New Issue
Block a user