Documentation
¶
Index ¶
- func AltbnBlake2b(message []byte) (p1, p2 *big.Int)
- func AltbnG1ToCoord(pt *bn256.G1) (x, y *big.Int)
- func AltbnG2ToCoord(pt *bn256.G2) (xx, xy, yx, yy *big.Int)
- func AltbnHashToCurve(message []byte) *bn256.G1
- func AltbnKang12(message []byte) (p1, p2 *big.Int)
- func AltbnKeccak3(message []byte) (p1, p2 *big.Int)
- func AltbnMkG1Point(x, y *big.Int) (*bn256.G1, bool)
- func AltbnSha3(message []byte) (p1, p2 *big.Int)
- func Bls12Blake2b(message []byte) (p1, p2 *big.Int)
- func Bls12Kang12(message []byte) (p1, p2 *big.Int)
- func Bls12Sha3(message []byte) (p1, p2 *big.Int)
- func CheckAuthentication(v *VerifyKey, a *Authentication) bool
- func EthereumSum256(data []byte) (digest [32]byte)
- func KeyGen() (*SigningKey, *VerifyKey, error)
- func LoadKey(x *big.Int) (*SigningKey, *VerifyKey)
- func Verify(vk *VerifyKey, m []byte, sig *Signature) bool
- func VerifyAggregateSignature(aggsig *Signature, keys []*VerifyKey, msgs [][]byte, allowDuplicates bool) bool
- func VerifyMultiSignature(aggsig *Signature, keys []*VerifyKey, msg []byte) bool
- type AggSig
- type Authentication
- type MultiSig
- type Signature
- type SigningKey
- type VerifyKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AltbnBlake2b ¶
AltbnBlake2b Hashes a message to a point on Altbn128 using Blake2b and try and increment The return value is the x,y affine coordinate pair.
func AltbnG1ToCoord ¶
AltbnG1ToCoord takes a point in G1 of Altbn_128, and returns its affine coordinates
func AltbnG2ToCoord ¶
AltbnG2ToCoord takes a point in G2 of Altbn_128, and returns its affine coordinates
func AltbnHashToCurve ¶
AltbnHashToCurve Hashes a message to a point on Altbn128 using Keccak3 and try and increment This is for compatability with Ethereum hashing. The return value is the altbn_128 library's internel representation for points.
func AltbnKang12 ¶
AltbnKang12 Hashes a message to a point on Altbn128 using Blake2b and try and increment The return value is the x,y affine coordinate pair.
func AltbnKeccak3 ¶
AltbnKeccak3 Hashes a message to a point on Altbn128 using Keccak3 and try and increment Keccak3 is only for compatability with Ethereum hashing. The return value is the x,y affine coordinate pair.
func AltbnMkG1Point ¶
AltbnMkG1Point copies points into []byte and unmarshals to get around curvePoint not being exported This is copied from bn256.G1.Marshal (modified)
func AltbnSha3 ¶
AltbnSha3 Hashes a message to a point on Altbn128 using SHA3 and try and increment The return value is the x,y affine coordinate pair.
func Bls12Blake2b ¶
Bls12Blake2b Hashes a message to a point on BLS12-381 using Blake2b and try and increment The return value is the x,y affine coordinate pair.
func Bls12Kang12 ¶
Bls12Kang12 Hashes a message to a point on BLS12-381 using Kangaroo Twelve and try and increment The return value is the x,y affine coordinate pair.
func Bls12Sha3 ¶
Bls12Sha3 Hashes a message to a point on BLS12-381 using SHA3 and try and increment The return value is the x,y affine coordinate pair.
func CheckAuthentication ¶
func CheckAuthentication(v *VerifyKey, a *Authentication) bool
CheckAuthentication verifies that this VerifyKey is valid
func EthereumSum256 ¶
EthereumSum256 returns the Keccak3-256 digest of the data. This is because Ethereum uses a non-standard hashing algo.
func KeyGen ¶
func KeyGen() (*SigningKey, *VerifyKey, error)
KeyGen generates a SigningKey and VerifyKey
func LoadKey ¶
func LoadKey(x *big.Int) (*SigningKey, *VerifyKey)
LoadKey turns secret key into SigninKey and VerifyKey
func VerifyAggregateSignature ¶
func VerifyAggregateSignature(aggsig *Signature, keys []*VerifyKey, msgs [][]byte, allowDuplicates bool) bool
VerifyAggregateSignature verifies that the aggregated signature proves that all messages were signed by associated keys Will fail under duplicate messages, unless allow duplicates is True.
func VerifyMultiSignature ¶
VerifyMultiSignature checks that the aggregate signature correctly proves that a single message has been signed by a set of keys, vulnerable against chosen key attack, if keys have not been authenticated
Types ¶
type AggSig ¶
type AggSig struct {
// contains filtered or unexported fields
}
AggSig holds paired sequences of keys and messages, and one signature
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
Authentication is a proof of a valid VerifyKey
func Authenticate ¶
func Authenticate(x *SigningKey, v *VerifyKey) *Authentication
Authenticate generates an Authentication for a valid SigningKey/VerifyKey combo
type MultiSig ¶
type MultiSig struct {
// contains filtered or unexported fields
}
MultiSig holds set of keys and one message plus signature
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature Wraps G1 curve point as signature
type SigningKey ¶
type SigningKey struct {
// contains filtered or unexported fields
}
SigningKey wraps secret exponent
func (*SigningKey) Sign ¶
func (sk *SigningKey) Sign(m []byte) *Signature
Sign creates a signature on a message with a private key