Documentation ¶
Index ¶
- Variables
- func Decrypt(privateKey kyber.Scalar, cipherText *CipherText) (int64, error)
- func DecryptPoint(privateKey kyber.Scalar, cipherTextBytes []byte) (kyber.Point, error)
- func GenerateMerkleProofs(dataBlocks []mt.DataBlock) ([]*mt.Proof, []byte, error)
- func KeyGen() (privateKey TypePrivateKey, publicKey TypePublicKey, err error)
- func MerkleBatchProofMarshal(proof *MerkleBatchProof) ([]byte, error)
- func MerkleProofMarshal(proof *mt.Proof) ([]byte, error)
- func MerkleProofUnmarshal(data []byte) (*mt.Proof, error)
- func PedersenCommit(amount int64) (kyber.Point, kyber.Scalar, error)
- func PedersonCommitWithHash(amount, timestamp int64, receiverHash []byte, counter uint64) (kyber.Point, kyber.Point, error)
- func RandBytes() ([]byte, error)
- func RandScalars(size int) []kyber.Scalar
- func VerifyMerkleBatchProof(dataBlocks []mt.DataBlock, batchProof *MerkleBatchProof, root []byte) (bool, error)
- func VerifyMerkleProof(block mt.DataBlock, proof *mt.Proof, root []byte) (bool, error)
- type CipherText
- type KeyPair
- type MerkleBatchProof
- type MerkleProof
- type ProofNode
- type TypePrivateKey
- type TypePublicKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( KyberSuite = edwards25519.NewBlakeSHA256Ed25519() PointG = KyberSuite.Point().Base() PointH = KyberSuite.Point().Base().Mul(hScalar, nil) )
Functions ¶
func Decrypt ¶
func Decrypt(privateKey kyber.Scalar, cipherText *CipherText) (int64, error)
func DecryptPoint ¶
func GenerateMerkleProofs ¶
func KeyGen ¶
func KeyGen() (privateKey TypePrivateKey, publicKey TypePublicKey, err error)
func MerkleBatchProofMarshal ¶
func MerkleBatchProofMarshal(proof *MerkleBatchProof) ([]byte, error)
func PedersenCommit ¶
func PedersonCommitWithHash ¶
func RandScalars ¶
func RandScalars(size int) []kyber.Scalar
func VerifyMerkleBatchProof ¶
func VerifyMerkleBatchProof(dataBlocks []mt.DataBlock, batchProof *MerkleBatchProof, root []byte) (bool, error)
VerifyMerkleBatchProof verifies the batched proof against the given root hash.
Types ¶
type CipherText ¶
type CipherText struct { C1 kyber.Point C2 kyber.Point }
func DeserializeCipherText ¶
func DeserializeCipherText(data []byte) (*CipherText, error)
func Encrypt ¶
func Encrypt(publicKey kyber.Point, amount int64) (*CipherText, error)
func EncryptPoint ¶
func EncryptPoint(publicKey, data kyber.Point) (*CipherText, error)
func (*CipherText) Serialize ¶
func (c *CipherText) Serialize() ([]byte, error)
type KeyPair ¶
type KeyPair struct { PrivateKey TypePrivateKey PublicKey TypePublicKey }
type MerkleBatchProof ¶
MerkleBatchProof is the batched proof for a set of data blocks.
func MerkleBatchProofUnmarshal ¶
func MerkleBatchProofUnmarshal(data []byte) (*MerkleBatchProof, error)
func NewMerkleBatchProof ¶
NewMerkleBatchProof creates a batched proof for the given data blocks and their individual proofs.
type MerkleProof ¶
type TypePrivateKey ¶
type TypePrivateKey kyber.Scalar
type TypePublicKey ¶
type TypePublicKey kyber.Point
Click to show internal directories.
Click to hide internal directories.