Thomas DuBuisson wrote:
Sorry, the example was all messed up, even if it did communicate what
I wanted its just so broken I must fix.
Slightly contrived example:
buildAgreementMessage :: (Monad m, CryptoRandomGen g,
ASymetricCipher k) = g - k - m (B.ByteString, (k,k), g)
Thomas DuBuisson wrote:
There is a blog on this [1], but the main points about the new class
are:
1) Generates bytestrings, not Ints
I like this one because it's semantically truer (tm). ;-)
2) Generalized PRNG construction and reseeding
...which takes the great burden off it's users
On Sat, Sep 4, 2010 at 3:23 AM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
A better reason is the data structure has
no way to implement generateKeyPair.
That's a non-problem: each algorithm (RSA, DSA, ...) implements a
function with the same type as generateKeyPair . Compare
rsa
Sorry, the example was all messed up, even if it did communicate what
I wanted its just so broken I must fix.
Slightly contrived example:
buildAgreementMessage :: (Monad m, CryptoRandomGen g,
ASymetricCipher k) = g - k - m (B.ByteString, (k,k), g)
buildAgreementMessages g k = do
[CC'ing maintainer of MonadRandom]
On Sep 3, 2010, at 1:59 AM, Thomas DuBuisson wrote:
data Key = Key {
encrypt :: B.ByteString - B.ByteString,
decrypt :: B.ByteString - B.ByteString,
keyLength :: BitLength,
serialize ::
On Sep 3, 2010, at 10:40 AM, Sebastian Fischer wrote:
An advantage of using a MonadRandom class would be that the
CryptoAPI would be independent of RandomGen or your new alternative.
One could define random monads based on either.
I was wrong. The MonadRandom class uses the Random class
If MR the more agreeable path
then I'll do it, though this means I use the unholy fail function.
You don't want to use monads because the Monad class defines the fail
function?
Sorry, I phrased this better on the blog comment. I don't want to use
MonadRandom m = m (p,p) (MonadRandom + fail)
Marcel noted:
A central interface to get the output of a PRNG would be nice,
preferably not constrained to Int like RandomGen.
While BOS said:
Also, don’t use RandomGen for your asymmetric PRNG. The
default implementation in System.Random gives absolutely
disastrous performance, and the
On Aug 27, 2010, at 11:12 AM, Heinrich Apfelmus wrote:
Is it actually necessary to use a type class here? The situation is
very similar to
Luke Palmer. Haskell Antipattern: Existential Typeclass.
http://lukepalmer.wordpress.com/2010/01/24/
I suggest to use good old data types
data
On Sep 3, 2010, at 12:07 AM, Sebastian Fischer wrote:
Why not use
generateKeypair :: MonadRandom m = BitLength - m (Maybe (p,p))
Or if the choice to generate keys or not should solely depend on the
BitLength (and not on the random generator):
generateKeypair :: MonadRandom m =
On Thu, Sep 2, 2010 at 3:07 PM, Sebastian Fischer
s...@informatik.uni-kiel.de wrote:
data Key = Key {
encrypt :: B.ByteString - B.ByteString,
decrypt :: B.ByteString - B.ByteString,
keyLength :: BitLength,
serialize :: B.ByteString}
Is there a reason this belongs under the Data. prefix? Why not break it out
into Crypto, so future implementers of algorithms can also put their stuff
under there. Everything at some level can be seen as Data, and it would be
nice to start moving out of the overcrowded module hierarchy.
On Fri,
Thomas DuBuisson wrote:
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
Is
On Mon, 2010-08-23 at 10:05 -0700, Thomas DuBuisson wrote:
All,
Crypto-API - a unified interface to which I hope hash and cipher
algorithms will adhere - has recently gotten a reasonable amount of
polish work. I continue to welcome all comments! A blog on its
current interface is online
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:
Thomas DuBuisson wrote:
[1]
http://tommd.wordpress.com/2010/08/23/a-haskell-api-for-cryptographic-algorithms/
class (Binary p, Serialize p) = AsymCipher p where
generateKeypair :: RandomGen g = g - BitLength - Maybe ((p,p),g)
encryptAsym :: p - B.ByteString - B.ByteString
16 matches
Mail list logo