commitments

package
v0.0.0-...-02c3ccb Latest Latest
Warning

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

Go to latest
Published: May 22, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package commitments implements a cryptographic commitment.

Commitment scheme is as follows: T = HMAC(fixedKey, "Key Transparency Commitment" || 16 byte nonce || message) message is defined as: len(userID) || userID || data

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidCommitment occurs when the commitment doesn't match the profile.
	ErrInvalidCommitment = errors.New("invalid commitment")
)

Functions

func Commit

func Commit(userID, appID string, data []byte) ([]byte, *tpb.Committed, error)

Commit makes a cryptographic commitment under a specific userID to data.

func Verify

func Verify(userID, appID string, commitment []byte, committed *tpb.Committed) error

Verify customizes a commitment with a userID.

Types

type Committer

type Committer interface {
	// Write saves a cryptographic commitment and associated data.
	Write(ctx context.Context, commitment []byte, committed *tpb.Committed) error
	// Read looks up a cryptograpic commitment and returns associated data.
	Read(ctx context.Context, commitment []byte) (*tpb.Committed, error)
}

Committer saves cryptographic commitments.

Jump to

Keyboard shortcuts

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