accumulator

package module
v0.0.0-...-58d9dfa Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package accumulator implements a cryptographic accumulator. An accumulator is like a merkle tree but the proofs are constant size. This package is just a toy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(random io.Reader) (*PublicKey, *PrivateKey, error)

GenerateKey generates an RSA accumulator keypair. The private key is mostly used for debugging and should usually be destroyed as part of a trusted setup phase.

func HashToPrime

func HashToPrime(data []byte) *big.Int

Types

type PrivateKey

type PrivateKey struct {
	P, Q    *big.Int
	N       *big.Int // N = P*Q
	Totient *big.Int // Totient = (P-1)*(Q-1)
}

PrivateKey is the private key for an RSA accumulator. It is not needed for typical uses of an accumulator.

func (*PrivateKey) Accumulate

func (key *PrivateKey) Accumulate(items ...[]byte) (acc *big.Int, witnesses []*big.Int)

type PublicKey

type PublicKey struct {
	N *big.Int
}

func (*PublicKey) Accumulate

func (key *PublicKey) Accumulate(items ...[]byte) (acc *big.Int, witnesses []*big.Int)

func (*PublicKey) Verify

func (key *PublicKey) Verify(acc *big.Int, witness *big.Int, item []byte) bool

Jump to

Keyboard shortcuts

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