diff options
Diffstat (limited to 'src/crypto/elliptic/p256_asm.go')
-rw-r--r-- | src/crypto/elliptic/p256_asm.go | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/crypto/elliptic/p256_asm.go b/src/crypto/elliptic/p256_asm.go index 93adaf9056..ce80282ed6 100644 --- a/src/crypto/elliptic/p256_asm.go +++ b/src/crypto/elliptic/p256_asm.go @@ -24,27 +24,18 @@ import ( //go:embed p256_asm_table.bin var p256Precomputed string -type ( - p256Curve struct { - *CurveParams - } +type p256Curve struct { + *CurveParams +} - p256Point struct { - xyz [12]uint64 - } -) +type p256Point struct { + xyz [12]uint64 +} var p256 p256Curve -func initP256() { - // See FIPS 186-3, section D.2.3 - p256.CurveParams = &CurveParams{Name: "P-256"} - p256.P, _ = new(big.Int).SetString("115792089210356248762697446949407573530086143415290314195533631308867097853951", 10) - p256.N, _ = new(big.Int).SetString("115792089210356248762697446949407573529996955224135760342422259061068512044369", 10) - 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 initP256Arch() { + p256 = p256Curve{p256Params} } func (curve p256Curve) Params() *CurveParams { |