xoodoo

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxRounds is current ceiling on how many iterations of Xoodoo can be done in the permutation
	// function
	MaxRounds = 12
	// StateSizeBytes describes the Xoodoo object in term of the number of bytes it is made up of
	StateSizeBytes = 48
	// StateSizeBytes describes the Xoodoo object in term of the number of 32-bit unsigned ints it is made up of
	StateSizeWords = 12
)

Variables

View Source
var (
	// RoundConstants is the sequence of 32-bit constants applied in each round of Xoodoo
	RoundConstants = [StateSizeWords]uint32{
		0x00000058,
		0x00000038,
		0x000003C0,
		0x000000D0,
		0x00000120,
		0x00000014,
		0x00000060,
		0x0000002C,
		0x00000380,
		0x000000F0,
		0x000001A0,
		0x00000012,
	}
)

Functions

This section is empty.

Types

type XooDoo

type XooDoo struct {
	State XooDooState
	// contains filtered or unexported fields
}

func NewXooDoo

func NewXooDoo(rounds int, state [StateSizeBytes]byte) (*XooDoo, error)

func (*XooDoo) Bytes

func (xd *XooDoo) Bytes() []byte

func (*XooDoo) Permutation

func (xd *XooDoo) Permutation()

Permutation executes an optimized implementation of Xoodoo permutation over the provided xoodoo state

func (*XooDoo) XorExtractBytes

func (xds *XooDoo) XorExtractBytes(x []byte) ([]byte, error)

type XooDooState

type XooDooState [StateSizeWords]uint32

func XorState

func XorState(a, b XooDooState) XooDooState

func (*XooDooState) MarshalBinary

func (xds *XooDooState) MarshalBinary() (data []byte, err error)

func (*XooDooState) UnmarshalBinary

func (xds *XooDooState) UnmarshalBinary(data []byte) error

func (*XooDooState) XorByte

func (xds *XooDooState) XorByte(x byte, offset int) error

func (*XooDooState) XorStateBytes

func (xds *XooDooState) XorStateBytes(in []byte)

Jump to

Keyboard shortcuts

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