sih

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
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 ForMe

func ForMe(preimage Preimage, contents, hash []byte) bool

func ForMeFromMessageHash

func ForMeFromMessageHash(preimage Preimage, messageHash, hash []byte) bool

func GetMessageHash

func GetMessageHash(messagePayload []byte) []byte

func Hash

func Hash(preimage Preimage, contents []byte) []byte

func HashFromMessageHash

func HashFromMessageHash(preimage Preimage, messageHash []byte) []byte

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

Types

type Preimage

type Preimage [32]byte

func MakePreimage

func MakePreimage(identifier []byte, tag string) Preimage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL