ctstretch

package
v0.0.0-...-1add468 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: BSD-2-Clause, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitShuffle

func BitShuffle(data []byte, rng cipher.Stream, rev bool) error

func BitSwap

func BitSwap(data []byte, i, j uint64) error

Swaps bits i and j in data. Bit 0 is the first bit of data[0].

func BytesToUInt16

func BytesToUInt16(data []byte, startIDx, endIDx uint64) (uint16, error)

func CompressBytes

func CompressBytes(src, dst []byte, inputBlockBits, outputBlockBits uint64, inversion16, inversion8 map[uint64]uint64, stream cipher.Stream, tb int) error

func CompressedNBytes

func CompressedNBytes(expandedLen, inputBlockBits, outputBlockBits uint64) uint64

func CompressedNBytes_floor

func CompressedNBytes_floor(expandedLen, inputBlockBits, outputBlockBits uint64) uint64

func ExpandBytes

func ExpandBytes(src, dst []byte, inputBlockBits, outputBlockBits uint64, table16, table8 []uint64, stream cipher.Stream, tb int) error

func ExpandedNBytes

func ExpandedNBytes(srcLen, inputBlockBits, outputBlockBits uint64) uint64

func InvertTable

func InvertTable(vals []uint64) map[uint64]uint64

func PrintBits

func PrintBits(data []byte)

func SampleBiasedString

func SampleBiasedString(numBits uint64, bias float64, stream cipher.Stream) (uint64, error)

Bias of 0.8 means 80% probability of outputting 0

func SampleBiasedStrings

func SampleBiasedStrings(numBits, n uint64, bias float64, stream cipher.Stream) ([]uint64, error)

func UniformSample

func UniformSample(a, b uint64, stream cipher.Stream) (uint64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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