Files
prysm/crypto/bls/herumi/init.go
Preston Van Loon 2aa52fb56a Add static analyzer to discourage use of panic() (#15075)
* Implement static analysis to prevent panics

* Add nopanic to nogo

* Fix violations and add exclusions

Fix violations and add exclusions for all

* Changelog fragment

* Use pass.Report instead of pass.Reportf

* Remove strings.ToLower for checking init method name

* Add exclusion for herumi init

* Move api/client/beacon template function to init and its own file

* Fix nopanic testcase
2025-03-19 18:04:15 +00:00

18 lines
487 B
Go

package herumi
import "github.com/herumi/bls-eth-go-binary/bls"
// Init allows the required curve orders and appropriate sub-groups to be initialized.
// lint:nopanic -- This method is called at init time only.
func Init() {
if err := bls.Init(bls.BLS12_381); err != nil {
panic(err)
}
if err := bls.SetETHmode(bls.EthModeDraft07); err != nil {
panic(err)
}
// Check subgroup order for pubkeys and signatures.
bls.VerifyPublicKeyOrder(true)
bls.VerifySignatureOrder(true)
}