github.com/number571/tendermint@v0.34.11-gost/crypto/batch/batch.go (about)

     1  package batch
     2  
     3  import (
     4  	"github.com/number571/tendermint/crypto"
     5  	"github.com/number571/tendermint/crypto/gost512"
     6  )
     7  
     8  // CreateBatchVerifier checks if a key type implements the batch verifier interface.
     9  // Currently only gost512 supports batch verification.
    10  func CreateBatchVerifier(pk crypto.PubKey) (crypto.BatchVerifier, bool) {
    11  
    12  	switch pk.Type() {
    13  	case gost512.KeyType:
    14  		return gost512.NewBatchVerifier(), true
    15  	}
    16  
    17  	return nil, false
    18  }
    19  
    20  // SupportsBatchVerifier checks if a key type implements the batch verifier
    21  // interface.
    22  func SupportsBatchVerifier(pk crypto.PubKey) bool {
    23  	switch pk.Type() {
    24  	case gost512.KeyType:
    25  		return true
    26  	}
    27  
    28  	return false
    29  }