sha256

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Avx512ServerUid = 16

Do not start at 0 but next multiple of 16 so as to be able to differentiate with default initialiation value of 0

View Source
const BlockSize = 64

BlockSize - The blocksize of SHA256 in bytes.

View Source
const Size = 32

Size - The size of a SHA256 checksum in bytes.

Variables

This section is empty.

Functions

func New

func New() hash.Hash

New returns a new hash.Hash computing the SHA256 checksum.

func NewAvx512

func NewAvx512(a512srv *Avx512Server) hash.Hash

func Sum256

func Sum256(data []byte) [Size]byte

Sum256 - single caller sha256 helper

Types

type Avx512Digest

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

Type for computing SHA256 using AVX51

func (Avx512Digest) BlockSize

func (d Avx512Digest) BlockSize() int

Return blocksize of checksum

func (*Avx512Digest) Reset

func (d *Avx512Digest) Reset()

func (*Avx512Digest) Size

func (d *Avx512Digest) Size() int

Return size of checksum

func (*Avx512Digest) Sum

func (d *Avx512Digest) Sum(in []byte) (result []byte)

Return sha256 sum in bytes

func (*Avx512Digest) Write

func (d *Avx512Digest) Write(p []byte) (nn int, err error)

Write to digest

type Avx512LaneInfo

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

Info for each lane

type Avx512Server

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

Type to implement 16x parallel handling of SHA256 invocations

func NewAvx512Server

func NewAvx512Server() *Avx512Server

Create new object for parallel processing handling

func (*Avx512Server) Process

func (a512srv *Avx512Server) Process()

Sole handler for reading from the input channel

func (*Avx512Server) Sum

func (a512srv *Avx512Server) Sum(uid uint64, p []byte) [32]byte

func (*Avx512Server) Write

func (a512srv *Avx512Server) Write(uid uint64, p []byte) (nn int, err error)

Jump to

Keyboard shortcuts

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