elliptic-shiho / ecpy

A pairing library of elliptic curve
MIT License
59 stars 13 forks source link

Curve multiplication bug #3

Closed elliptic-shiho closed 7 years ago

elliptic-shiho commented 7 years ago
from ecpy import *

F, E, G, n = EllipticCurveRepository('secp224k1')

print G * n
Sun Mar 26 21:27:57 JST 2017 ~/prog/lab/mathematics/ecpy/scripts 93%
> python issue_3.py 
Point (2662552069424839940829238116501617128533613759701004695707473099760 : 15996838278203546540884017352821306960302774013401163842202920884487 : 1) on Elliptic Curve y^2 = x^3 + 5 over FiniteField(26959946667150639794667015087019630673637144422540572481099315275117)

must be n * G == Inifinity

elliptic-shiho commented 7 years ago

In ecpy,

>>> str(G * 2**224)
'Point (10795122490868123827554299128382114846678221732216813051395122936646 : 9518214639407739917233800003478230782003680481740935595867590866734 : 1) on Elliptic Curve y^2 = x^3 + 5 over FiniteField(26959946667150639794667015087019630673637144422540572481099315275117)'
>>> str(G * 2**223)
'Point (2923250937243636332208174123793300044206783526424398444826569207706 : 14258183886336892226664384356048316765299315128930178889390971254298 : 1) on Elliptic Curve y^2 = x^3 + 5 over FiniteField(26959946667150639794667015087019630673637144422540572481099315275117)'

In sage,

sage: G * 2^224
(4192029038943588720476777725109672588741177307860468102236874972418 : 18556817176903311936264937984752252643388161114286760839779177532574 : 1)
sage: G * 2^223
(2923250937243636332208174123793300044206783526424398444826569207706 : 14258183886336892226664384356048316765299315128930178889390971254298 : 1)