encryption + helpers + contact card compression + server routing start

This commit is contained in:
ycc
2022-10-22 14:41:48 +02:00
parent 2160babeae
commit fc3747a124
15 changed files with 350 additions and 24 deletions

View File

@ -102,3 +102,11 @@ func (ints *InternalServer) PackServerMessage(payload []byte, signature []byte)
}
return out, nil
}
func (ints *InternalServer) UnPackServerMessage(protoPackedMessage []byte) (payload []byte, signature []byte, err error) {
msg := &meowlib.PackedServerMessage{}
if err := proto.Unmarshal(protoPackedMessage, msg); err != nil {
return nil, nil, err
}
return msg.Payload, msg.Signature, nil
}