Browse Source

Fixes cSIDH key generation when run in the loop

pull/32/head
Henry Case 4 years ago
parent
commit
ab962715d5
2 changed files with 19 additions and 2 deletions
  1. +6
    -2
      dh/csidh/csidh.go
  2. +13
    -0
      kem/mkem/csidh.go

+ 6
- 2
dh/csidh/csidh.go View File

@@ -319,10 +319,14 @@ func Validate(pub *PublicKey, rng io.Reader) bool {
// curve y^2 = x^3 + Ax^2 + x, computed by applying action of a prv.e
// on a curve represented by pub.a.
func DeriveSecret(out *[64]byte, pub *PublicKey, prv *PrivateKey, rng io.Reader) bool {
var pk PublicKey

if !Validate(pub, rng) {
return false
}
groupAction(pub, prv, rng)
pub.Export(out[:])
// Resulting shared secret is stored in the pk
copy(pk.a[:], pub.a[:])
groupAction(&pk, prv, rng)
pk.Export(out[:])
return true
}

+ 13
- 0
kem/mkem/csidh.go View File

@@ -0,0 +1,13 @@
package mkem

func PK_enc() {

}

func PK_dec() {

}

func KEM_mEnc() {

}

Loading…
Cancel
Save