Crypto-API is stabilizing (Thomas DuBuisson)
John Lato
jwlato at gmail.com
Fri Aug 27 05:22:39 EDT 2010
>
> From: Thomas DuBuisson <thomas.dubuisson at gmail.com>
>
> >>class (Binary p, Serialize p) => AsymCipher p where
> >> generateKeypair :: RandomGen g => g -> BitLength -> Maybe ((p,p),g)
> >> encryptAsym :: p -> B.ByteString -> B.ByteString
> >> decryptAsym :: p -> B.ByteString -> B.ByteString
> >> asymKeyLength :: p -> BitLength
> >
> > Regarding AsymCipher:
> > Some algorithms do not lend themselves to encryption/decryption or have
> > special properties which differentiate their use in enc/dec an
> > signing/verifying.
> >
> > I propose the following two additions for the class:
> > signAsym :: p -> B.ByteString -> B.ByteString
> > verifyAsym :: p -> B.ByteString -> Bool
> >
> > This way algorithms can leave parts undefined which do not apply to
> > them or hide their different behaviour.
>
> I am strongly against classes for which we already know instanes will
> need a good deal of undefined routines.
>
I agree. However, you could just make separate type class for these
methods.
John Lato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20100827/d5f618ab/attachment.html
More information about the Libraries
mailing list