go-ristretto icon indicating copy to clipboard operation
go-ristretto copied to clipboard

Conver to affine representation?

Open skardas opened this issue 4 years ago • 4 comments
trafficstars

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

skardas avatar Oct 28 '21 09:10 skardas

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

bwesterb avatar Oct 28 '21 11:10 bwesterb

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 avatar Oct 30 '21 09:10 skardas

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 ?

skardas avatar Oct 30 '21 09:10 skardas

But why would you want to implement this interface?

bwesterb avatar Oct 31 '21 09:10 bwesterb