precompiled

package
v0.0.0-...-680381e Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IV = [8]uint64{
	0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1,
	0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179,
}

IV is an initialization vector for BLAKE2b

Functions

func F

func F(h *[8]uint64, m [16]uint64, c [2]uint64, f bool, rounds uint32)

F is a compression function for BLAKE2b. It takes as an argument the state vector `h`, message block vector `m`, offset counter `t`, final block indicator flag `f`, and number of rounds `rounds`. The state vector provided as the first parameter is modified by the function.

func ReadTestCase

func ReadTestCase(t *testing.T, path string, f func(t *testing.T, c *TestCase))

Types

type Precompiled

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

Precompiled is the runtime for the precompiled contracts

func NewPrecompiled

func NewPrecompiled() *Precompiled

NewPrecompiled creates a new runtime for the precompiled contracts

func (*Precompiled) CanRun

func (p *Precompiled) CanRun(c *runtime.Contract, _ runtime.Host, config *chain.ForksInTime) bool

CanRun implements the runtime interface

func (*Precompiled) Name

func (p *Precompiled) Name() string

Name implements the runtime interface

func (*Precompiled) Run

Run runs an execution

type TestCase

type TestCase struct {
	Name     string
	Input    []byte
	Expected []byte
	Gas      uint64
}

Jump to

Keyboard shortcuts

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