Last active
August 29, 2015 14:00
-
-
Save sellout/73355d6e7719f6475742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cipher c where | |
bitsPerChunk : Nat | |
class Cipher k => StreamCipher k where | |
generateKeystream : k -> Stream (Bits bitsPerChunk) | |
instance Cipher (AllegedRivestCipher4 n) where | |
bitsPerChunk = 8 | |
instance StreamCipher (AllegedRivestCipher4 n) where | |
generateKeystream (ARC4 key) = PGRA 0 0 (KSA key) | |
-- When elaborating type of Data.Crypto.Encryption.StreamCipher.AllegedRivestCipher4 n instance of Data.Crypto.Encryption.StreamCipher.StreamCipher, method generateKeystream: | |
-- Can't resolve type class Data.Crypto.Encryption.SymmetricCipher.Cipher c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment