packages feed

elliptic-curve-0.1.0: src/Curve/Weierstrass/BrainpoolP320T1.hs

module Curve.Weierstrass.BrainpoolP320T1
  ( Fp
  , P
  , _a
  , _b
  , _g
  , _h
  , _n
  , _p
  ) where

import Protolude

import PrimeField (PrimeField)

import Curve.Weierstrass (Point(..), WCurve(..), WPoint)

-------------------------------------------------------------------------------
-- Types
-------------------------------------------------------------------------------

-- | Brainpool-P320T1 curve
data BrainpoolP320T1

-- | Field of Brainpool-P320T1 curve
type Fp = PrimeField 0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27

-- | Brainpool-P320T1 curve is a Weierstrass curve
instance WCurve BrainpoolP320T1 Fp where
  a_ = const _a
  {-# INLINE a_ #-}
  b_ = const _b
  {-# INLINE b_ #-}
  g_ = _g
  {-# INLINE g_ #-}

-- | Point of Brainpool-P320T1 curve
type P = WPoint BrainpoolP320T1 Fp

-------------------------------------------------------------------------------
-- Parameters
-------------------------------------------------------------------------------

-- | Coefficient @A@ of Brainpool-P320T1 curve
_a :: Fp
_a = 0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e24
{-# INLINE _a #-}

-- | Coefficient @B@ of Brainpool-P320T1 curve
_b :: Fp
_b = 0xa7f561e038eb1ed560b3d147db782013064c19f27ed27c6780aaf77fb8a547ceb5b4fef422340353
{-# INLINE _b #-}

-- | Generator of Brainpool-P320T1 curve
_g :: P
_g = A
     0x925be9fb01afc6fb4d3e7d4990010f813408ab106c4f09cb7ee07868cc136fff3357f624a21bed52
     0x63ba3a7a27483ebf6671dbef7abb30ebee084e58a0b077ad42a5a0989d1ee71b1b9bc0455fb0d2c3
{-# INLINE _g #-}

-- | Cofactor of Brainpool-P320T1 curve
_h :: Integer
_h = 1
{-# INLINE _h #-}

-- | Order of Brainpool-P320T1 curve
_n :: Integer
_n = 0xd35e472036bc4fb7e13c785ed201e065f98fcfa5b68f12a32d482ec7ee8658e98691555b44c59311
{-# INLINE _n #-}

-- | Characteristic of Brainpool-P320T1 curve
_p :: Integer
_p = 0xd35e472036bc4fb7e13c785ed201e065f98fcfa6f6f40def4f92b9ec7893ec28fcd412b1f1b32e27
{-# INLINE _p #-}