mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-06 01:32:18 +00:00
211d9bc0b9
* fix build from source * clean up * update again * change everything * workaround for now * fix versioning * all passing now * fix build issues * clean up * revert use of MulVerify * gaz * stub * Apply suggestions from code review Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> * fix all * fix test * todo * fix stub * revert back * make deep source happy * Update shared/bls/herumi/public_key.go * Update shared/bls/blst/signature.go * Update shared/bls/blst/signature_test.go * imports * move iface to common, export errors * rm iface build Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> Co-authored-by: terence tsao <terence@prysmaticlabs.com>
52 lines
1.3 KiB
Go
52 lines
1.3 KiB
Go
package bls
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/bls/common"
|
|
"github.com/prysmaticlabs/prysm/shared/featureconfig"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
|
)
|
|
|
|
func TestDisallowZeroSecretKeys(t *testing.T) {
|
|
flags := &featureconfig.Flags{}
|
|
t.Run("herumi", func(t *testing.T) {
|
|
flags := &featureconfig.Flags{}
|
|
reset := featureconfig.InitWithReset(flags)
|
|
defer reset()
|
|
|
|
_, err := SecretKeyFromBytes(common.ZeroSecretKey[:])
|
|
require.Equal(t, common.ErrZeroKey, err)
|
|
})
|
|
|
|
t.Run("blst", func(t *testing.T) {
|
|
flags.EnableBlst = true
|
|
reset := featureconfig.InitWithReset(flags)
|
|
defer reset()
|
|
|
|
_, err := SecretKeyFromBytes(common.ZeroSecretKey[:])
|
|
require.Equal(t, common.ErrZeroKey, err)
|
|
})
|
|
}
|
|
|
|
func TestDisallowZeroPublicKeys(t *testing.T) {
|
|
flags := &featureconfig.Flags{}
|
|
|
|
t.Run("herumi", func(t *testing.T) {
|
|
reset := featureconfig.InitWithReset(flags)
|
|
defer reset()
|
|
|
|
_, err := PublicKeyFromBytes(common.InfinitePublicKey[:])
|
|
require.Equal(t, common.ErrInfinitePubKey, err)
|
|
})
|
|
|
|
t.Run("blst", func(t *testing.T) {
|
|
flags.EnableBlst = true
|
|
reset := featureconfig.InitWithReset(flags)
|
|
defer reset()
|
|
|
|
_, err := PublicKeyFromBytes(common.InfinitePublicKey[:])
|
|
require.Equal(t, common.ErrInfinitePubKey, err)
|
|
})
|
|
}
|