oprf

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package oprf implements the Elliptic Curve Oblivious Pseudorandom Function (EC-OPRF) from https://tools.ietf.org/html/draft-irtf-cfrg-voprf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Identifier
	// contains filtered or unexported fields
}

Client implements the OPRF client and holds its state.

func (*Client) Blind

func (c *Client) Blind(input []byte, blind *group.Scalar) *group.Element

Blind masks the input.

func (*Client) Finalize

func (c *Client) Finalize(evaluation *group.Element) []byte

Finalize terminates the OPRF by unblinding the evaluation and hashing the transcript.

type Identifier added in v0.9.1

type Identifier string

Identifier of the OPRF compatible cipher suite to be used.

const (
	// Ristretto255Sha512 is the OPRF cipher suite of the Ristretto255 group and SHA-512.
	Ristretto255Sha512 Identifier = "ristretto255-SHA512"

	// P256Sha256 is the OPRF cipher suite of the NIST P-256 group and SHA-256.
	P256Sha256 Identifier = "P256-SHA256"

	// P384Sha384 is the OPRF cipher suite of the NIST P-384 group and SHA-384.
	P384Sha384 Identifier = "P384-SHA384"

	// P521Sha512 is the OPRF cipher suite of the NIST P-512 group and SHA-512.
	P521Sha512 Identifier = "P521-SHA512"
)

func IDFromGroup added in v0.9.1

func IDFromGroup(g group.Group) Identifier

IDFromGroup returns the OPRF identifier corresponding to the input group.

func (Identifier) Available added in v0.9.1

func (i Identifier) Available() bool

Available returns whether the Identifier has been registered of not.

func (Identifier) Client added in v0.9.1

func (i Identifier) Client() *Client

Client returns an OPRF client.

func (Identifier) DeriveKey added in v0.9.1

func (i Identifier) DeriveKey(seed, info []byte) *group.Scalar

DeriveKey returns a scalar mapped from the input.

func (Identifier) Evaluate added in v0.9.1

func (i Identifier) Evaluate(privateKey *group.Scalar, blindedElement *group.Element) *group.Element

Evaluate evaluates the blinded input with the given key.

func (Identifier) Group added in v0.9.1

func (i Identifier) Group() group.Group

Group returns the Group identifier for the cipher suite.

Jump to

Keyboard shortcuts

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