Documentation
¶
Index ¶
- Variables
- type BlindCommitmentContext
- type BlindSignContext
- func (r *BlindSignContext) AddMessage(message string, index int) error
- func (r *BlindSignContext) Finish() (*BlindedSignature, error)
- func (r *BlindSignContext) SetCommitment(blindCommitment HandleByteBuffer) error
- func (r *BlindSignContext) SetPublicKey(publicKey HandleByteBuffer) error
- func (r *BlindSignContext) SetSecretKey(secretKey HandleByteBuffer) error
- type BlindedCommitment
- type BlindedSignature
- type BlsKeyPair
- type Handle
- type HandleByteBuffer
- type Proof
- type ProofContext
- func (r *ProofContext) AddProofMessages(messages []string, messageType ProofMessageType, ...) error
- func (r *ProofContext) Finish() (*Proof, error)
- func (r *ProofContext) SetNonce(nonce []byte) error
- func (r *ProofContext) SetPublicKey(publicKey HandleByteBuffer) error
- func (r *ProofContext) SetSignature(signature *Signature) error
- type ProofMessageType
- type SignContext
- type Signature
- type VerifyBlindCommitmentContext
- func (r *VerifyBlindCommitmentContext) AddBlinded(index int) error
- func (r *VerifyBlindCommitmentContext) Finish() error
- func (r *VerifyBlindCommitmentContext) SetNonce(nonce []byte) error
- func (r *VerifyBlindCommitmentContext) SetProof(proof HandleByteBuffer) error
- func (r *VerifyBlindCommitmentContext) SetPublicKey(publicKey HandleByteBuffer) error
- type VerifyContext
- type VerifyProofContext
- func (r *VerifyProofContext) AddMessage(message string, index int) error
- func (r *VerifyProofContext) Finish() error
- func (r *VerifyProofContext) SetNonce(nonce []byte) error
- func (r *VerifyProofContext) SetProof(proof HandleByteBuffer) error
- func (r *VerifyProofContext) SetPublicKey(publicKey HandleByteBuffer) error
Constants ¶
This section is empty.
Variables ¶
var ProofStatus = map[C.int]string{
400: "The proof failed because the signature proof of knowledge failed",
401: "The proof failed because a hidden message was invalid when the proof was created",
402: "The proof failed because a revealed message was invalid",
}
Functions ¶
This section is empty.
Types ¶
type BlindCommitmentContext ¶
type BlindCommitmentContext Handle
func BlindCommitmentContextInit ¶
func BlindCommitmentContextInit() (*BlindCommitmentContext, error)
BlindCommitmentContextInit initializes a BlindCommitmentContext
func (*BlindCommitmentContext) AddMessage ¶
func (r *BlindCommitmentContext) AddMessage(message string, index int) error
AddMessage adds a message and its associated index to the BlindCommitmentContext
func (*BlindCommitmentContext) Finish ¶
func (r *BlindCommitmentContext) Finish() (*BlindedCommitment, error)
Finish generates a commitment, context, and blinding factor from the BlindCommitmentContext
func (*BlindCommitmentContext) SetNonce ¶
func (r *BlindCommitmentContext) SetNonce(nonce []byte) error
SetNonce sets the nonce on the BlindedCommitmentContext
func (*BlindCommitmentContext) SetPublicKey ¶
func (r *BlindCommitmentContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the bbs public key on the BlindCommitmentContext
type BlindSignContext ¶
type BlindSignContext Handle
func BlindSignContextInit ¶
func BlindSignContextInit() (*BlindSignContext, error)
BlindSignContext initializes a blind sign context
func (*BlindSignContext) AddMessage ¶
func (r *BlindSignContext) AddMessage(message string, index int) error
AddMessage adds the message and associated index to BlindSignContext
func (*BlindSignContext) Finish ¶
func (r *BlindSignContext) Finish() (*BlindedSignature, error)
Finish generates a BlindedSignature from a BlindSignContext
func (*BlindSignContext) SetCommitment ¶
func (r *BlindSignContext) SetCommitment(blindCommitment HandleByteBuffer) error
SetCommitment sets the commitment on the BlindSignContext
func (*BlindSignContext) SetPublicKey ¶
func (r *BlindSignContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the bbs public key on the BlindSignContext
func (*BlindSignContext) SetSecretKey ¶
func (r *BlindSignContext) SetSecretKey(secretKey HandleByteBuffer) error
SetSecretKey sets the bls secret key on the BlindSignContext
type BlindedCommitment ¶
type BlindedCommitment struct {
Commitment C.ByteBuffer
Context C.ByteBuffer
BlindingFactor C.ByteBuffer
}
func (*BlindedCommitment) Free ¶
func (r *BlindedCommitment) Free()
FreeCommitment deallocates the Commitment, Context, and BlindingFactor instances from the BlindedCommitment
type BlindedSignature ¶
type BlindedSignature HandleByteBuffer
func (*BlindedSignature) Unblind ¶
func (r *BlindedSignature) Unblind(blindingFactor HandleByteBuffer) (*Signature, error)
Unblind returns the Signature from the BlindedSignature
type BlsKeyPair ¶
type BlsKeyPair struct {
PublicKey C.ByteBuffer
SecretKey C.ByteBuffer
}
func GenerateBlsKey ¶
func GenerateBlsKey(data []byte) (*BlsKeyPair, error)
GenerateKey generates a bls key pair
func (*BlsKeyPair) BlsPublicKeyToBBSKey ¶
func (r *BlsKeyPair) BlsPublicKeyToBBSKey(messageCount int) (*HandleByteBuffer, error)
BlsPublicKeyToBBSKey converts a bls public key to a BBS public key
func (*BlsKeyPair) FreePublicKey ¶
func (r *BlsKeyPair) FreePublicKey()
FreeSecretKey deallocates the public key instance
func (*BlsKeyPair) FreeSecretKey ¶
func (r *BlsKeyPair) FreeSecretKey()
FreeSecretKey deallocates the secret key instance
type HandleByteBuffer ¶
type HandleByteBuffer struct {
Buffer C.ByteBuffer
}
func (HandleByteBuffer) Free ¶
func (r HandleByteBuffer) Free()
type Proof ¶
type Proof HandleByteBuffer
type ProofContext ¶
type ProofContext Handle
func ProofContextInit ¶
func ProofContextInit() (*ProofContext, error)
ProofContextInit creates the proof asynchronous
func (*ProofContext) AddProofMessages ¶
func (r *ProofContext) AddProofMessages(messages []string, messageType ProofMessageType, blindingFactor HandleByteBuffer) error
AddProofMessage adds a proof message to the proof context
func (*ProofContext) Finish ¶
func (r *ProofContext) Finish() (*Proof, error)
Finish generates a proof from the ProofContext
func (*ProofContext) SetNonce ¶
func (r *ProofContext) SetNonce(nonce []byte) error
SetNonce sets the nonce on the ProofContext
func (*ProofContext) SetPublicKey ¶
func (r *ProofContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the bbs public key on the ProofContext
func (*ProofContext) SetSignature ¶
func (r *ProofContext) SetSignature(signature *Signature) error
SetSignature sets the signature on the ProofContext
type ProofMessageType ¶
type ProofMessageType int
const ( Revealed ProofMessageType = 1 HiddenProofSpecificBlinding ProofMessageType = 2 HiddenExternalBlinding ProofMessageType = 3 )
type SignContext ¶
type SignContext Handle
func SignContextInit ¶
func SignContextInit() (*SignContext, error)
SignContextInit initializes a sign context
func (*SignContext) AddMessages ¶
func (r *SignContext) AddMessages(messages []string) error
AddMessages adds messages to the SignContext
func (*SignContext) Finish ¶
func (r *SignContext) Finish() (*Signature, error)
Finish generates a Signature from the SignContext
func (*SignContext) SetPublicKey ¶
func (r *SignContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the public key on the SignContext
func (*SignContext) SetSecretKey ¶
func (r *SignContext) SetSecretKey(secretKey HandleByteBuffer) error
SetSecretKey sets the bls secret key on teh SignContext
type Signature ¶
type Signature HandleByteBuffer
type VerifyBlindCommitmentContext ¶
type VerifyBlindCommitmentContext Handle
func VerifyBlindCommitmentContextInit ¶
func VerifyBlindCommitmentContextInit() (*VerifyBlindCommitmentContext, error)
VerifyBlindCommitmentContextInit initializes a VerifyBlindCommitmentContext
func (*VerifyBlindCommitmentContext) AddBlinded ¶
func (r *VerifyBlindCommitmentContext) AddBlinded(index int) error
AddBlinded adds the index of the blinded message to the VerifyBlindCommitmentContext
func (*VerifyBlindCommitmentContext) Finish ¶
func (r *VerifyBlindCommitmentContext) Finish() error
Finish verifies the BlindCommitmentContext
func (*VerifyBlindCommitmentContext) SetNonce ¶
func (r *VerifyBlindCommitmentContext) SetNonce(nonce []byte) error
SetNonce sets the nonce on the VerifyBlindCommitmentContext
func (*VerifyBlindCommitmentContext) SetProof ¶
func (r *VerifyBlindCommitmentContext) SetProof(proof HandleByteBuffer) error
SetProof sets the context from the BlindCommitmentContext on the VerifyBlindCommitmentContext
func (*VerifyBlindCommitmentContext) SetPublicKey ¶
func (r *VerifyBlindCommitmentContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the bbs public key on the VerifyBlindCommitmentContext
type VerifyContext ¶
type VerifyContext Handle
func VerifyContextInit ¶
func VerifyContextInit() (*VerifyContext, error)
VerifyContextInit initializes a VerifyContext
func (*VerifyContext) AddMessages ¶
func (r *VerifyContext) AddMessages(messages []string) error
AddMessages adds the messages to the VerifyContext
func (*VerifyContext) Finish ¶
func (r *VerifyContext) Finish() (bool, error)
Finish verifies a BBS+ signature for a set of messages with a BBS public key
func (*VerifyContext) SetPublicKey ¶
func (r *VerifyContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the bbs public key on the VerifyContext
func (*VerifyContext) SetSignature ¶
func (r *VerifyContext) SetSignature(signature *Signature) error
SetSignature sets the signature on the VerifyContext
type VerifyProofContext ¶
type VerifyProofContext Handle
func VerifyProofContextInit ¶
func VerifyProofContextInit() (*VerifyProofContext, error)
VerifyProofContextInit initializes a VerifyProofContext
func (*VerifyProofContext) AddMessage ¶
func (r *VerifyProofContext) AddMessage(message string, index int) error
AddMessages adds the message and the associated index to the VerifyProofContext
func (*VerifyProofContext) Finish ¶
func (r *VerifyProofContext) Finish() error
Finish verifies a proof
func (*VerifyProofContext) SetNonce ¶
func (r *VerifyProofContext) SetNonce(nonce []byte) error
SetNonce sets the nonce on the VerifyProofContext
func (*VerifyProofContext) SetProof ¶
func (r *VerifyProofContext) SetProof(proof HandleByteBuffer) error
SetProof sets the proof on the VerifyProofContext
func (*VerifyProofContext) SetPublicKey ¶
func (r *VerifyProofContext) SetPublicKey(publicKey HandleByteBuffer) error
SetPublicKey sets the bbs public key on the VerifyProofContext