Commit Graph

9 Commits

Author SHA1 Message Date
kinoru
5a2809a0f8 [ChaChaPoly1305] fix type error of example code
The example code had a type mismatch.

    Couldn't match expected type ‘State’
                with actual type ‘CryptoFailable State’
    In the second argument of ‘appendAAD’, namely ‘st1’
    In the second argument of ‘($)’, namely ‘appendAAD hdr st1’

This is due to the following part:

    let st1 = ChaChaPoly1305.initialize key nonce
        st2 = ChaChaPoly1305.finalizeAAD $ ChaChaPoly1305.appendAAD hdr st1

`initialize` returns `CryptoFailable State`, not `State`.

This commit fixes the type mismatch, changes the return type of the
example function to `CryptoFailable ByteString`, and makes the code
to be immediately copy-and-paste-able.
2015-12-03 18:05:04 +00:00
John Galt
53270f1ef6 Removed unused language extension 2015-11-16 13:13:18 -05:00
John Galt
320186cdd1 Fix endianness of incrementNonce function for ChaChaPoly1305 2015-11-16 12:59:01 -05:00
Vincent Hanquez
7bd3a8f892 [ChaChaPoly1305] Document everything 2015-11-04 15:17:32 +00:00
John Galt
55c6988a6e Added support for incrementing Nonces 2015-10-05 14:08:08 -04:00
Joachim Breitner
507a8f8cea Use mkLE, not LE
to make sure the conversion to little endian is actually happening. This
fixes a test failure in ChaChaPoly1305. Fixes #31.
2015-08-27 14:52:37 +02:00
Vincent Hanquez
8a0bacfc6d [Poly1305] make initialize explicitely failable 2015-07-29 09:49:49 +01:00
Vincent Hanquez
e064af5cba [chachapoly1305] properly handle the decryption, and change combine to encrypt. 2015-07-29 07:24:46 +01:00
Vincent Hanquez
ce849fb0d2 [ChaChaPoly1305] add implementation and simple KAT test 2015-07-19 17:53:56 +01:00