streamingprf

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package streamingprf provides implementations of streaming pseudorandom function families.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HKDFStreamingPRFKeyManager

type HKDFStreamingPRFKeyManager struct{}

HKDFStreamingPRFKeyManager is a KeyManager for HKDF Streaming PRF keys. It is exported for use in keyderivation.prfBasedDeriver. This is not part of the public API as this is in internal/.

func (*HKDFStreamingPRFKeyManager) DoesSupport

func (km *HKDFStreamingPRFKeyManager) DoesSupport(typeURL string) bool

DoesSupport returns true iff this KeyManager supports key type identified by typeURL.

func (*HKDFStreamingPRFKeyManager) NewKey

func (km *HKDFStreamingPRFKeyManager) NewKey(serializedKeyFormat []byte) (proto.Message, error)

NewKey generates a new key according to specification in serializedKeyFormat. It is not implemented for this KeyManager to prevent the generation of keys of this key type.

func (*HKDFStreamingPRFKeyManager) NewKeyData

func (km *HKDFStreamingPRFKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)

NewKeyData generates a new KeyData according to specification in serializedkeyFormat. This should be used solely by the key management API. It is not implemented for this KeyManager to prevent the generation of keys of this key type.

func (*HKDFStreamingPRFKeyManager) Primitive

func (km *HKDFStreamingPRFKeyManager) Primitive(serializedKey []byte) (interface{}, error)

Primitive constructs a primitive instance for the key given in serializedKey.

func (*HKDFStreamingPRFKeyManager) TypeURL

func (km *HKDFStreamingPRFKeyManager) TypeURL() string

TypeURL returns the type URL that identifes the key type of keys managed by this KeyManager.

type StreamingPRF

type StreamingPRF interface {
	// Compute computes the PRF selected by the specified key on input and returns
	// the result via a reader.
	Compute(input []byte) (io.Reader, error)
}

StreamingPRF is the interface used to represent a streaming pseudorandom function family for a specified key.

It has the same properties as the PRF primitive.

func New

func New(h *keyset.Handle) (StreamingPRF, error)

New generates a new instance of the Streaming PRF primitive.

Jump to

Keyboard shortcuts

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