From 555ec1300d6996a035863d7c31c181e026064193 Mon Sep 17 00:00:00 2001 From: Henry Case Date: Fri, 22 Nov 2019 18:05:18 +0000 Subject: [PATCH] API changes for cSIDH --- csidh/cmd/torturer/main.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/csidh/cmd/torturer/main.go b/csidh/cmd/torturer/main.go index 850629e..632234d 100644 --- a/csidh/cmd/torturer/main.go +++ b/csidh/cmd/torturer/main.go @@ -16,19 +16,19 @@ func TestSS() { var r wrapper.Ref var ssRef [csidh.SharedSecretSize]byte var ss [csidh.SharedSecretSize]byte + var prB csidh.PrivateKey + var pkB csidh.PublicKey // Go types prA := r.KeygenPrv() pkA := r.KeygenPub(&prA) - prB := csidh.NewPrivateKey() - pkB := csidh.NewPublicKey() - prB.Generate(rng) - pkB.Generate(&prB) + csidh.GeneratePrivateKey(&prB, rng) + csidh.GeneratePublicKey(&pkB, &prB, rng) s1 := time.Now() // Generate with Go - pkB.DeriveSecret(ss[:], &pkA, &prB) + csidh.DeriveSecret(ss[:], &pkA, &prB, rng) s2 := time.Since(s1) // Generate with C @@ -48,15 +48,15 @@ func TestKeyGeneration() { var ss [csidh.SharedSecretSize]byte // Go types - prA := csidh.NewPrivateKey() - pkA := csidh.NewPublicKey() - prB := csidh.NewPrivateKey() - pkB := csidh.NewPublicKey() + var prA csidh.PrivateKey + var pkA csidh.PublicKey + var prB csidh.PrivateKey + var pkB csidh.PublicKey - prA.Generate(rng) - pkA.Generate(&prA) - prB.Generate(rng) - pkB.Generate(&prB) + csidh.GeneratePrivateKey(&prA, rng) + csidh.GeneratePublicKey(&pkA, &prA, rng) + csidh.GeneratePrivateKey(&prB, rng) + csidh.GeneratePublicKey(&pkB, &prB, rng) s1 := time.Now() // Generate with Go