func sharedSecretID(sender, receiver ed25519.PublicKey, sharedSecretID []byte) (mh.Multihash, error) {
	b := bytes.NewBuffer(sender)
	if _, err := b.Write(receiver); err != nil {
		return nil, err
	}
	if _, err := b.Write(sharedSecretID); err != nil {
		return nil, err
	}
	return mh.Sum(b.Bytes(), mh.SHA3_256, -1)
}
generate shared secret id
package chat
import (
	"bytes"
	"encoding/binary"
	"encoding/json"
	"errors"
	db "github.com/Bit-Nation/panthalassa/db"
	bpb "github.com/Bit-Nation/protobuffers"
	x3dh "github.com/Bit-Nation/x3dh"
	mh "github.com/multiformats/go-multihash"
	dr "github.com/tiabc/doubleratchet"
	ed25519 "golang.org/x/crypto/ed25519"
)
func (c *Chat) MarkMessagesAsRead(chatID int) error {
	return c.chatStorage.ReadMessages(chatID)
}
type drDhPair struct {
	x3dhPair x3dh.KeyPair
}
func (p *drDhPair) PrivateKey() dr.Key {
	var k dr.Key
	copy(k[:], p.x3dhPair.PrivateKey[:])
	return k
}
func (p *drDhPair) PublicKey() dr.Key {
	var k dr.Key
	copy(k[:], p.x3dhPair.PublicKey[:])
	return k
}
func (c *Chat) refreshSignedPreKey(idPubKey ed25519.PublicKey) error {
	signedPreKey, err := c.backend.FetchSignedPreKey(idPubKey)
	if err != nil {
		return err
	}
	validSig, err := signedPreKey.VerifySignature(idPubKey)
	if err != nil {
		return err
	}
	if !validSig {
		return errors.New("signed pre key signature is invalid")
	}
	expired := signedPreKey.OlderThan(db.SignedPreKeyValidTimeFrame)
	if expired {
		return errors.New("signed pre key expired")
	}
	return c.userStorage.PutSignedPreKey(idPubKey, signedPreKey)
}