(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestSignatureValidity(t *testing.T) { |
| 64 | pubkey, seckey := generateKeyPair() |
| 65 | msg := csprngEntropy(32) |
| 66 | sig, err := Sign(msg, seckey) |
| 67 | if err != nil { |
| 68 | t.Errorf("signature error: %s", err) |
| 69 | } |
| 70 | compactSigCheck(t, sig) |
| 71 | if len(pubkey) != 65 { |
| 72 | t.Errorf("pubkey length mismatch: want: 65 have: %d", len(pubkey)) |
| 73 | } |
| 74 | if len(seckey) != 32 { |
| 75 | t.Errorf("seckey length mismatch: want: 32 have: %d", len(seckey)) |
| 76 | } |
| 77 | if len(sig) != 65 { |
| 78 | t.Errorf("sig length mismatch: want: 65 have: %d", len(sig)) |
| 79 | } |
| 80 | recid := int(sig[64]) |
| 81 | if recid > 4 || recid < 0 { |
| 82 | t.Errorf("sig recid mismatch: want: within 0 to 4 have: %d", int(sig[64])) |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | func TestInvalidRecoveryID(t *testing.T) { |
| 87 | _, seckey := generateKeyPair() |
nothing calls this directly
no test coverage detected