Rearrange the halo2 code, and some cleanup

sellout
Sep 28, 2022, 3:20 AM
OLNSSFZIXFNU6CHJ3HX54OB6KQJ2ASHVDSBPJ7KB2MEBGMWS3HZAC

Dependencies

Change contents

  • file move: Halo2 (d--r------)halo2 (d--r------)
    [3.1]
    [2.832]
  • file addition: halo2.cabal (----------)
    [2.832]
    cabal-version: 2.4
    name: halo2
    version: 0.1.0.0
    synopsis: Playing with Halo-y things.
    -- description:
    homepage: https://nest.pijul.com/sellout/crypto-junk
    bug-reports: https://nest.pijul.com/sellout/crypto-junk/discussions
    license: AGPL-3.0-or-later
    author: Greg Pfeil
    maintainer: greg@technomadic.org
    copyright: 2022 Greg Pfeil
    category: Cryptography
    extra-source-files: CHANGELOG.md
    library
    exposed-modules: PLONKish
    ghc-options: -Weverything
    build-depends: base
    , containers
    , fin
    , vec
    default-language: Haskell2010
  • edit in halo2/PLONKish.hs at line 10
    [2.1070]
    [2.1070]
    NoImplicitPrelude,
  • edit in halo2/PLONKish.hs at line 12
    [2.1090]
    [2.1090]
    Safe,
  • replacement in halo2/PLONKish.hs at line 16
    [2.1122][2.1122:1144]()
    module Halo2.PLONKish
    [2.1122]
    [2.1144]
    module PLONKish
  • edit in halo2/PLONKish.hs at line 33
    [2.1507]
    [2.1507]
    import Control.Applicative (Applicative (..))
    import Control.Category (Category(..))
  • replacement in halo2/PLONKish.hs at line 37
    [2.1573][2.1573:1618]()
    import Data.Either.Combinators (maybeToLeft)
    [2.1573]
    [2.1618]
    import Data.Eq (Eq (..))
  • replacement in halo2/PLONKish.hs at line 39
    [2.1640][2.1640:1670]()
    import Data.Foldable (toList)
    [2.1640]
    [2.1670]
    import Data.Foldable (Foldable (..))
    import Data.Functor (Functor (..))
  • replacement in halo2/PLONKish.hs at line 44
    [2.1772][2.1772:1802]()
    import Data.Maybe (catMaybes)
    [2.1772]
    [2.1802]
    import Data.Maybe (Maybe (..), catMaybes, maybe)
    import Data.Ord (Ord (..))
  • replacement in halo2/PLONKish.hs at line 47
    [2.1833][2.1833:1866]()
    import Data.Semigroup (Sum (..))
    [2.1833]
    [2.1866]
    import Data.Semigroup (Semigroup (..), Sum (..))
  • edit in halo2/PLONKish.hs at line 50
    [2.1921]
    [2.1921]
    import Data.Traversable (Traversable)
    import Data.Tuple qualified as Tuple
  • edit in halo2/PLONKish.hs at line 58
    [2.2128]
    [2.2128]
    import Prelude (Bool, Either (..), Integer, Num (..), Show (..), flip, ($))
  • replacement in halo2/PLONKish.hs at line 223
    [2.8195][2.8195:8225]()
    maybeToLeft
    ( circuit {
    [2.8195]
    [2.8225]
    maybe
    ( pure $ circuit {
  • edit in halo2/PLONKish.hs at line 229
    [2.8340]
    [2.8340]
    Left
  • replacement in halo2/PLONKish.hs at line 247
    [2.8873][2.8873:8917]()
    if checkEqualityColumn config (fst x)
    [2.8873]
    [2.8917]
    if checkEqualityColumn config (Tuple.fst x)
  • replacement in halo2/PLONKish.hs at line 250
    [2.8951][2.8951:9000]()
    Just . IllegalEqualityColumn (fst x) $
    [2.8951]
    [2.9000]
    Just . IllegalEqualityColumn (Tuple.fst x) $
  • replacement in halo2/PLONKish.hs at line 253
    [2.9046][2.9046:9366]()
    -- | This builds an elliptic curve from the two coefficients, returning a
    -- function that, given the x component of a point will return the positive y
    -- component. The negative component can be found via point inversion.
    ellipticCurve :: Field f => f -> f -> f -> f
    ellipticCurve a b x = sqrt $ x ** 3 + a * x + b
    [2.9046]
    [2.9366]
    -- -- | This builds an elliptic curve from the two coefficients, returning a
    -- -- function that, given the x component of a point will return the positive y
    -- -- component. The negative component can be found via point inversion.
    -- ellipticCurve :: Field f => f -> f -> f -> f
    -- ellipticCurve a b x = sqrt $ x ** 3 + a * x + b
  • replacement in halo2/PLONKish.hs at line 259
    [2.9367][2.9367:9383]()
    type F_101 = ()
    [2.9367]
    [2.9383]
    -- type F_101 = ()
  • replacement in halo2/PLONKish.hs at line 261
    [2.9384][2.9384:9430]()
    meh :: F_101 -> F_101
    meh = ellipticCurve 0 3
    [2.9384]
    [2.9430]
    -- meh :: F_101 -> F_101
    -- meh = ellipticCurve 0 3
  • replacement in halo2/PLONKish.hs at line 264
    [2.9431][2.9431:9452]()
    type ProvingKey = ()
    [2.9431]
    [2.9452]
    -- type ProvingKey = ()
  • replacement in halo2/PLONKish.hs at line 266
    [2.9453][2.9453:9479]()
    type VerificationKey = ()
    [2.9453]
    [2.9479]
    -- type VerificationKey = ()
  • replacement in halo2/PLONKish.hs at line 268
    [2.9480][2.9480:9557]()
    generateProvingKey :: Circuit f c r mcd -> ProvingKey
    generateProvingKey = _
    [2.9480]
    [2.9557]
    -- generateProvingKey :: Circuit f c r mcd -> ProvingKey
    -- generateProvingKey = _
  • replacement in halo2/PLONKish.hs at line 271
    [2.9558][2.9558:9650]()
    generateVerificationKey :: Circuit f c r mcd -> VerificationKey
    generateVerificationKey = _
    [2.9558]
    -- generateVerificationKey :: Circuit f c r mcd -> VerificationKey
    -- generateVerificationKey = _
  • file addition: cabal.project (----------)
    [3.1]
    packages:
    ./halo2/halo2.cabal
  • file addition: README.md (----------)
    [3.1]
    # Crypto(graphy) Junk
    Various packages playing with different crypto primitives, schemes, etc. in Haskell.
    Probably none of it works. Mostly meant to look pretty.
    If you do manage to depend on one of these packages, the modules are meant to be used with [package-qualified imports](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html?highlight=package%20qualified). E.g.,
    ```haskell
    {-# language PackageImports #-}
    import "halo2" PLONKish.hs
    ```