Documentation
¶
Index ¶
- Constants
- func AVerify(asig *bn256.G1, msgs []string, pks []*bn256.G2) bool
- func Aggregate(sigs []*bn256.G1) *bn256.G1
- func KeyGenerate() (*big.Int, *bn256.G2, PrivateKey, PublicKey)
- func Sign(sk *big.Int, msg string) *bn256.G1
- func Verify(pk *bn256.G2, msg string, sig *bn256.G1) bool
- type PrivateKey
- type PublicKey
Constants ¶
const ( // PublicKeySize is the size, in bytes, of public keys as used in this package. PublicKeySize = 32 // PrivateKeySize is the size, in bytes, of private keys as used in this package. PrivateKeySize = 64 // SignatureSize is the size, in bytes, of signatures generated and verified by this package. SignatureSize = 64 // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. SeedSize = 32 )
Variables ¶
This section is empty.
Functions ¶
func AVerify ¶
AVerify (asig *bn256.G1, msgs []string, pks []*bn256.G2) bool Aggregate Verification. We are given an aggregate signature σ <-- G1 for an aggregating subset of users U, indexed as before, and are given the original messages Mi <-- {1, 0}∗ and public keys vi <-- G2 for all users ui <-- U. To verify the aggregate signature σ, 1. ensure that the messages Mi are all distinct, and reject otherwise; and 2. compute hi = H(Mi) for 1 ≤ i ≤ k = |U|, and accept if e(σ, g2) = MullAll(e(hi, vi)) holds.
func Aggregate ¶
Aggregate (sigs []*bn256.G1) *bn256.G1 Aggregation. For the aggregating subset of users U ⊆ U, assign to each user an index i, ranging from 1 to k = jUj. Each user ui 2 U provides a signature σi 2 G1 on a message Mi 2 f0; 1g∗ of his choice. The messages Mi must all be distinct. Compute σ Qk i=1 σi. The aggregate signature is σ 2 G1.
func KeyGenerate ¶
KeyGenerate () (*big.Int, *bn256.G2) Key Generation. For a particular user, pick random x <-$- Zp, and compute v = g2^x. The user’s public key is v <--- G2. The user’s secret key is x <--- Zp.
Types ¶
type PrivateKey ¶
type PrivateKey []byte
PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
func (PrivateKey) Public ¶
func (priv PrivateKey) Public() crypto.PublicKey
Public returns the PublicKey corresponding to priv.