gophertags

package module
v0.0.0-...-1b46ef7 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Fuzzytags for Go

This is an extremely rough initial implementation of fuzzytags in Go. While it seems to have self-consistent behaviors and previous Rust/Go projects using these Ristretto libraries have been interoperable, I don't yet know if that's actually true for a variety of reasons. Stay tuned.

Documentation

Overview

Gophers are fuzzy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectionKey

type DetectionKey struct {
	// contains filtered or unexported fields
}

DetectionKey is given to the adversarial mailbox to test inbound messages for a given recipient. Detection keys have an inherent false positive rate set at construction.

func (*DetectionKey) Test

func (dk *DetectionKey) Test(f *Flag) bool

Test returns true if the given flag matches the detection key.

type Flag

type Flag struct {
	// contains filtered or unexported fields
}

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey is the public key that will be used to send messages to the recipient.

func (*PublicKey) GenerateFlag

func (pk *PublicKey) GenerateFlag() *Flag

GenerateFlag creates a randomized flag ciphertext for the given public key.

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

SecretKey is the secret key held by the ultimate recipient of the messages. It is used to derive public keys and detection keys for distribution. Internally, it's a vector of Ristretto255 scalars (the detection key) and Ristretto255 elements (the public key).

func NewSecretKey

func NewSecretKey(gamma int) *SecretKey

NewSecretKey constructs a secret key with a maximum false positive rate of 2^-gamma.

func (*SecretKey) ExtractDetectionKey

func (sk *SecretKey) ExtractDetectionKey(n int) *DetectionKey

ExtractDetectionKey produces a detection key with false positive rate 0 <= 2^-n <= 2^-gamma. Internally, it's a copy of the first n scalars in the secret key.

func (*SecretKey) PublicKey

func (sk *SecretKey) PublicKey() *PublicKey

PublicKey returns a deep copy of the secret key's associated public key.

Jump to

Keyboard shortcuts

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