-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
We seem to have been working on the same thing :D
Have a look at EllipticCurveKit. My goal is to finish my rewrite using EquationKit, I have got it working already in the equations branch which allows for pretty cool syntax:
///
/// Elliptic Curve on Short Weierstrass form (`π`)
/// - Covers all elliptic curves charβ π,π
/// - Mixed Jacobian coordinates have been the speed leader for a long time.
///
///
/// # Equation
/// π: π¦Β² = π₯Β³ + ππ₯ + π
/// - Requires: `ππΒ³ + πππΒ² β π`
///
public struct ShortWeierstraΓCurve: CurveForm {
private let a: Number
private let b: Number
public let galoisField: Field
public let equation: Polynomial
private let π₯οΌ: Polynomial
private let π¦οΌ: Polynomial
public init?(
a: Number,
b: Number,
galoisField: Field
) {
let π = galoisField.modulus
guard ππΒ³ + πππΒ² β’ π % π β€ [ π β a, π β b ] else { return nil }
self.a = a
self.b = b
self.galoisField = galoisField
self.equation = EllipticCurveForm.WeierstraΓ.short.substitute() {[ π β a, π β b ] }
self.π₯οΌ = equation.differentiateWithRespectTo(π₯)!
self.π¦οΌ = equation.differentiateWithRespectTo(π¦)!
}
}I have also begun implemented other curve forms than ShortWeierstraΓ, such as TwistedEdwards and Montgomery.
I saw you PR in CryptoSwift adding support for Scrypt which I am also working on currently.
I'm in need of it in the Zilliqa Swift SDK I am developing, for the export wallet function.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels