(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func TestGenECDHSharedSecret(t *testing.T) { |
| 58 | privateKey1, publicKey1, _ := GenSecp256k1KeyPair() |
| 59 | privateKey2, publicKey2, _ := GenSecp256k1KeyPair() |
| 60 | shared1 := GenECDHSharedSecret(privateKey1, publicKey2) |
| 61 | shared2 := GenECDHSharedSecret(privateKey2, publicKey1) |
| 62 | if len(shared1) <= 0 { |
| 63 | t.Errorf("shared length should not be %d", len(shared1)) |
| 64 | } |
| 65 | |
| 66 | for i, b := range shared1 { |
| 67 | if b != shared2[i] { |
| 68 | t.Error("shared1 and shared2 should be equel") |
| 69 | } |
| 70 | } |
| 71 | //t.Log(shared1) |
| 72 | } |
| 73 | |
| 74 | func TestGetPubKeyNonce(t *testing.T) { |
| 75 | Convey("translate key error", t, func() { |
nothing calls this directly
no test coverage detected