fix isOnCurve check

this needs to be changed as well when switching between G1 and G2

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2022-04-12 14:35:37 +02:00
parent 4463278c43
commit 923b86a67b
No known key found for this signature in database
GPG Key ID: 0FE274EE8C95166E
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ func ec_fr_mul*(res: var Fr[C], a, b: Fr[C]) =
func ec_p1_on_curve*(p: ec_p1) : bool = func ec_p1_on_curve*(p: ec_p1) : bool =
var aff : ec_p1_affine var aff : ec_p1_affine
aff.affine(p) aff.affine(p)
(bool) isOnCurve(aff.x, aff.y, G1) (bool) isOnCurve(aff.x, aff.y, G2)
func ec_keygen*(ikm: array[32, byte], pk: var PublicKey, sk: var SecretKey) : bool = func ec_keygen*(ikm: array[32, byte], pk: var PublicKey, sk: var SecretKey) : bool =
# TODO: HKDF key generation as in spec (https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature#section-2.3) # TODO: HKDF key generation as in spec (https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature#section-2.3)