diff --git a/e2e/parse/partition.go b/e2e/parse/partition.go index da7628381175971f748d456761ccc836345bd227..4850cafd70ffc44151ce2d93a2f698847b5b7571 100644 --- a/e2e/parse/partition.go +++ b/e2e/parse/partition.go @@ -8,6 +8,7 @@ package parse import ( + e2eCrypto "gitlab.com/elixxir/crypto/e2e" "time" "github.com/pkg/errors" @@ -78,7 +79,8 @@ func (p *Partitioner) Partition(recipient *id.ID, mt catalog.MessageType, } func (p *Partitioner) HandlePartition(sender *id.ID, - contents []byte, relationshipFingerprint []byte) (receive.Message, bool) { + contents []byte, relationshipFingerprint []byte, + residue e2eCrypto.KeyResidue) (receive.Message, bool) { if isFirst(contents) { // If it is the first message in a set, then handle it as so @@ -92,7 +94,7 @@ func (p *Partitioner) HandlePartition(sender *id.ID, storageTimestamp := netTime.Now() return p.partition.AddFirst(sender, fm.getType(), messageID, fm.getPart(), fm.getNumParts(), fm.getTimestamp(), storageTimestamp, - fm.getSizedContents(), relationshipFingerprint) + fm.getSizedContents(), relationshipFingerprint, residue) } else { // If it is a subsequent message part, handle it as so mp := messagePartFromBytes(contents) diff --git a/e2e/parse/partition/multiPartMessage.go b/e2e/parse/partition/multiPartMessage.go index d067248d2a792fe846a9cb2e42c92ba001d5b3d5..f7fd42085929395ea4fa3d4265909aeecf0fb467 100644 --- a/e2e/parse/partition/multiPartMessage.go +++ b/e2e/parse/partition/multiPartMessage.go @@ -41,6 +41,8 @@ type multiPartMessage struct { StorageTimestamp time.Time MessageType catalog.MessageType + KeyResidue e2e.KeyResidue + parts [][]byte kv *versioned.KV mux sync.Mutex diff --git a/e2e/parse/partition/store.go b/e2e/parse/partition/store.go index 7774e3187b90235d79f2ce4082024e8f4a547dec..0f128c48206826b9553c3d75704a32ecf742bdd1 100644 --- a/e2e/parse/partition/store.go +++ b/e2e/parse/partition/store.go @@ -14,6 +14,7 @@ import ( "gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/e2e/receive" "gitlab.com/elixxir/client/storage/versioned" + "gitlab.com/elixxir/crypto/e2e" "gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/netTime" "golang.org/x/crypto/blake2b" @@ -51,12 +52,13 @@ func NewOrLoad(kv *versioned.KV) *Store { func (s *Store) AddFirst(partner *id.ID, mt catalog.MessageType, messageID uint64, partNum, numParts uint8, senderTimestamp, - storageTimestamp time.Time, part []byte, relationshipFingerprint []byte) ( + storageTimestamp time.Time, part []byte, relationshipFingerprint []byte, + residue e2e.KeyResidue) ( receive.Message, bool) { mpm := s.load(partner, messageID) - mpm.AddFirst(mt, partNum, numParts, senderTimestamp, storageTimestamp, part) + mpm.KeyResidue = residue msg, ok := mpm.IsComplete(relationshipFingerprint) s.mux.Lock()