x16rv3

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: ISC Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLAKE = iota
	BMW
	GROESTL
	JH
	KECCAK
	SKEIN
	LUFFA
	CUBEHASH
	SHAVITE
	SIMD
	ECHO
	HAMSI
	FUGUE
	SHABAL
	WHIRLPOOL
	SHA512
	HASH_FUNC_COUNT
)

Variables

This section is empty.

Functions

func ArrayToBytes

func ArrayToBytes(a []Uint128) []byte

func Sum256

func Sum256(in []byte) [32]byte

func Sum512

func Sum512(in []byte) [64]byte

Types

type Hash

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

Hash contains the state objects required to perform the x16.Hash.

func New

func New() *Hash

New returns a new object to compute a x16 hash.

func (*Hash) Hash

func (ref *Hash) Hash(src []byte, dst []byte)

Hash computes the hash from the src bytes and stores the result in dst.

type Uint128

type Uint128 struct {
	V0, V1 uint64
}

Uint128 is a big-endian 128 bit unsigned integer which wraps two uint64s.

func FromBytes

func FromBytes(b []byte) Uint128

FromBytes parses the byte slice as a 128 bit big-endian unsigned integer. The caller is responsible for ensuring the byte slice contains 16 bytes.

func FromInts

func FromInts(hi uint64, V1 uint64) Uint128

FromInts takes in two unsigned 64-bit integers and constructs a Uint128.

func FromIntsArray

func FromIntsArray(arr []uint64) Uint128

FromInts takes in two unsigned 64-bit integers and constructs a Uint128.

func FromString

func FromString(s string) (Uint128, error)

FromString parses a hexadecimal string as a 128-bit big-endian unsigned integer.

func Ur128_5xor

func Ur128_5xor(in0, in1, in2, in3, in4 Uint128) Uint128

func Xor128

func Xor128(in0, in1 Uint128) Uint128

func (Uint128) Add

func (u Uint128) Add(n uint64) Uint128

Add returns a new Uint128 incremented by n.

func (Uint128) And

func (u Uint128) And(o Uint128) Uint128

And returns a new Uint128 that is the bitwise AND of two Uint128 values.

func (Uint128) Compare

func (u Uint128) Compare(o Uint128) int

Compare compares the two Uint128.

func (Uint128) Equal

func (u Uint128) Equal(o Uint128) bool

Equal returns whether or not the Uint128 are equivalent.

func (Uint128) GetBytes

func (u Uint128) GetBytes() []byte

GetBytes returns a big-endian byte representation.

func (Uint128) Or

func (u Uint128) Or(o Uint128) Uint128

Or returns a new Uint128 that is the bitwise OR of two Uint128 values.

func (Uint128) String

func (u Uint128) String() string

String returns a hexadecimal string representation.

func (Uint128) Sub

func (u Uint128) Sub(n uint64) Uint128

Sub returns a new Uint128 decremented by n.

func (Uint128) ToUint64

func (u Uint128) ToUint64() []uint64

func (Uint128) Xor

func (u Uint128) Xor(o Uint128) Uint128

Xor returns a new Uint128 that is the bitwise XOR of two Uint128 values.

Directories

Path Synopsis
Package whirlpool implements the ISO/IEC 10118-3:2004 whirlpool cryptographic hash.
Package whirlpool implements the ISO/IEC 10118-3:2004 whirlpool cryptographic hash.

Jump to

Keyboard shortcuts

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