Documentation ¶
Index ¶
- type BatchDLEQProof
- func (proof *BatchDLEQProof) MarshalText() ([]byte, error)
- func (proof *BatchDLEQProof) UnmarshalText(bytes []byte) error
- func (proof *BatchDLEQProof) Verify(blindedTokens []*BlindedToken, signedTokens []*SignedToken, ...) (bool, error)
- func (proof *BatchDLEQProof) VerifyAndUnblind(tokens []*Token, blindedTokens []*BlindedToken, signedTokens []*SignedToken, ...) ([]*UnblindedToken, error)
- type BlindedToken
- type DLEQProof
- type PublicKey
- type SignedToken
- type SigningKey
- type Token
- type TokenPreimage
- type UnblindedToken
- type VerificationKey
- type VerificationSignature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchDLEQProof ¶
type BatchDLEQProof struct {
// contains filtered or unexported fields
}
BatchDLEQProof shows many points were signed by the same signing key as a particular PublicKey
func NewBatchDLEQProof ¶
func NewBatchDLEQProof(blindedTokens []*BlindedToken, signedTokens []*SignedToken, key *SigningKey) (*BatchDLEQProof, error)
NewBatchDLEQProof showing each SignedToken is the result of signing the corresponding BlindedToken with the given SigningKey
func (*BatchDLEQProof) MarshalText ¶
func (proof *BatchDLEQProof) MarshalText() ([]byte, error)
MarshalText marshalls the verification signature into text.
func (*BatchDLEQProof) UnmarshalText ¶
func (proof *BatchDLEQProof) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the unblinded token from text.
func (*BatchDLEQProof) Verify ¶
func (proof *BatchDLEQProof) Verify(blindedTokens []*BlindedToken, signedTokens []*SignedToken, publicKey *PublicKey) (bool, error)
Verify that the BatchDLEQProof shows each SignedToken is a BlindedToken signed by the same SigningKey as PublicKey
func (*BatchDLEQProof) VerifyAndUnblind ¶
func (proof *BatchDLEQProof) VerifyAndUnblind(tokens []*Token, blindedTokens []*BlindedToken, signedTokens []*SignedToken, publicKey *PublicKey) ([]*UnblindedToken, error)
VerifyAndUnblind each SignedToken if the BatchDLEQProof is valid
type BlindedToken ¶
type BlindedToken struct {
// contains filtered or unexported fields
}
BlindedToken is sent to the server for signing.
func (*BlindedToken) MarshalText ¶
func (t *BlindedToken) MarshalText() ([]byte, error)
MarshalText marshalls the blinded token into text.
func (*BlindedToken) UnmarshalText ¶
func (t *BlindedToken) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the blinded token from text.
type DLEQProof ¶
type DLEQProof struct {
// contains filtered or unexported fields
}
DLEQProof shows a point was signed by the same signing key as a particular PublicKey
func NewDLEQProof ¶
func NewDLEQProof(blindedToken *BlindedToken, signedToken *SignedToken, key *SigningKey) (*DLEQProof, error)
NewDLEQProof showing SignedToken is the result of signing BlindedToken with the given SigningKey
func (*DLEQProof) MarshalText ¶
MarshalText marshalls the verification signature into text.
func (*DLEQProof) UnmarshalText ¶
UnmarshalText unmarshalls the unblinded token from text.
func (*DLEQProof) Verify ¶
func (proof *DLEQProof) Verify(blindedToken *BlindedToken, signedToken *SignedToken, publicKey *PublicKey) (bool, error)
Verify that the DLEQProof shows the SignedToken is BlindedToken signed by the same SigningKey as PublicKey
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey is a committment by the server to a particular SigningKey.
func (*PublicKey) MarshalText ¶
MarshalText marshalls the verification signature into text.
func (*PublicKey) UnmarshalText ¶
UnmarshalText unmarshalls the unblinded token from text.
type SignedToken ¶
type SignedToken struct {
// contains filtered or unexported fields
}
SignedToken is the result of signing a BlindedToken.
func (*SignedToken) MarshalText ¶
func (t *SignedToken) MarshalText() ([]byte, error)
MarshalText marshalls the signed token into text.
func (*SignedToken) UnmarshalText ¶
func (t *SignedToken) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the signed token from text.
type SigningKey ¶
type SigningKey struct {
// contains filtered or unexported fields
}
SigningKey is used to sign a BlindedToken and verify an UnblindedToken.
This is a server secret and should NEVER be revealed to the client.
func RandomSigningKey ¶
func RandomSigningKey() (*SigningKey, error)
RandomSigningKey generates a new random `SigningKey` using the os random number generator.
func (*SigningKey) MarshalText ¶
func (k *SigningKey) MarshalText() ([]byte, error)
MarshalText marshalls the signing key into text.
func (*SigningKey) PublicKey ¶
func (k *SigningKey) PublicKey() *PublicKey
PublicKey returns the public key associated with this SigningKey
func (*SigningKey) RederiveUnblindedToken ¶
func (k *SigningKey) RederiveUnblindedToken(t *TokenPreimage) *UnblindedToken
RederiveUnblindedToken via the token preimage of the provided UnblindedToken
func (*SigningKey) Sign ¶
func (k *SigningKey) Sign(t *BlindedToken) (*SignedToken, error)
Sign the provided BlindedToken.
func (*SigningKey) UnmarshalText ¶
func (k *SigningKey) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the signing key from text.
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token consists of a randomly chosen preimage and blinding factor.
func RandomToken ¶
RandomToken generates a new random `Token` using the os random number generator.
func (*Token) Blind ¶
func (t *Token) Blind() *BlindedToken
Blind the Token, returning a BlindedToken to be sent to the server.
func (*Token) MarshalText ¶
MarshalText marshalls the token into text.
func (*Token) UnmarshalText ¶
UnmarshalText unmarshalls the token from text.
type TokenPreimage ¶
type TokenPreimage struct {
// contains filtered or unexported fields
}
TokenPreimage is a slice of bytes which can be hashed to a `RistrettoPoint`.
func (*TokenPreimage) MarshalText ¶
func (t *TokenPreimage) MarshalText() ([]byte, error)
MarshalText marshalls the token preimage into text.
func (*TokenPreimage) UnmarshalText ¶
func (t *TokenPreimage) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the token preimage from text.
type UnblindedToken ¶
type UnblindedToken struct {
// contains filtered or unexported fields
}
UnblindedToken is the result of unblinding a SignedToken.
func (*UnblindedToken) DeriveVerificationKey ¶
func (t *UnblindedToken) DeriveVerificationKey() *VerificationKey
DeriveVerificationKey for this particular UnblindedToken
func (*UnblindedToken) MarshalText ¶
func (t *UnblindedToken) MarshalText() ([]byte, error)
MarshalText marshalls the unblinded token into text.
func (*UnblindedToken) Preimage ¶
func (t *UnblindedToken) Preimage() *TokenPreimage
Preimage returns the TokenPreimage for this particular UnblindedToken
func (*UnblindedToken) UnmarshalText ¶
func (t *UnblindedToken) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the unblinded token from text.
type VerificationKey ¶
type VerificationKey struct {
// contains filtered or unexported fields
}
VerificationKey is the shared key for proving / verifying the validity of an UnblindedToken.
func (*VerificationKey) Sign ¶
func (k *VerificationKey) Sign(message string) (*VerificationSignature, error)
Sign a message, producing a VerificationSignature
func (*VerificationKey) Verify ¶
func (k *VerificationKey) Verify(sig *VerificationSignature, message string) (bool, error)
Verify that the signature of a message matches the provided `VerificationSignature`
type VerificationSignature ¶
type VerificationSignature struct {
// contains filtered or unexported fields
}
VerificationSignature which can be verified given the VerificationKey and message
func (*VerificationSignature) MarshalText ¶
func (t *VerificationSignature) MarshalText() ([]byte, error)
MarshalText marshalls the verification signature into text.
func (*VerificationSignature) UnmarshalText ¶
func (t *VerificationSignature) UnmarshalText(bytes []byte) error
UnmarshalText unmarshalls the unblinded token from text.