raaz-crypto / raaz

Cryptographic library for Haskell
Apache License 2.0
68 stars 24 forks source link

Handwritten C implementations added to the mix #381

Closed piyush-kurur closed 5 years ago

piyush-kurur commented 5 years ago

We have introduces handwritten implementations again so as to compare it with that exposed by verse. The output of the benchmarking code is now in csv for better comparison.

piyush-kurur commented 5 years ago

@Mistuke I am not sure why but I have tried running benchmarks and it fails on appveryor. (Note, it is not a compilation failure). Do you have any pointers for fixing this ?

Mistuke commented 5 years ago

Do your benchmarks test Unicode characters?

piyush-kurur commented 5 years ago

Yeah okey I will supress that

Mistuke commented 5 years ago

You don't have to, change the console's codepage to UTF8. Windows's default codepage isn't a Unicode one.

Add chcp 65001

somewhere in your AppVeyor script before running the tests.

That should work, if it doesn't then you may need to tell GHC about it too

hSetEncoding stdout utf8

though this shouldn't be needed as GHC defaults to the codepage of the console.

Mistuke commented 5 years ago

looks like you do need to set the encoding type in the tests as well. When the new I/O manager is in this should work out of the box, but for now you have to manually change the encoding.

piyush-kurur commented 5 years ago

@Mistuke thanks for the prompt help. Now the build is fixed.

Mistuke commented 5 years ago

@piyush-kurur no problem :) btw I saw this in the logs

Raaz.Core.ByteSource
  /dev/null
    should return Exhausted even for a read request of 0
      # PENDING: Non-posix system needs an equivalent of /dev/null

Windows's NULL device is called NUL.

For GHC's prior to 8.6 you can access it using just NUL as the file name, so e.g. /NUL, for GHC's after and including 8.6 you need \\.\NUL (escaped as \\\\.\\NUL of course) as the filename. You'll need to ifdef on the version of base to use the correct one.

piyush-kurur commented 5 years ago

Okey I have created an issue for this. Will try to fix this at some point of time.