MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestRecoveryOfRandomSignature

Function TestRecoveryOfRandomSignature

crypto/secp256k1/secp256_test.go:176–187  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestRecoveryOfRandomSignature(t *testing.T) {
177 pubkey1, _ := generateKeyPair()
178 msg := csprngEntropy(32)
179
180 for i := 0; i < TestCount; i++ {
181 // recovery can sometimes work, but if so should always give wrong pubkey
182 pubkey2, _ := RecoverPubkey(msg, randSig())
183 if bytes.Equal(pubkey1, pubkey2) {
184 t.Fatalf("iteration: %d: pubkey mismatch: do NOT want %x: ", i, pubkey2)
185 }
186 }
187}
188
189func TestRandomMessagesAgainstValidSig(t *testing.T) {
190 pubkey1, seckey := generateKeyPair()

Callers

nothing calls this directly

Calls 5

csprngEntropyFunction · 0.85
RecoverPubkeyFunction · 0.85
randSigFunction · 0.85
FatalfMethod · 0.80
generateKeyPairFunction · 0.70

Tested by

no test coverage detected