diff options
Diffstat (limited to 'ToxCrypto.hs')
-rw-r--r-- | ToxCrypto.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ToxCrypto.hs b/ToxCrypto.hs index 87f64c9a..9dea7477 100644 --- a/ToxCrypto.hs +++ b/ToxCrypto.hs | |||
@@ -39,6 +39,8 @@ module ToxCrypto | |||
39 | , State(..) | 39 | , State(..) |
40 | , zeros32 | 40 | , zeros32 |
41 | , zeros24 | 41 | , zeros24 |
42 | , decryptSymmetric | ||
43 | , encryptSymmetric | ||
42 | ) where | 44 | ) where |
43 | 45 | ||
44 | import qualified Crypto.Cipher.Salsa as Salsa | 46 | import qualified Crypto.Cipher.Salsa as Salsa |
@@ -162,6 +164,12 @@ storePlain a = Plain <$> BA.create (sizeOf a) (`poke` a) | |||
162 | retrievePlain :: Storable a => Plain Storable a -> IO a | 164 | retrievePlain :: Storable a => Plain Storable a -> IO a |
163 | retrievePlain (Plain bs) = BA.withByteArray bs peek | 165 | retrievePlain (Plain bs) = BA.withByteArray bs peek |
164 | 166 | ||
167 | decryptSymmetric :: SymmetricKey -> Nonce24 -> Encrypted a -> Either String (Plain s a) | ||
168 | decryptSymmetric sym nonce e = _todo | ||
169 | |||
170 | encryptSymmetric :: SymmetricKey -> Nonce24 -> Plain s x -> Encrypted x | ||
171 | encryptSymmetric = _todo | ||
172 | |||
165 | data State = State Poly1305.State XSalsa.State | 173 | data State = State Poly1305.State XSalsa.State |
166 | 174 | ||
167 | decrypt :: State -> Encrypted a -> Either String (Plain s a) | 175 | decrypt :: State -> Encrypted a -> Either String (Plain s a) |