-
Notifications
You must be signed in to change notification settings - Fork 5
/
hwsl2.cabal
157 lines (128 loc) · 5.35 KB
/
hwsl2.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
-- Initial hwsl2.cabal generated by cabal init. For further documentation,
-- see http://haskell.org/cabal/users-guide/
-- The name of the package.
name: hwsl2
-- The package version. See the Haskell package versioning policy (PVP)
-- for standards guiding when and how versions should be incremented.
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
version: 0.4.0.1
-- A short (one-line) description of the package.
synopsis: Hashing with SL2
-- A longer description of the package.
description:
An algebraic hash function, inspired by the paper /Hashing with SL2/ by Tillich and Zemor.
.
The hash function is based on matrix multiplication in the special linear group
of degree 2, over a Galois field of order 2^127, with all computations modulo
the polynomial x^127 + x^63 + 1.
.
This construction gives some nice properties, which traditional bit-scambling
hash functions don't possess, including it being composable. It holds:
.
> hash (m1 <> m2) == hash m1 <> hash m2
.
Following that, the hash function is also parallelisable. If a message can be divided
into a list of chunks, the hash of the message can be calculated in parallel:
.
> mconcat (parMap rpar hash chunks)
.
All operations in this package are implemented in a very efficient manner using SSE instructions.
-- URL for the project homepage or repository.
homepage: https://github.com/srijs/hwsl2
-- The license under which the package is released.
license: MIT
-- The file containing the license text.
license-file: LICENSE
-- The package author(s).
author: Sam Rijs
-- An email address to which users can send suggestions, bug reports, and
-- patches.
maintainer: [email protected]
-- A copyright notice.
-- copyright:
category: Data
build-type: Simple
-- Extra files to be distributed with the package, such as examples or a
-- README.
extra-source-files: README.md
src/core/sl2-inl.h src/core/gf2p127-inl.h
-- Constraint on the version of Cabal needed to build this package.
cabal-version: >=1.10
source-repository head
type: git
location: git://github.com/srijs/hwsl2-haskell.git
flag avx2
description: Enable AVX 2 optimisations.
default: False
library
-- Modules exported by the library.
exposed-modules: Data.Hash.SL2
Data.Hash.SL2.Chunk
Data.Hash.SL2.Mutable
Data.Hash.SL2.Unsafe
-- Modules included in this library but not exported.
other-modules: Data.Hash.SL2.Internal
-- LANGUAGE extensions used by modules in this package.
other-extensions: ForeignFunctionInterface CApiFFI
Safe Trustworthy Unsafe
-- Other library packages from which modules are imported.
build-depends: base >=4.8 && <5, bytestring >=0.10
-- Directories containing source files.
hs-source-dirs: src
ghc-options: -fwarn-unused-imports
-- Options for foreign source files.
include-dirs: src/core
if flag(avx2)
cc-options: -Wall -mavx2 -msse4.1 -msse2 -mpclmul
ghc-options: -optc-mavx2 -optc-msse4.1 -msse2 -optc-mpclmul
else
cc-options: -Wall -msse4.1 -msse2 -mpclmul
ghc-options: -optc-msse4.1 -msse2 -optc-mpclmul
-- Base language which the package is written in.
default-language: Haskell2010
test-suite test
type: exitcode-stdio-1.0
hs-source-dirs: src
main-is: Data/Hash/SL2/Test.hs
other-modules: Data.Hash.SL2
Data.Hash.SL2.Mutable
Data.Hash.SL2.Unsafe
Data.Hash.SL2.Internal
build-depends: base >=4.8 && <5,
bytestring >=0.10,
tasty >=0.10,
tasty-quickcheck >=0.8,
quickcheck-properties >= 0.1
include-dirs: src/core
if flag(avx2)
cc-options: -Wall -mavx2 -msse4.1 -msse2 -mpclmul
ghc-options: -optc-mavx2 -optc-msse4.1 -msse2 -optc-mpclmul
else
cc-options: -Wall -msse4.1 -msse2 -mpclmul
ghc-options: -optc-msse4.1 -msse2 -optc-mpclmul
default-language: Haskell2010
benchmark bench
type: exitcode-stdio-1.0
hs-source-dirs: src
main-is: Data/Hash/SL2/Benchmark.hs
other-modules: Data.Hash.SL2
Data.Hash.SL2.Mutable
Data.Hash.SL2.Unsafe
Data.Hash.SL2.Internal
build-depends: base >=4.8 && <5,
Cabal >=1.9.2,
bytestring >=0.10,
criterion >=1.0,
cryptohash >=0.11,
parallel >=3.2
include-dirs: src/core
if flag(avx2)
cc-options: -Wall -mavx2 -msse4.1 -msse2 -mpclmul
ghc-options: -rtsopts -threaded -optc-mavx2 -optc-msse4.1 -msse2 -optc-mpclmul
else
cc-options: -Wall -msse4.1 -msse2 -mpclmul
ghc-options: -rtsopts -threaded -optc-msse4.1 -msse2 -optc-mpclmul
default-language: Haskell2010