hasher

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package hasher provides a Hasher interface for hashing data with a given elliptic.Curve.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECCHasher

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

func NewECCHasher

func NewECCHasher(hashFn func() hash.Hash, c elliptic.Curve) *ECCHasher

func (*ECCHasher) Curve

func (h *ECCHasher) Curve() elliptic.Curve

func (*ECCHasher) Sum

func (h *ECCHasher) Sum() []byte

func (*ECCHasher) Write

func (h *ECCHasher) Write(p []byte) (int, error)

type Hasher

type Hasher interface {
	// Writer Write (via the embedded io.Writer interface) adds more data to the running hash.
	// It never returns an error.
	io.Writer

	// Sum appends the current hash to []byte(nil) and returns the resulting slice.
	// It does not change the underlying hash state.
	Sum() []byte

	// Curve returns the elliptic.Curve associated with the Hasher.
	Curve() elliptic.Curve
}

Jump to

Keyboard shortcuts

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