gofuzz

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package gofuzz modified from https://github.com/dvyukov/go-fuzz Package defs provides constants required by go-fuzz-build, go-fuzz, and instrumented code.

Package gofuzz modified from https://github.com/dvyukov/go-fuzz

Package gofuzz modified from https://github.com/dvyukov/go-fuzz Package pcg implements a 32 bit PRNG with a 64 bit period: pcg xsh rr 64 32. See https://www.pcg-random.org/ for more information. This implementation is geared specifically towards go-fuzz's needs: Simple creation and use, no reproducibility, no concurrency safety, just the methods go-fuzz needs, optimized for speed.

Package gofuzz modified from https://github.com/dvyukov/go-fuzz

Index

Constants

View Source
const (
	// CoverSize is a constant.
	CoverSize = 64 << 10
	// MaxInputSize is a constant.
	MaxInputSize = 1 << 20
	// SonarRegionSize is a constant.
	SonarRegionSize = 1 << 20
)
View Source
const (
	// SonarEQL is an enumeration.
	SonarEQL = iota
	// SonarNEQ is an enumeration.
	SonarNEQ
	// SonarLSS is an enumeration.
	SonarLSS
	// SonarGTR is an enumeration.
	SonarGTR
	// SonarLEQ is an enumeration.
	SonarLEQ
	// SonarGEQ is an enumeration.
	SonarGEQ

	// SonarOpMask is an enumeration.
	SonarOpMask = 7
	// SonarLength is an enumeration.
	SonarLength = 1 << 3
	// SonarSigned is an enumeration.
	SonarSigned = 1 << 4
	// SonarString is an enumeration.
	SonarString = 1 << 5
	// SonarConst1 is an enumeration.
	SonarConst1 = 1 << 6
	// SonarConst2 is an enumeration.
	SonarConst2 = 1 << 7

	// SonarHdrLen is an enumeration.
	SonarHdrLen = 6
	// SonarMaxLen is an enumeration.
	SonarMaxLen = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Data []byte
	// contains filtered or unexported fields
}

Artifact is the basic element of PersistentSet.

type Mutator

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

Mutator is a primitive and is used to mutate bytes.

func NewMutator

func NewMutator() *Mutator

NewMutator is used to create a Mutator.

func (*Mutator) Mutate

func (m *Mutator) Mutate(data []byte) []byte

Mutate use different methods to mutate bytes.

type PersistentSet

type PersistentSet struct {
	M map[Sig]Artifact
	// contains filtered or unexported fields
}

PersistentSet is a set of binary blobs with a persistent mirror on disk.

func NewPersistentSet

func NewPersistentSet(dir string) *PersistentSet

NewPersistentSet for new PersistentSet.

func (*PersistentSet) Add

func (ps *PersistentSet) Add(a Artifact) bool

Add Artifact to PersistentSet.

func (*PersistentSet) AddDescription

func (ps *PersistentSet) AddDescription(data []byte, desc []byte, typ string)

AddDescription creates a complementary to data file on disk.

type Rand

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

Rand is a PRNG. It should not be copied or shared. No Rand methods are concurrency safe. They are small, and cheap to create. If in doubt: Just make another one.

func New

func New() *Rand

New generates a new, seeded Rand, ready for use.

func (*Rand) Bool

func (r *Rand) Bool() bool

Bool generates a random bool.

func (*Rand) Exp2

func (r *Rand) Exp2() int

Exp2 generates n with probability 1/2^(n+1).

func (*Rand) Intn

func (r *Rand) Intn(n int) int

Intn returns a pseudo-random number in [0, n). n must fit in a uint32.

func (*Rand) Uint32

func (r *Rand) Uint32() uint32

Uint32 returns a pseudo-random uint32.

func (*Rand) Uint32n

func (r *Rand) Uint32n(n uint32) uint32

Uint32n returns a pseudo-random number in [0, n).

For implementation details, see: https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction https://lemire.me/blog/2016/06/30/fast-random-shuffling

type Sig

type Sig [sha1.Size]byte

Sig for fixed-length byte.

func Hash

func Hash(data []byte) Sig

Hash by SHA-1 checksum.

Jump to

Keyboard shortcuts

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