keccak

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRate = 168

Variables

This section is empty.

Functions

func Bytepad

func Bytepad(x []byte, w int) []byte

Bytepad applies the SP 800-185 bytepad operation to the input.

func EncodeString

func EncodeString(data []byte) []byte

EncodeString encodes a byte string per SP 800-185.

func LeftEncode

func LeftEncode(x uint64) []byte

LeftEncode encodes the input integer x following the SP 800-185 definition.

func ParallelHash128

func ParallelHash128(msg []byte, blockSize int, customization []byte, outLen int) ([]byte, error)

ParallelHash128 computes ParallelHash-128 over msg using the given blockSize and customization, producing outLen bytes of output.

func ParallelHash256

func ParallelHash256(msg []byte, blockSize int, customization []byte, outLen int) ([]byte, error)

ParallelHash256 computes ParallelHash-256 over msg using the given blockSize and customization.

func RightEncode

func RightEncode(x uint64) []byte

RightEncode encodes the input integer x following the SP 800-185 definition.

func SumFixed

func SumFixed(rate int, ds byte, out, msg []byte)

SumFixed absorbs msg into a fresh Keccak sponge with the provided parameters and squeezes a fixed-length digest into out. The domain separation byte must follow the conventions from NIST FIPS 202.

func TupleHash128

func TupleHash128(tuple [][]byte, customization []byte, outLen int) ([]byte, error)

TupleHash128 computes the TupleHash-128 digest over the provided tuple, using the optional customization string. The output length is measured in bytes.

func TupleHash256

func TupleHash256(tuple [][]byte, customization []byte, outLen int) ([]byte, error)

TupleHash256 computes the TupleHash-256 digest over the provided tuple.

Types

type Sponge

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

func (*Sponge) Absorb

func (s *Sponge) Absorb(p []byte)

func (*Sponge) Init

func (s *Sponge) Init(rate int, ds byte)

func (*Sponge) Rate

func (s *Sponge) Rate() int

func (*Sponge) Reset

func (s *Sponge) Reset()

func (*Sponge) Squeeze

func (s *Sponge) Squeeze(out []byte)

Jump to

Keyboard shortcuts

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