modproof

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Iterations is the number of iterations used in the modular proof for soundness.
	Iterations = 80
	// ProofModBytesParts is the number of byte parts in a serialized ProofMod.
	ProofModBytesParts = Iterations*2 + 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ProofMod

type ProofMod struct {
	W *big.Int
	X [Iterations]*big.Int
	A *big.Int
	B *big.Int
	Z [Iterations]*big.Int
}

ProofMod is a zero-knowledge proof that N is a product of two primes (Paillier-Blum modulus proof).

func NewProof

func NewProof(Session []byte, N, P, Q *big.Int, rand io.Reader) (*ProofMod, error)

NewProof generates a new modular proof that N = P*Q where P and Q are safe primes.

func NewProofFromBytes

func NewProofFromBytes(bzs [][]byte) (*ProofMod, error)

NewProofFromBytes reconstructs a ProofMod from a slice of byte slices.

func (*ProofMod) Bytes

func (pf *ProofMod) Bytes() [ProofModBytesParts][]byte

Bytes serializes the proof into a fixed-size array of byte slices.

func (*ProofMod) ValidateBasic

func (pf *ProofMod) ValidateBasic() bool

ValidateBasic checks that all fields of the proof are non-nil.

func (*ProofMod) Verify

func (pf *ProofMod) Verify(Session []byte, N *big.Int) bool

Verify checks whether the modular proof is valid for the given modulus N.

Jump to

Keyboard shortcuts

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