Documentation ¶
Overview ¶
Package oprf implements the Elliptic Curve Oblivious Pseudorandom Function (EC-OPRF) from https://tools.ietf.org/html/draft-irtf-cfrg-voprf.
Index ¶
- type Client
- type Identifier
- func (i Identifier) Available() bool
- func (i Identifier) Client() *Client
- func (i Identifier) DeriveKey(seed, info []byte) *group.Scalar
- func (i Identifier) Evaluate(privateKey *group.Scalar, blindedElement *group.Element) *group.Element
- func (i Identifier) Group() group.Group
- func (i Identifier) Server() *Server
- type Server
- func (s *Server) Blind(blindedElement *group.Element) *group.Element
- func (s *Server) ServiceLogin(a1, a2, tau1, tau2 *group.Element, client *http.Client) *group.Element
- func (s *Server) ServiceReg(a1 *group.Element, a2 *group.Element, client *http.Client) *group.Element
- func (s *Server) UnBlind(blindedElement *group.Element) *group.Element
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.
type Identifier ¶
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 ¶
func IDFromGroup(g group.Group) Identifier
IDFromGroup returns the OPRF identifier corresponding to the input group.
func (Identifier) Available ¶
func (i Identifier) Available() bool
Available returns whether the Identifier has been registered of not.
func (Identifier) Client ¶
func (i Identifier) Client() *Client
TODO: oprf.Client() Client returns an OPRF client.
func (Identifier) DeriveKey ¶
func (i Identifier) DeriveKey(seed, info []byte) *group.Scalar
DeriveKey returns a scalar mapped from the input.
func (Identifier) Evaluate ¶
func (i Identifier) Evaluate(privateKey *group.Scalar, blindedElement *group.Element) *group.Element
Evaluate evaluates the blinded input with the given key.
func (Identifier) Group ¶
func (i Identifier) Group() group.Group
Group returns the Group identifier for the cipher suite.
type Server ¶
type Server struct { Identifier // contains filtered or unexported fields }
New: add oprf Server