diff --git a/pkg/services/object/get/prm.go b/pkg/services/object/get/prm.go index 8d859df0..7ee49354 100644 --- a/pkg/services/object/get/prm.go +++ b/pkg/services/object/get/prm.go @@ -28,6 +28,8 @@ type RangeHashPrm struct { hashGen func() hash.Hash rngs []*objectSDK.Range + + salt []byte } // HeadPrm groups parameters of Head service call. @@ -88,6 +90,11 @@ func (p *RangeHashPrm) SetHashGenerator(v func() hash.Hash) { p.hashGen = v } +// SetSalt sets binary salt to XOR object's payload ranges before hash calculation. +func (p *RangeHashPrm) SetSalt(salt []byte) { + p.salt = salt +} + // SetCommonParameters sets common parameters of the operation. func (p *commonPrm) SetCommonParameters(common *util.CommonPrm) { p.common = common diff --git a/pkg/services/object/get/v2/util.go b/pkg/services/object/get/v2/util.go index 4515c391..a40a3bf5 100644 --- a/pkg/services/object/get/v2/util.go +++ b/pkg/services/object/get/v2/util.go @@ -83,6 +83,7 @@ func (s *Service) toHashRangePrm(req *objectV2.GetRangeHashRequest) (*getsvc.Ran } p.SetRangeList(rngs) + p.SetSalt(body.GetSalt()) switch t := body.GetType(); t { default: