pasta-curves: Provides the Pasta curves: Pallas, Vesta and their field elements Fp and Fq.

[ cryptography, elliptic-curves, library, mit, program ] [ Propose Tags ] [ Report a vulnerability ]

Provides the Pasta curves: Pallas, Vesta and their field elements Fp and Fq. See the PastaCurves module below and/or the GitHub repository README.md for more details.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.0, 0.0.1.0
Change log CHANGELOG.md
Dependencies base (>=4.12 && <4.17), bytestring (>=0.10 && <0.11.4), cryptonite (>=0.29 && <0.31), memory (>=0.16 && <0.18), random (>=1.1 && <1.3), utf8-string (>=1 && <1.0.3) [details]
Tested with ghc ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.2
License MIT
Copyright 2022 Eric Schorn
Author Eric Schorn
Maintainer Eric Schorn <eric.schorn@nccgroup.com>
Category Cryptography, Elliptic Curves
Home page https://github.com/nccgroup/pasta-curves
Bug tracker https://github.com/nccgroup/pasta-curves/issues
Source repo head: git clone https://github.com/nccgroup/pasta-curves.git
Uploaded by eschorn at 2022-08-31T22:41:04Z
Distributions
Executables pasta-curves
Downloads 197 total (7 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-08-31 [all 1 reports]

Readme for pasta-curves-0.0.1.0

[back to package description]

pasta-curves

Stack CI Cabal CI Hackage Stackage Lts Stackage Nightly MIT license

This Haskell library provides the Pasta Curves consisting of: the Pallas curve and its Fp field element, the Vesta curve and its Fq field element, and a variety of supporting functionality such as point/element arithmetic, serialization, and hash-to-curve. The algorithms are NOT constant time.

Pallas is y2 = x3 + 5 over Fp(0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001). The order of the Pallas curve is 0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001.

Vesta is y2 = x3 + 5 over Fq(0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001). The order of the Vesta curve is 0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001.

The curves are designed such that the order of one matches the field characteristic of the other. For a brief introduction, see the Zcash blog titled "The Pasta Curves for Halo 2 and Beyond". The reference Rust implementation (which inspired this implementation) can be found at: https://github.com/zcash/pasta_curves.

Example usage of this library implementation:

$ cabal repl

ghci> a = 9 :: Fp

ghci> a*a
0x0000000000000000000000000000000000000000000000000000000000000051

ghci> pointMul a base :: Vesta
Projective {_px = 0x3CDC6A090F2BB3B52714C083929B620FE24ADBCBBD420752108CD7C29E543E5E, 
            _py = 0x08795CD330B3CE5AA63BD2B18DE155AE3C96E8AF9DA2CC742C6BA1464E490161, 
            _pz = 0x1FA26F58F3A641ADFE81775D3D53378D6178B6CCBF14F9BD4AB5F10DEE28D878}

Copyright 2022 Eric Schorn; Licensed under the MIT License.