Safe Haskell | None |
---|---|
Language | Haskell2010 |
Finite Field Cryptography (FFC) is a method of implementing discrete logarithm cryptography using finite field mathematics.
Synopsis
- data FFC = FFC {
- ffc_name :: !Text
- ffc_fieldCharac :: !Natural
- ffc_groupGen :: !Natural
- ffc_groupOrder :: !Natural
- fieldCharac :: forall c. Reifies c FFC => Natural
- weakFFC :: FFC
- beleniosFFC :: FFC
Type FFC
Mutiplicative subgroup of a Finite Prime Field.
NOTE: an FFC
term-value is brought into the context of many functions
through a type-variable c
whose Reifies
constraint enables to reflect
that FFC
at the term-level (a surprising technique but a very useful one).
Doing like this is simpler than working in a Monad
(like a Reader
),
and enables that FFC
term to be used simply in instances' methods
not supporting an inner Monad
, like parseJSON
, randomR
, fromEnum
or arbitrary
.
Aside from that, the sharing of FFC
amongst several types
is encoded at the type-level by including c
as a phantom type of F
, G
and E
.
FFC | |
|
Instances
Examples
beleniosFFC :: FFC Source #
Parameters used in Belenios.
A 2048-bit fieldCharac
of a Finite Prime Field,
with a 256-bit groupOrder
for a multiplicative subgroup
generated by groupGen
.