prysm-pulse/shared/bls/blst/stub.go
Preston Van Loon 14dbc2b74d
Add blst for BLS (#6539)
* Add blst third party dep

* initial build

* add init

* blst passing tests

* add feature flag

* blst and herumi for spec tests

* maybe this works for mac

* Actually set feature flag

* Add stub for VerifyMultipleSignatures for blst

* verifyCompressed

* use correct cores sizes

* aggregate public keys

* add multi-sig verification

* encode not hash

* revert back

* go mod tidy

* update blst to latest commit

* add batch decompress

* fix

* add test

* gofmt

* update blst

* go mod tidy

* remove kubesec, fix

* mod tidy

* disable some remote cache

* disable some remote cache

* disable some remote cache

* disable some remote cache

* Switch to -D__ADX__

* update

* tidy

* fix build

* Make blst for only linux,amd64

* gofmt

* lint

* lint

* gazelle

* fix build tag

* more stub methods

* shift adx instructions to x86

* fix arm64

* Revert "fix arm64"

This reverts commit 4d34ac21b7509a1b385374e3039efecfcab614c1.

* add one more in

* Revert "Revert "fix arm64""

This reverts commit 1c8ae24ad16ff9811590f1058b9d98c90b63251a.

* try darwin now

* Revert "try darwin now"

This reverts commit 6f884714b8e14a7a803b72157672b6e942047f37.

* Add sha256

* remove TODO

* checkpoint

* finally builds

* fix up

* add tag

* try again

* explicit disabling

* remove

* select properly

* fix

* better

* make CI happy too

* Update .bazelrc

* Update .bazelrc

* fix tests

* revert back

* Update shared/bls/blst/public_key.go

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>

* Update shared/bls/blst/public_key.go

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>

* clean up tests

* more clean up

* clean up

* add

* Update shared/bls/blst/signature.go

* Update shared/bls/blst/signature.go

* Update .buildkite-bazelrc

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>

* try again

* remove go tag

* revert change

* gaz

* gazelle ignore

Co-authored-by: nisdas <nishdas93@gmail.com>
Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-09-16 21:28:28 +08:00

115 lines
2.9 KiB
Go

// +build darwin,amd64 windows,amd64 linux,amd64,!blst_enabled linux,arm64,!blst_enabled
package blst
import "github.com/prysmaticlabs/prysm/shared/bls/iface"
// SecretKey -- stub
type SecretKey struct{}
// PublicKey -- stub
func (s SecretKey) PublicKey() iface.PublicKey {
panic("blst is only supported on linux amd64")
}
// Sign -- stub
func (s SecretKey) Sign(msg []byte) iface.Signature {
panic("blst is only supported on linux amd64")
}
// Marshal -- stub
func (s SecretKey) Marshal() []byte {
panic("blst is only supported on linux amd64")
}
// PublicKey -- stub
type PublicKey struct{}
// Marshal -- stub
func (p PublicKey) Marshal() []byte {
panic("blst is only supported on linux amd64")
}
// Copy -- stub
func (p PublicKey) Copy() iface.PublicKey {
panic("blst is only supported on linux amd64")
}
// Aggregate -- stub
func (p PublicKey) Aggregate(p2 iface.PublicKey) iface.PublicKey {
panic("blst is only supported on linux amd64")
}
// Signature -- stub
type Signature struct{}
// Verify -- stub
func (s Signature) Verify(pubKey iface.PublicKey, msg []byte) bool {
panic("blst is only supported on linux amd64")
}
// AggregateVerify -- stub
func (s Signature) AggregateVerify(pubKeys []iface.PublicKey, msgs [][32]byte) bool {
panic("blst is only supported on linux amd64")
}
// FastAggregateVerify -- stub
func (s Signature) FastAggregateVerify(pubKeys []iface.PublicKey, msg [32]byte) bool {
panic("blst is only supported on linux amd64")
}
// Marshal -- stub
func (s Signature) Marshal() []byte {
panic("blst is only supported on linux amd64")
}
// Copy -- stub
func (s Signature) Copy() iface.Signature {
panic("blst is only supported on linux amd64")
}
// SecretKeyFromBytes -- stub
func SecretKeyFromBytes(privKey []byte) (SecretKey, error) {
panic("blst is only supported on linux amd64")
}
// PublicKeyFromBytes -- stub
func PublicKeyFromBytes(pubKey []byte) (PublicKey, error) {
panic("blst is only supported on linux amd64")
}
// SignatureFromBytes -- stub
func SignatureFromBytes(sig []byte) (Signature, error) {
panic("blst is only supported on linux amd64")
}
// AggregatePublicKeys -- stub
func AggregatePublicKeys(pubs [][]byte) (PublicKey, error) {
panic("blst is only supported on linux amd64")
}
// AggregateSignatures -- stub
func AggregateSignatures(sigs []iface.Signature) iface.Signature {
panic("blst is only supported on linux amd64")
}
// VerifyMultipleSignatures -- stub
func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys []iface.PublicKey) (bool, error) {
panic("blst is only supported on linux amd64")
}
// NewAggregateSignature -- stub
func NewAggregateSignature() iface.Signature {
panic("blst is only supported on linux amd64")
}
// RandKey -- stub
func RandKey() iface.SecretKey {
panic("blst is only supported on linux amd64")
}
// VerifyCompressed -- stub
func VerifyCompressed(signature []byte, pub []byte, msg []byte) bool {
panic("blst is only supported on linux amd64")
}