...

Package notsha256

import "cmd/internal/notsha256"
Overview
Index

Overview ▾

Package notsha256 implements the NOTSHA256 algorithm, a hash defined as bitwise NOT of SHA256. It is used in situations where exact fidelity to SHA256 is unnecessary. In particular, it is used in the compiler toolchain, which cannot depend directly on cgo when GOEXPERIMENT=boringcrypto (and in that mode the real sha256 uses cgo).

Constants

The blocksize in bytes.

const BlockSize = 64

The size of a checksum in bytes.

const Size = 32

func New

func New() hash.Hash

New returns a new hash.Hash computing the NOTSHA256 checksum. state of the hash.

func Sum256

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

Sum256 returns the SHA256 checksum of the data.