Crypto-API is stabilizing

Thomas DuBuisson thomas.dubuisson at gmail.com
Sun Sep 5 10:23:25 EDT 2010


On Sun, Sep 5, 2010 at 1:30 AM, Marcel Fourné <marcel at bitrot.dyndns.org> wrote:
>>3) 'split' is in a different class.
>
> Is it necessary for crypto-use?

For now the Splittable class is necessary for the CryptoRandomGen -->
RandomGen path allowing more users to use CryptoRandomGen instances:

    data AsRandomGen g = AsRG g
    instance (CryptoRandomGen, SplittableGen g) => RandomGen
(AsRandomGen g) where ...

... but in general, no I don't see it being used and hope people avoid
split like its ML.

Eventually I see Crypto.Random becoming part of the 'random' package
(at the same time as an overhaul of RandomGen).  If that happens I
envision an interface like:


    class Random a where
        someFuncs :: (RandomGen g) =>  ...

    class RandomGen g where
        next :: g -> (Int, g)

    class SplittableGen g where
        split :: g -> Either GenError (g,g)

    class CryptoRandomGen g where ...


Not sure if we'd want to make split always succeed, if RandomGen
should still return Int, etc, but this change is not going finish
being discussed before crypto-api is out.  Heck, I haven't even
e-mailed in the proposal yet.

Cheers,
Thomas


More information about the Libraries mailing list