Browse Source

test: adds benchmark for private key B generation

trials/prep_p503_trial3
Henry D. Case 6 years ago
committed by Kris Kwiatkowski
parent
commit
9973b7f2d2
2 changed files with 9 additions and 2 deletions
  1. +2
    -2
      Makefile
  2. +7
    -0
      sidh/sidh_test.go

+ 2
- 2
Makefile View File

@@ -19,8 +19,8 @@ prep:
test-%: clean prep
GOPATH=$(GOPATH_LOCAL) go test -race -v ./$*

bench-%: clean prep
cd $*; GOPATH=$(GOPATH_LOCAL) go test -v -bench=.
bench-%: prep
cd $*; GOPATH=$(GOPATH_LOCAL) go test -v $(OPTS) -bench=.

cover-%: clean prep
GOPATH=$(GOPATH_LOCAL) go test -race -coverprofile=coverage_$*.txt -covermode=atomic ./$*


+ 7
- 0
sidh/sidh_test.go View File

@@ -297,6 +297,13 @@ func BenchmarkAliceKeyGenPrv(b *testing.B) {
}
}

func BenchmarkBobKeyGenPrv(b *testing.B) {
prv := NewPrivateKey(params.Id, KeyVariant_SIDH_B)
for n := 0; n < b.N; n++ {
prv.Generate(rand.Reader)
}
}

func BenchmarkAliceKeyGenPub(b *testing.B) {
prv := NewPrivateKey(params.Id, KeyVariant_SIDH_A)
prv.Generate(rand.Reader)


Loading…
Cancel
Save