From 9973b7f2d2cb2aa94de05b6363dcfdd730182d45 Mon Sep 17 00:00:00 2001 From: "Henry D. Case" Date: Mon, 23 Jul 2018 04:57:39 +0100 Subject: [PATCH] test: adds benchmark for private key B generation --- Makefile | 4 ++-- sidh/sidh_test.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 46c00e7..502f728 100644 --- a/Makefile +++ b/Makefile @@ -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 ./$* diff --git a/sidh/sidh_test.go b/sidh/sidh_test.go index 211e1b3..8729ba2 100644 --- a/sidh/sidh_test.go +++ b/sidh/sidh_test.go @@ -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)