Documentation ¶
Index ¶
- Constants
- func EvaluateCompressedSIH(pickup *id.ID, msgHash, identifier []byte, tags []string, sih []byte) (matchedTags map[string]struct{}, metadata []byte, identifierFound bool, ...)
- func ForMe(preimage Preimage, contents, hash []byte) bool
- func ForMeFromMessageHash(preimage Preimage, messageHash, hash []byte) bool
- func GetMessageHash(messagePayload []byte) []byte
- func Hash(preimage Preimage, contents []byte) []byte
- func HashFromMessageHash(preimage Preimage, messageHash []byte) []byte
- func MakeCompressedSIH(pickup *id.ID, msgHash, identifier []byte, tags []string, metadata []byte) ([]byte, error)
- type Preimage
Constants ¶
const ( Default = "default" Silent = "silent" Group = "group" )
Variables ¶
This section is empty.
Functions ¶
func EvaluateCompressedSIH ¶
func EvaluateCompressedSIH(pickup *id.ID, msgHash, identifier []byte, tags []string, sih []byte) (matchedTags map[string]struct{}, metadata []byte, identifierFound bool, err error)
EvaluateCompressedSIH decrypts an encrypted bloomfilter using the pickup ID and msgHash as the key and nonce, respectively. It decodes the result into a bloom filter, then it returns the tags passed in which are marked as present in the bloom filter. Returns the metadata stored in the bloom filter
func ForMeFromMessageHash ¶
func GetMessageHash ¶
func HashFromMessageHash ¶
func MakeCompressedSIH ¶
func MakeCompressedSIH(pickup *id.ID, msgHash, identifier []byte, tags []string, metadata []byte) ([]byte, error)
MakeCompressedSIH creates an SIH with multiple services that can be checked for by stuffing each Hash into a bloom filter. It then uses the pickup ID as the key and the msgHash as the nonce to encrypt the filter and returns the result. The identifier is added to the bloom like an SIH (hash of msgHash + identifier) to confirm it belongs to the SIH quickly on evaluation. the metadata will be appended and returned to the receiver