API changes for cSIDH
This commit is contained in:
parent
3369703ace
commit
555ec1300d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user