commitment

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const U = common.U

Variables

View Source
var (
	ErrProofDeserialization = errors.New("deserialization error")
	ErrProofAlgebraic       = errors.New("algebraic relation failed")
)

Functions

func EqualityProofFiatShamirChallenges added in v1.0.0

func EqualityProofFiatShamirChallenges(transcript *merlin.Transcript, ep *EqualityProof) (c Scalar, w Scalar, err error)

EqualityProofFiatShamirChallenges returns Merlin Fiat–Shamir scalars (c, w) after appending the ciphertext-commitment-equality proof domain separator and proof messages to transcript.

func NewEqualityInstructionTranscript added in v1.0.0

func NewEqualityInstructionTranscript(ctx *CiphertextCommitmentEqualityProofContext) *merlin.Transcript

NewEqualityInstructionTranscript returns the Merlin transcript after the ciphertext-commitment-equality instruction prefix (pubkey, ciphertext, commitment).

func VerifyEqualityProof

func VerifyEqualityProof(
	pd *CiphertextCommitmentEqualityProofData,
) error

func VerifyEqualityProofWithTranscript added in v1.0.0

func VerifyEqualityProofWithTranscript(
	pd *CiphertextCommitmentEqualityProofData,
	t *merlin.Transcript,
) error

func VerifyWithdrawEqualityProof added in v1.0.0

func VerifyWithdrawEqualityProof(pd *WithdrawCiphertextCommitmentEqualityProofData) error

func VerifyWithdrawEqualityProofWithTranscript added in v1.0.0

func VerifyWithdrawEqualityProofWithTranscript(
	pd *WithdrawCiphertextCommitmentEqualityProofData,
	t *merlin.Transcript,
) error

Types

type CiphertextCommitmentEqualityProofContext

type CiphertextCommitmentEqualityProofContext struct {
	Pubkey     PodElGamalPubkey
	Ciphertext PodElGamalCiphertext
	Commitment PodPedersenCommitment
}

type CiphertextCommitmentEqualityProofData

type CiphertextCommitmentEqualityProofData struct {
	Context CiphertextCommitmentEqualityProofContext
	Proof   PodCiphertextCommitmentEqualityProof
}

type CompressedRistretto

type CompressedRistretto = common.CompressedRistretto

type DecryptHandle

type DecryptHandle struct {
	common.DecryptHandle
}

type ElGamalCiphertext

type ElGamalCiphertext struct {
	Commitment PedersenCommitment
	Handle     DecryptHandle
}

func (*ElGamalCiphertext) FromPod

type ElGamalPubkey

type ElGamalPubkey struct {
	common.ElGamalPubkey
}

func (*ElGamalPubkey) FromPod

func (pk *ElGamalPubkey) FromPod(v PodElGamalPubkey) error

type EqualityProof

type EqualityProof struct {
	Y0 CompressedRistretto
	Y1 CompressedRistretto
	Y2 CompressedRistretto
	Zs Scalar
	Zx Scalar
	Zr Scalar
}

func EqualityProofFromBytes

func EqualityProofFromBytes(buf *[U * 6]byte) (*EqualityProof, error)

func (EqualityProof) Verify

func (ep EqualityProof) Verify(
	pubkey *ElGamalPubkey,
	ciphertext *ElGamalCiphertext,
	commitment *PedersenCommitment,
	transcript *merlin.Transcript,
) error

type PedersenCommitment

type PedersenCommitment struct {
	common.PedersenCommitment
}

func PedersenCommitmentFromPod

func PedersenCommitmentFromPod(v PodPedersenCommitment) (*PedersenCommitment, error)

type PodCiphertextCommitmentEqualityProof

type PodCiphertextCommitmentEqualityProof struct {
	Y0 [U]byte
	Y1 [U]byte
	Y2 [U]byte
	Zs [U]byte
	Zx [U]byte
	Zr [U]byte
}

func (*PodCiphertextCommitmentEqualityProof) AsBytes

func (p *PodCiphertextCommitmentEqualityProof) AsBytes() [U * 6]byte

type PodElGamalCiphertext

type PodElGamalCiphertext struct {
	Commitment [U]byte
	Handle     [U]byte
}

type PodElGamalPubkey

type PodElGamalPubkey struct {
	Bytes [U]byte
}

type PodPedersenCommitment

type PodPedersenCommitment struct {
	Bytes [U]byte
}

type PodU64 added in v1.0.0

type PodU64 [8]byte

type Point

type Point = common.Point

type Scalar

type Scalar = common.Scalar

type WithdrawCiphertextCommitmentEqualityProofContext added in v1.0.0

type WithdrawCiphertextCommitmentEqualityProofContext struct {
	Pubkey     PodElGamalPubkey
	Ciphertext PodElGamalCiphertext
	Commitment PodPedersenCommitment
	Nonce      PodU64
}

type WithdrawCiphertextCommitmentEqualityProofData added in v1.0.0

type WithdrawCiphertextCommitmentEqualityProofData struct {
	Context WithdrawCiphertextCommitmentEqualityProofContext
	Proof   PodCiphertextCommitmentEqualityProof
}

Jump to

Keyboard shortcuts

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