crypto

package
v0.0.0-...-7ad0b1f Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: MIT Imports: 0 Imported by: 0

README

crypto

The crypto package currently has an interface for Timelock Puzzles, and an implementation of both the RCW96 timelock puzzle and a simple hash-based timelock puzzle. In the case of the hash-based timelock puzzle, it takes just as long to create the puzzle (if you are encrypting information with the result) as it does to solve it. With RCW96, this is not the case. It's supposed to be similar to interact with as the golang built-in crypto library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Puzzle

type Puzzle interface {
	// Solve solves the puzzle and returns the answer, or fails
	Solve() (answer []byte, err error)
	// Serialize turns the puzzle into something that's able to be sent over the wire
	Serialize() (raw []byte, err error)
}

Puzzle is what can actually be solved. It should return the same answer that was the result of SetupTimelockPuzzle.

type Timelock

type Timelock interface {
	// SetupTimelockPuzzle sends key k to the future in time t, returning a puzzle and an answer, or fails
	SetupTimelockPuzzle(t uint64) (puzzle Puzzle, answer []byte, err error)
}

Timelock is an interface that all timelock implementations should conform to.

Directories

Path Synopsis
Package rsw is an implementation of Rivest-Shamir-Wagner timelock puzzles, from RSW96.
Package rsw is an implementation of Rivest-Shamir-Wagner timelock puzzles, from RSW96.

Jump to

Keyboard shortcuts

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