Skip to content

Commit

Permalink
layer: Replace copy func with bytes.Clone
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
  • Loading branch information
smallhive committed Feb 29, 2024
1 parent ff86d36 commit 31c745f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/layer/encryption/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ func NewParams(key []byte) (*Params, error) {
return nil, fmt.Errorf("invalid key size: %d", len(key))
}
var p Params
p.customerKey = make([]byte, aes256KeySize)
copy(p.customerKey, key)
p.customerKey = bytes.Clone(key)
return &p, nil
}

Expand Down

0 comments on commit 31c745f

Please sign in to comment.