Example #1
0
func BenchmarkVerify(b *testing.B) {
	b.StopTimer()
	b.ResetTimer()

	//b.Logf("#iterations %d\n", b.N)
	signKey, _ := primitives.NewECDSAKey()
	verKey := signKey.PublicKey
	hash := make([]byte, 48)

	for i := 0; i < b.N; i++ {
		rand.Read(hash)
		sigma, _ := primitives.ECDSASign(signKey, hash)
		b.StartTimer()
		primitives.ECDSAVerify(&verKey, hash, sigma)
		b.StopTimer()
	}
}
Example #2
0
func (node *nodeImpl) verifyWithEnrollmentCert(msg, signature []byte) (bool, error) {
	return primitives.ECDSAVerify(node.enrollCert.PublicKey, msg, signature)
}
Example #3
0
func (node *nodeImpl) verify(verKey interface{}, msg, signature []byte) (bool, error) {
	return primitives.ECDSAVerify(verKey, msg, signature)
}
Example #4
0
func (validator *validatorImpl) verify(verKey interface{}, msg, signature []byte) (bool, error) {
	return primitives.ECDSAVerify(verKey, msg, signature)
}