0
votes

I am trying to run some haskell files, I have never done haskell by the way before and i am running into an error.

import Crypto.Types.PubKey.ECDSA (Signature(..), PrivateKey(..), PublicKey(..))
import Crypto.Types.PubKey.ECC (Curve(CurveFP), CurvePrime(..), CurveCommon(..), Point(..))

import Codec.Crypto.ECC.Base (modinv)

import Crypto.Random (genBytes, GenError, CryptoRandomGen)
import Crypto.Util (bs2i, i2bs, i2bs_unsized)

import ECDSA.Util

Could not find module ‘Crypto.Types.PubKey.ECC’
Use -v to see a list of the files searched for.

How do i import/install these modules? Thanks.

An output of ghc-pkg list

 Cabal-2.0.0.2
    GLURaw-2.0.0.3
    GLUT-2.7.0.12
    HTTP-4000.3.7
    HUnit-1.6.0.0
    ObjectName-1.1.0.1
    OpenGL-3.0.2.0
    OpenGLRaw-3.2.5.0
    QuickCheck-2.10.0.1
    StateVar-1.1.0.4
    array-0.5.2.0
    async-2.1.1.1
    attoparsec-0.13.2.0
    base-4.10.0.0
    binary-0.8.5.1
    bytestring-0.10.8.2
    call-stack-0.1.0
    case-insensitive-1.2.0.10
    containers-0.5.10.2
    deepseq-1.4.3.0
    directory-1.3.0.2
    fgl-5.6.0.0
    filepath-1.4.1.2
    fixed-0.2.1.1
    ghc-8.2.1
    ghc-boot-8.2.1
    ghc-boot-th-8.2.1
    ghc-compact-0.1.0.0
    ghc-prim-0.5.1.0
    ghci-8.2.1
    half-0.2.2.3
    hashable-1.2.6.1
    haskeline-0.7.4.0
    haskell-src-1.0.2.0
    hoopl-3.10.2.2
    hpc-0.6.0.3
    hscolour-1.24.1
    html-1.0.1.2
    integer-gmp-1.0.1.0
    integer-logarithms-1.0.2
    mtl-2.2.1
    network-2.6.3.2
    network-uri-2.6.1.0
    parallel-3.2.1.1
    parsec-3.1.11
    pretty-1.1.3.3
    primitive-0.6.2.0
    process-1.6.1.0
    random-1.1
    regex-base-0.93.2
    regex-compat-0.95.1
    regex-posix-0.95.2
    rts-1.0
    scientific-0.3.5.1
    split-0.2.3.2
    stm-2.4.4.1
    syb-0.7
    template-haskell-2.12.0.0
    terminfo-0.4.1.0
    text-1.2.2.2
    tf-random-0.5
    time-1.8.0.2
    transformers-0.5.2.0
    unix-2.7.2.2
    unordered-containers-0.2.8.0
    vector-0.12.0.1
    xhtml-3000.2.2
    zlib-0.6.1.2


name:            ecdsa
version:         0.2
cabal-version:   >= 1.8
license:         OtherLicense
license-file:    COPYING
category:        Crypto
copyright:       © 2014 Stephen Paul Weber
author:          Stephen Paul Weber <[email protected]>
maintainer:      Stephen Paul Weber <[email protected]>
stability:       experimental
tested-with:     GHC == 7.4.1
synopsis:        Basic ECDSA signing implementation
homepage:        https://github.com/singpolyma/ecdsa-haskell
bug-reports:     https://github.com/singpolyma/ecdsa-haskell/issues
build-type:      Simple
description:
        Wraps the stuff in hecc to do ECDSA.

extra-source-files:
        README

library
        exposed-modules:
                ECDSA

        other-modules:
                ECDSA.Util

        build-depends:
                base == 4.*,
                bytestring,
                hecc,
                crypto-pubkey-types,
                crypto-api

source-repository head
        type:     git
        location: git://github.com/singpolyma/ecdsa-haskell.git

This is the .cabal file, and i downloaded this project from this github link to try to understand it

https://github.com/singpolyma/ecdsa-haskell

1
can you tell us more about your setup - do you use stack or cabal do you have a single file or a project? what ghc-version do you use, what version of stack and cabal? Can you show the output of ghc-pkg list? - epsilonhalbe
hello @epsilonhalbe I went to haskell.org/downloads and i downloaded the "Haskell Platform: Installs GHC, Cabal, and some other tools, along with a starter set of libraries in a global location on your system". I also use stack version 1.5.1. Its a project, and i am using the Sublime Text IDE. I edited the post to show the output of ghc-pkg list - PythonRookie
if you use a project you have to add the-library to your build-depends section in your .cabal-file. Which library - I don't know but stack buildshould give you a good guess what to add. - epsilonhalbe
please show me the contents of your .cabal-file then I can help you a little bit more. (also don't post pictures of your terminal output, but rather include the text, such that the question is self contained, if the pic is removed from whatever platform, nobody reading this in a few years will understand what this is about.) - epsilonhalbe
Hello @epsilonhalbe, I will be editing my posts in a few minutes. This is my first time trying out haskell, so i apologize for the little questions that i am asking that i should already have the answer to - PythonRookie

1 Answers

0
votes

I tried to build the package but it requires llvm-3.9 to work, which for some reason does not in my setup.

Also the package hecc is deprecated - and the git repo is 4 years old, quite outdated. if you use this for production purposes I would strongly discourage you from doing that.

Here is a stack.yaml which should probably work, but hF2+llvm keeps bugging me as I said before.

stack.yaml

resolver: nightly-2017-10-28
packages:
- .
extra-deps:
- hF2-0.2
- hecc-0.4.1.1
flags: {}
extra-package-dbs: []

try to build with stack build