mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
swarm/storage/encryption: address review comments
This commit is contained in:
parent
855c1247c1
commit
f7da05fd78
3 changed files with 9 additions and 10 deletions
|
|
@ -89,7 +89,7 @@ func (e *encryption) transform(in, out []byte) {
|
|||
// call transformations per segment (asyncronously)
|
||||
go func(i int, x, y []byte) {
|
||||
defer wg.Done()
|
||||
e.transcrypt(i, x, y)
|
||||
e.Transcrypt(i, x, y)
|
||||
}(i/e.keyLen, in[i:i+l], out[i:i+l])
|
||||
}
|
||||
// pad the rest if out is longer
|
||||
|
|
@ -99,7 +99,7 @@ func (e *encryption) transform(in, out []byte) {
|
|||
|
||||
// used for segmentwise transformation
|
||||
// if in is shorter than out, padding is used
|
||||
func (e *encryption) transcrypt(i int, in []byte, out []byte) {
|
||||
func (e *encryption) Transcrypt(i int, in []byte, out []byte) {
|
||||
// first hash key with counter (initial counter + i)
|
||||
hasher := e.hashFunc()
|
||||
hasher.Write(e.key)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -31,7 +31,6 @@ type hasherStore struct {
|
|||
toEncrypt bool
|
||||
hashFunc SwarmHasher
|
||||
hashSize int // content hash size
|
||||
chunkSize int64 // max size of chunk
|
||||
refSize int64 // reference size (content hash + possibly encryption key)
|
||||
wg *sync.WaitGroup
|
||||
closed chan struct{}
|
||||
|
|
|
|||
Loading…
Reference in a new issue