module Curve.Weierstrass.SECP256R1
( module Curve.Weierstrass
, module Curve.Weierstrass.SECP256R1
, Point(..)
) where
import Protolude
import PrimeField
import Curve.Weierstrass
data SECP256R1
type Fq = PrimeField 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff
type Fr = PrimeField 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551
instance Curve 'Weierstrass c SECP256R1 Fq Fr => WCurve c SECP256R1 Fq Fr where
a_ = const _a
{-# INLINABLE a_ #-}
b_ = const _b
{-# INLINABLE b_ #-}
h_ = const _h
{-# INLINABLE h_ #-}
q_ = const _q
{-# INLINABLE q_ #-}
r_ = const _r
{-# INLINABLE r_ #-}
x_ = const _x
{-# INLINABLE x_ #-}
y_ = const _y
{-# INLINABLE y_ #-}
type PA = WAPoint SECP256R1 Fq Fr
instance WACurve SECP256R1 Fq Fr where
gA_ = gA
{-# INLINABLE gA_ #-}
type PJ = WJPoint SECP256R1 Fq Fr
instance WJCurve SECP256R1 Fq Fr where
gJ_ = gJ
{-# INLINABLE gJ_ #-}
type PP = WPPoint SECP256R1 Fq Fr
instance WPCurve SECP256R1 Fq Fr where
gP_ = gP
{-# INLINABLE gP_ #-}
_a :: Fq
_a = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc
{-# INLINABLE _a #-}
_b :: Fq
_b = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
{-# INLINABLE _b #-}
_h :: Integer
_h = 0x1
{-# INLINABLE _h #-}
_q :: Integer
_q = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff
{-# INLINABLE _q #-}
_r :: Integer
_r = 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551
{-# INLINABLE _r #-}
_x :: Fq
_x = 0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296
{-# INLINABLE _x #-}
_y :: Fq
_y = 0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5
{-# INLINABLE _y #-}
gA :: PA
gA = A _x _y
{-# INLINABLE gA #-}
gJ :: PJ
gJ = J _x _y 1
{-# INLINABLE gJ #-}
gP :: PP
gP = P _x _y 1
{-# INLINABLE gP #-}