mirror of
https://github.com/henrydcase/nobs.git
synced 2024-11-22 23:28:57 +00:00
Fixes cSIDH key generation when run in the loop
This commit is contained in:
parent
bc32024729
commit
ab962715d5
@ -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
|
// curve y^2 = x^3 + Ax^2 + x, computed by applying action of a prv.e
|
||||||
// on a curve represented by pub.a.
|
// on a curve represented by pub.a.
|
||||||
func DeriveSecret(out *[64]byte, pub *PublicKey, prv *PrivateKey, rng io.Reader) bool {
|
func DeriveSecret(out *[64]byte, pub *PublicKey, prv *PrivateKey, rng io.Reader) bool {
|
||||||
|
var pk PublicKey
|
||||||
|
|
||||||
if !Validate(pub, rng) {
|
if !Validate(pub, rng) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
groupAction(pub, prv, rng)
|
// Resulting shared secret is stored in the pk
|
||||||
pub.Export(out[:])
|
copy(pk.a[:], pub.a[:])
|
||||||
|
groupAction(&pk, prv, rng)
|
||||||
|
pk.Export(out[:])
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
13
kem/mkem/csidh.go
Normal file
13
kem/mkem/csidh.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package mkem
|
||||||
|
|
||||||
|
func PK_enc() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func PK_dec() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func KEM_mEnc() {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user