Fix tests for p256_test.go

pull/398/head
Rongjian Lan 6 years ago
parent f07c75d11a
commit 3d2146672b
  1. 6
      crypto/vrf/p256/p256_test.go
  2. 28
      test/testdata/directory.json
  3. 1503
      test/testdata/getentryresponse.json

@ -185,9 +185,9 @@ func TestVRF(t *testing.T) {
}
// Test vectors in core/testdata are generated by running
// go generate ./core/testdata
// go generate github.com/google/keytransparency/core/testdata
func TestProofToHash(t *testing.T) {
directoryFile := "../../../testdata/directory.json"
directoryFile := "../../../test/testdata/directory.json"
f, err := os.Open(directoryFile)
if err != nil {
t.Fatalf("ReadFile(%v): %v", directoryFile, err)
@ -202,7 +202,7 @@ func TestProofToHash(t *testing.T) {
t.Fatalf("NewVRFVerifier failure: %v", err)
}
respFile := "../../../testdata/getentryresponse.json"
respFile := "../../../test/testdata/getentryresponse.json"
b, err := ioutil.ReadFile(respFile)
if err != nil {
t.Fatalf("ReadFile(%v): %v", respFile, err)

@ -0,0 +1,28 @@
{
"directoryId": "integration",
"log": {
"treeId": "8541686838476068721",
"treeType": "PREORDERED_LOG",
"hashStrategy": "RFC6962_SHA256",
"hashAlgorithm": "SHA256",
"signatureAlgorithm": "ECDSA",
"publicKey": {
"der": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqGXPnhMIclRmYHSmAnCMmfDUJ9iNBMmFxR/wHJdL12AuVUkgcuhbEp2hy5ETs7bfFc2P95IYFlmbiuHMq3UY/A=="
}
},
"map": {
"treeId": "6598072539431303895",
"treeType": "MAP",
"hashStrategy": "CONIKS_SHA256",
"hashAlgorithm": "SHA256",
"signatureAlgorithm": "ECDSA",
"publicKey": {
"der": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWLHm0TLYaTzENpPkBl2E79ySqJI+EW51VpoWh7wqY3OjSJcft4zgEeNeHYEb/T2jBFH4eYg4iSN7D/VYaJxJRA=="
}
},
"vrf": {
"der": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEF2Pm2kKya+JBun1QRmKQMcoMOIBNWp8fjECkJX+/hNWdV1UKb12W+yXcX2MqN7ZMX77hS9mLus/WaE0NS370mA=="
},
"minInterval": "0.100s",
"maxInterval": "216000s"
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save