Documentation ¶
Index ¶
- func K256GeneratorFromHashedBytes(bytes []byte) (x, y *big.Int, err error)
- type Bls12381G1Curve
- func (curve *Bls12381G1Curve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *Bls12381G1Curve) CompressedBytesFromBigInts(x, y *big.Int) ([]byte, error)
- func (curve *Bls12381G1Curve) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *Bls12381G1Curve) Hash(msg []byte) (*big.Int, *big.Int)
- func (curve *Bls12381G1Curve) IsOnCurve(x, y *big.Int) bool
- func (curve *Bls12381G1Curve) Params() *elliptic.CurveParams
- func (curve *Bls12381G1Curve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *Bls12381G1Curve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type Bls12381G2Curve
- func (curve *Bls12381G2Curve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *Bls12381G2Curve) CompressedBytesFromBigInts(x, y *big.Int) ([]byte, error)
- func (curve *Bls12381G2Curve) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *Bls12381G2Curve) Hash(msg []byte) (*big.Int, *big.Int)
- func (curve *Bls12381G2Curve) IsOnCurve(x, y *big.Int) bool
- func (curve *Bls12381G2Curve) Params() *elliptic.CurveParams
- func (curve *Bls12381G2Curve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *Bls12381G2Curve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type Ed25519Curve
- func (curve *Ed25519Curve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (curve *Ed25519Curve) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (curve *Ed25519Curve) Hash(msg []byte) (*big.Int, *big.Int)
- func (curve *Ed25519Curve) IsOnCurve(x, y *big.Int) bool
- func (curve *Ed25519Curve) Neg(Bx, By *big.Int) (*big.Int, *big.Int)
- func (curve *Ed25519Curve) Params() *elliptic.CurveParams
- func (curve *Ed25519Curve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (curve *Ed25519Curve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)
- type Feldman
- type FeldmanResult
- type Pedersen
- type PedersenResult
- type Shamir
- func (s *Shamir) Combine(shares ...*ShamirShare) ([]byte, error)
- func (s Shamir) ComputeL(shares ...*ShamirShare) ([]*curves.Element, error)
- func (s *Shamir) GetSharesAndPolynomial(secret []byte) ([]*ShamirShare, *polynomial, error)
- func (s *Shamir) Interpolate(xCoordinates, yCoordinates []*curves.Element) (*curves.Element, error)
- func (s *Shamir) Split(secret []byte) ([]*ShamirShare, error)
- type ShamirShare
- type ShareVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bls12381G1Curve ¶
type Bls12381G1Curve struct {
*elliptic.CurveParams
}
func Bls12381G1 ¶
func Bls12381G1() *Bls12381G1Curve
func Bls12381G2 ¶
func Bls12381G2() *Bls12381G1Curve
func (*Bls12381G1Curve) CompressedBytesFromBigInts ¶
func (curve *Bls12381G1Curve) CompressedBytesFromBigInts(x, y *big.Int) ([]byte, error)
CompressedBytesFromBigInts takes x and y coordinates and converts them to the BLS compressed point form
func (*Bls12381G1Curve) Hash ¶
Hash an arbitrary byte sequence to a G1 point according to the hash-to-curve standard
func (*Bls12381G1Curve) Params ¶
func (curve *Bls12381G1Curve) Params() *elliptic.CurveParams
func (*Bls12381G1Curve) ScalarBaseMult ¶
func (*Bls12381G1Curve) ScalarMult ¶
type Bls12381G2Curve ¶
type Bls12381G2Curve struct {
*elliptic.CurveParams
}
func (*Bls12381G2Curve) CompressedBytesFromBigInts ¶
func (curve *Bls12381G2Curve) CompressedBytesFromBigInts(x, y *big.Int) ([]byte, error)
CompressedBytesFromBigInts takes x and y coordinates and converts them to the BLS compressed point form
func (*Bls12381G2Curve) Hash ¶
Hash an arbitrary byte sequence to a G1 point according to the hash-to-curve standard
func (*Bls12381G2Curve) Params ¶
func (curve *Bls12381G2Curve) Params() *elliptic.CurveParams
func (*Bls12381G2Curve) ScalarBaseMult ¶
func (*Bls12381G2Curve) ScalarMult ¶
type Ed25519Curve ¶
type Ed25519Curve struct {
*elliptic.CurveParams
}
func Ed25519 ¶
func Ed25519() *Ed25519Curve
func (*Ed25519Curve) Params ¶
func (curve *Ed25519Curve) Params() *elliptic.CurveParams
func (*Ed25519Curve) ScalarBaseMult ¶
func (*Ed25519Curve) ScalarMult ¶
type Feldman ¶
type Feldman struct {
// contains filtered or unexported fields
}
Feldman Verifiable Secret Sharing Scheme
func (Feldman) Split ¶
func (f Feldman) Split(secret []byte) ([]*ShareVerifier, []*ShamirShare, error)
func (Feldman) Verify ¶
func (f Feldman) Verify(share *ShamirShare, verifiers []*ShareVerifier) (bool, error)
Verify checks a share for validity
type FeldmanResult ¶
type FeldmanResult struct { Verifiers []*ShareVerifier }
FeldmanResult contains all the data from calling Split
type Pedersen ¶
type Pedersen struct {
// contains filtered or unexported fields
}
Pedersen Verifiable Secret Sharing Scheme
func NewPedersen ¶
NewPedersen creates a new pedersen VSS
func (Pedersen) Combine ¶
func (pd Pedersen) Combine(shares ...*ShamirShare) ([]byte, error)
Combine recreates the original secret from the shares
func (Pedersen) Split ¶
func (pd Pedersen) Split(secret []byte) (*PedersenResult, error)
Split creates the verifiers, blinding and shares
func (Pedersen) Verify ¶
func (pd Pedersen) Verify(share *ShamirShare, blinding *ShamirShare, blindedverifiers []*ShareVerifier) (bool, error)
Verify checks a share for validity
type PedersenResult ¶
PedersenResult contains all the data from calling Split
type Shamir ¶
type Shamir struct {
// contains filtered or unexported fields
}
Shamir is the Shamir secret sharing scheme
func (*Shamir) Combine ¶
func (s *Shamir) Combine(shares ...*ShamirShare) ([]byte, error)
Combine takes any number of shares and tries to combine them into the original secret
func (Shamir) ComputeL ¶
func (s Shamir) ComputeL(shares ...*ShamirShare) ([]*curves.Element, error)
ComputeL is a function that computes all Lagrange coefficients. This function is particularly needed in FROST tSchnorr signature.
func (*Shamir) GetSharesAndPolynomial ¶
func (s *Shamir) GetSharesAndPolynomial(secret []byte) ([]*ShamirShare, *polynomial, error)
getSharesAndPolynomial returns the shares for the specified secret and the polynomial used to create the shares
func (*Shamir) Interpolate ¶
interpolate calculates the lagrange interpolation
type ShamirShare ¶
type ShamirShare struct { uint32 `json:"identifier"` Value *curves.Element `json:"value"` }Identifier
ShamirShare is the data from splitting a secret
func NewShamirShare ¶
func NewShamirShare(x uint32, y []byte, f *curves.Field) *ShamirShare
NewShamirShare creates a ShamirShare given the Identifier, value, and Field for the value
func (ShamirShare) Add ¶
func (s ShamirShare) Add(other *ShamirShare) *ShamirShare
Add returns the sum of two Shamir shares
func (ShamirShare) Bytes ¶
func (s ShamirShare) Bytes() []byte
Bytes returns the representation of the share in bytes with the identifier as the first 4 bytes
type ShareVerifier ¶
type ShareVerifier = kryptology.EcPoint
ShareVerifier is used to verify secret shares from Feldman or Pedersen VSS