Skip to content

Commit

Permalink
Merge pull request #19 from insolar/remove-assabler
Browse files Browse the repository at this point in the history
remove assembly code
  • Loading branch information
Hirama authored May 27, 2019
2 parents 8a44764 + 0babdc4 commit f1d1a11
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 8,527 deletions.
18 changes: 16 additions & 2 deletions elliptic/elliptic.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,27 @@ var initonce sync.Once
var p384 *CurveParams
var p521 *CurveParams
var p256k *CurveParams
var p256 *CurveParams

func initAll() {
initP224()
initP256()
initP384()
initP521()
initSecp256k1()
initP256()
initP256K()
}

func initP256() {
// See FIPS 186-3, section D.2.3
p256 = &CurveParams{Name: "P-256"}
p256.P, _ = new(big.Int).SetString("115792089210356248762697446949407573530086143415290314195533631308867097853951", 10)
p256.N, _ = new(big.Int).SetString("115792089210356248762697446949407573529996955224135760342422259061068512044369", 10)
p256.A, _ = new(big.Int).SetString("ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", 16)
p256.B, _ = new(big.Int).SetString("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16)
p256.Gx, _ = new(big.Int).SetString("6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", 16)
p256.Gy, _ = new(big.Int).SetString("4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", 16)
p256.BitSize = 256
}

func initP384() {
Expand All @@ -395,7 +409,7 @@ func initP521() {
p521.BitSize = 521
}

func initSecp256k1() {
func initP256K() {
p256k = &CurveParams{Name: "P-256K"}
p256k.P, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", 16)
p256k.N, _ = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
Expand Down
1,193 changes: 0 additions & 1,193 deletions elliptic/p256.go

This file was deleted.

Loading

0 comments on commit f1d1a11

Please sign in to comment.