colocationpuzzle

package
Version: v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IVSize  = aes.BlockSize
	KeySize = 16 // XXX: This shouldn't go here.
)

Variables

This section is empty.

Functions

func Solve

func Solve(params Parameters, chunks [][]byte, goal []byte) ([]byte, uint32, error)

params, enc-chunks, goal -> secret, offset (offset is not necessary, but having it is useful for testing/debugging)

func VerifySolution

func VerifySolution(params Parameters, chunks [][]byte, goal []byte, offset uint32) ([]byte, uint32, error)

Types

type Parameters

type Parameters struct {
	Rounds      uint32
	StartOffset uint32 // XXX: Not respected yet.
	StartRange  uint32
}

func (*Parameters) Validate

func (params *Parameters) Validate() error

type Puzzle

type Puzzle struct {
	Secret []byte
	Goal   []byte // Goal is the only value that's shared with the client.
	Offset uint32
	Params Parameters
}

func Generate

func Generate(params Parameters, chunks [][]byte, innerKeys [][]byte, innerIVs [][]byte) (*Puzzle, error)

params, raw-chunks, keys -> secret, goal, offset (offset is not shared with the client)

func (*Puzzle) IV

func (p *Puzzle) IV() []byte

func (*Puzzle) Key

func (p *Puzzle) Key() []byte

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL