-
Notifications
You must be signed in to change notification settings - Fork 6
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
ec: p256 #55
Comments
The type Curve interface {
// Params returns the parameters for the curve.
Params() *CurveParams
// IsOnCurve reports whether the given (x,y) lies on the curve.
IsOnCurve(x, y *big.Int) bool
// Add returns the sum of (x1,y1) and (x2,y2)
Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
// Double returns 2*(x,y)
Double(x1, y1 *big.Int) (x, y *big.Int)
// ScalarMult returns k*(Bx,By) where k is a number in big-endian form.
ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int)
// ScalarBaseMult returns k*G, where G is the base point of the group
// and k is an integer in big-endian form.
ScalarBaseMult(k []byte) (x, y *big.Int)
} CoordinatesUse Jacobian coordinates under the hood.
(Note converting affine to Jacobian we just take AddThe existing implementation uses https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl
The cloudflare p384 implementation uses https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-1998-cmo
Mixed AddA mixed addition adds an affine point to a Jacobian point. In the EFD this is specified as an assumption that I cannot easily tell which formula the https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-madd-2007-bl
DoublingI cannot easily tell which formula the I believe the cloudflare p384 implementation uses https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b
|
Provides the bulk of an implementation of scalar multiplication for short Weierstrass curves. Follows Algorithm 1 in "Selecting Elliptic Curves for Cryptography: An Efficiency and Security Analysis" by Bos et al. Note this is not quite complete. The final add needs to use a complete addition formula, and ensure that the zero scalar is handled correctly. Updates #67 #55
Basic implementation of fixed-base scalar multiplication using ScalarMult. Updates #55
Replace point_test.go with a file generated from a template. Updates #55
Implement the P-256 curve as the first end-to-end curve implementation. Operations:
Params()
implementation)crypto/ecdsa.invertable
interface) gen/curve: scalar inversion #85crypto/ecdsa.combinedMult
interface)Sub-tasks:
cmov
gen/ec: conditional point operations #68neg
cneg
gen/ec: conditional point operations #68math/big
testing: audit use of math/big #79Performance:
The text was updated successfully, but these errors were encountered: