Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conver to affine representation? #26

Open
skardas opened this issue Oct 28, 2021 · 4 comments
Open

Conver to affine representation? #26

skardas opened this issue Oct 28, 2021 · 4 comments

Comments

@skardas
Copy link

skardas commented Oct 28, 2021

Could you please help me on converting extended point to a affine point (x: bigInt, y:bigInt)

@bwesterb
Copy link
Owner

x = X/Z, y = Y/Z given we're not dealing with the point-at-infinity. Why does this come up working with Ristretto?

@skardas
Copy link
Author

skardas commented Oct 30, 2021

I want to implement elliptic.Curve interface with ristretto via followings:

func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error)
func Marshal(curve Curve, x, y *big.Int) []byte
func MarshalCompressed(curve Curve, x, y *big.Int) []byte
func Unmarshal(curve Curve, data []byte) (x, y *big.Int)
func UnmarshalCompressed(curve Curve, data []byte) (x, y *big.Int)
type Curve
func Ristretto() Curve //over ed25519
type CurveParams
func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool
func (curve *CurveParams) Params() *CurveParams
func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int)

@skardas
Copy link
Author

skardas commented Oct 30, 2021

x = X/Z, y = Y/Z given we're not dealing with the point-at-infinity. Why does this come up working with Ristretto?

Yes, it is. what about from affine (x,y) to extended (X,Y,T,Z)?
X=x
Y=y
T=x*y
Z=1
are correct ?

@bwesterb
Copy link
Owner

But why would you want to implement this interface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants