Name:                 finite-fields
Version:              0.2.0.1
Synopsis:             Arithmetic in finite fields

Description:          Implementation of arithmetic in finite fields (prime fields
                      and fields of prime power order). Finite fields are
                      ubiquitous in algebraic geometry, number theory and cryptography.
                     
                      For now the focus is on relatively small fields,
                      but algorithms for big fields (required in cryptography) 
                      may be added later.

License:              BSD3
License-file:         LICENSE
Author:               Balazs Komuves
Copyright:            (c) 2021-2023 Balazs Komuves
Maintainer:           bkomuves (plus) hackage (at) gmail (dot) com
Homepage:             https://github.com/bkomuves/finite-fields
Stability:            Experimental
Category:             Math
Tested-With:          GHC == 8.6.5, GHC == 9.0.2
Cabal-Version:        1.24
Build-Type:           Custom

extra-source-files:   conway/ConwayPolynomials.txt
                      conway/README.txt
                      examples/curve_count.hs
                      cbits/zech.h
                      cbits/zech.c
                      cbits/conway_table.c

source-repository head
  type:                 git
  location:             https://github.com/bkomuves/finite-fields

custom-setup
  setup-depends:        base  >= 4 && < 5, 
                        Cabal >= 2.4 && < 4,
                        filepath >= 1.0 && < 2, 
                        directory >= 1.0 && < 2
     
--------------------------------------------------------------------------------

Library

  Build-Depends:        base >= 4 && < 5, 
                        containers >= 0.5 && < 1, 
                        vector >= 0.12 && < 1, 
                        random >= 1.1 && < 2

  Exposed-Modules:     
                        Math.FiniteField.Class
                        Math.FiniteField.PrimeField.Generic
                        Math.FiniteField.PrimeField.Small
                        Math.FiniteField.GaloisField.Small
                        Math.FiniteField.GaloisField.Zech
                        Math.FiniteField.GaloisField.Zech.C
                        Math.FiniteField.Conway
                        Math.FiniteField.TypeLevel
                        Math.FiniteField.Primes
                        Math.FiniteField.Sign

  Other-Modules:        Math.FiniteField.TypeLevel.Singleton
                        Math.FiniteField.Conway.Internal
                        Math.FiniteField.PrimeField.Generic.Raw
                        Math.FiniteField.PrimeField.Small.Raw
                        Math.FiniteField.GaloisField.Small.Internal
                        Math.FiniteField.Misc

  Default-Language:     Haskell2010
  Default-Extensions:   CPP, BangPatterns, KindSignatures, DataKinds

  Hs-Source-Dirs:       src

  include-dirs:         cbits
  includes:             cbits/zech.h

  C-Sources:            cbits/conway_table.c 
                        cbits/zech.c

  ghc-options:          -fwarn-tabs -fno-warn-unused-matches -fno-warn-name-shadowing -fno-warn-unused-imports
  -- cc-options:           -O3

--------------------------------------------------------------------------------

test-suite finite-fields-tests
                      
  type:                 exitcode-stdio-1.0
  hs-source-dirs:       test
  main-is:              TestSuite.hs

  other-modules:        Test.FieldTests
                        Test.SubFields
                        Test.ConcreteFields
                        Test.FieldProperties
                        Test.WitnessStore
                        Test.Common

  Build-Depends:        base >= 4 && < 5, 
                        random >= 1.1 && < 2, 
                        containers >= 0.5 && < 1,
                        tasty >= 1.1 && < 2,
                        QuickCheck >= 2 && < 3, 
                        tasty-quickcheck >= 0.10 && < 2,
                        finite-fields

                        -- smallcheck >= 1.2, tasty-smallcheck
                        -- tasty-hunit,

  Default-Language:     Haskell2010
  Default-Extensions:   CPP, BangPatterns, KindSignatures, DataKinds

